summaryrefslogtreecommitdiff
path: root/vimrc
blob: c946cbf93178717e07b47fa55db592feed2bee94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
runtime! debian.vim
filetype plugin on
set ai
:set nocompatible
:syn on
:set title
:set pastetoggle=<F10>
:set listchars=tab:»·,trail:·
:set list
:nmap <F11> :set invlist<return>
:imap <F11> <C-O>:set invlist<return>
:set clipboard^=autoselectml guioptions+=A
let g:Imap_UsePlaceHolders = 1
let g:Imap_FreezeImap = 1
":set fileencodings=ucs-bom,utf-8,default,latin1
:hi MatchParen ctermbg=black
colorscheme peachpuff

map <F3> :n<return>
map <F2> :N<return>
map <F5> :wn<return>
map <F4> :wN<return>
map fd ggV/^-- <CR><up>gq

" nnoremap <silent> <C-M> :make<return>
nnoremap <silent> <C-D> :!make clean && make<return>
nnoremap <silent> <C-B> :!make<return>
" nnoremap <silent> <C-B> :!make<return>

" Set up the left-right actions just right:
" -----------------------------------------
" Map Shift-{Left,Right} to the previous/next buffer
" both in normal mode and in insert mode.
"  This is for urxvt on buster (rxvt-unicode-256color)
"  and a screen launched in that (screen-bce)
nnoremap <silent> <Esc>[d :bprevious<return>
nnoremap <silent> <Esc>[c :bnext<return>
inoremap <silent> <Esc>[d <C-O>:bprevious<return>
inoremap <silent> <Esc>[c <C-O>:bnext<return>

"  This makes it work in a tmux on urxvt,
"  in xterm, and in tmux/screen in xterm.
nnoremap <silent> <Esc>[1;2D :bprevious<return>
nnoremap <silent> <Esc>[1;2C :bnext<return>
inoremap <silent> <Esc>[1;2D <C-O>:bprevious<return>
inoremap <silent> <Esc>[1;2C <C-O>:bnext<return>


" Navigate in (split) windows
" up/down/left/right
"  in xterm:
nnoremap <silent> <Esc>[1;3A :wincmd k<return>
nnoremap <silent> <Esc>[1;3B :wincmd j<return>
nnoremap <silent> <Esc>[1;3D :wincmd h<return>
nnoremap <silent> <Esc>[1;3C :wincmd l<return>
inoremap <silent> <Esc>[1;3A <C-O>:wincmd k<return>
inoremap <silent> <Esc>[1;3B <C-O>:wincmd j<return>
inoremap <silent> <Esc>[1;3D <C-O>:wincmd h<return>
inoremap <silent> <Esc>[1;3C <C-O>:wincmd l<return>

"  in urxvt I can't get Alt-<Arrows> to work, so use ;/,.
" the up/down clash with  <Esc> to exit insert mode, followed by / to search :/
"nnoremap <silent> <Esc>; :wincmd k<return>
"nnoremap <silent> <Esc>/ :wincmd j<return>
nnoremap <silent> <Esc>, :wincmd h<return>
nnoremap <silent> <Esc>. :wincmd l<return>
"inoremap <silent> <Esc>; <C-O>:wincmd k<return>
"inoremap <silent> <Esc>/ <C-O>:wincmd j<return>
inoremap <silent> <Esc>, <C-O>:wincmd h<return>
inoremap <silent> <Esc>. <C-O>:wincmd l<return>

" nnoremap <silent> <S-left> :bprevious<return>
" nnoremap <silent> <S-right> :bnext<return>

" nnoremap <silent> <S-left> :bprevious<return>
" nnoremap <silent> <S-right> :bnext<return>
" inoremap <silent> <S-left> <C-O>:bprevious<return>
" inoremap <silent> <S-right> <C-O>:bnext<return>
" 
" nnoremap <silent> <C-left> :bprevious<return>
" nnoremap <silent> <C-right> :bnext<return>
" inoremap <silent> <C-left> <C-O>:bprevious<return>
" inoremap <silent> <C-right> <C-O>:bnext<return>
" 
" 
" nnoremap <silent> <Esc>[D :bprevious<return>
" nnoremap <silent> <Esc>[C :bnext<return>
" inoremap <silent> <Esc>[D <C-O>:bprevious<return>
" inoremap <silent> <Esc>[C <C-O>:bnext<return>
" 
" 
" nnoremap <silent> <space><left> :bprevious<return>
" nnoremap <silent> <space><right> :bnext<return>
"
" nnoremap <silent> <space><left> :bprevious<return>
" nnoremap <silent> <space><right> :bnext<return>

if &term =~ '^screen'
    " tmux will send xterm-style keys when xterm-keys is on
    execute "set <xUp>=\e[1;*A"
    execute "set <xDown>=\e[1;*B"
    execute "set <xRight>=\e[1;*C"
    execute "set <xLeft>=\e[1;*D"
endif



" wild/tab behavior
" =================
set wildmode=longest,list:longest,list:full

" Do not move cursor to the beginning of a line on buffer switch
:se nostartofline

" spelling stuff
" ==============
set spellfile=~/.vim.spell.en.add
:nmap <F8> :set invspell<return>
:imap <F8> <C-O>:set invspell<return>

" Detect indent stuff
" ===================
" wants the detectindent addon.
function WeaselDoIdent()
  if exists(":DetectIndent")
    DetectIndent
  endif
endfunction
:autocmd BufReadPost * exec WeaselDoIdent()

" Searching and highlighting
" ==========================
"hi Search cterm=NONE ctermfg=white ctermbg=darkgreen
hi Search cterm=NONE ctermfg=yellow ctermbg=19
set hlsearch
"This disabled search highlighting after a search
nnoremap <CR> :noh<CR><CR>

" misc settings
" =============
" Raise the number of maximum tabs
set tabpagemax=50
" Do not close buffers we don't see
set hidden


" set grepprg=grep\ -nH\ $*
" filetype indent on
" let g:tex_flavor='latex'
" "let g:Tex_PromptedEnvironments='eqnarray*,eqnarray,equation,equation*,\[,$$,align,align*'
" let g:Tex_PromptedEnvironments='frame,itemize'
" "call IMAP('FRAME', '\\begin{frame}{<++>}\<cr>  <++>\<cr>\\end{frame}', 'tex')
" let g:Tex_Env_frame = "\\begin{frame}{<++>}\<CR><++>\<CR>\\end{frame}"