.vimrc

changeset 18
5475788810a4
parent 14
9472c147e69b
child 19
92f55dbabb83
equal deleted inserted replaced
17:ce68232dec2c 18:5475788810a4
1 " vim: et sts=2 sw=2
2 " vim: fdm=marker
3
1 set nocompatible 4 set nocompatible
2 5
3 let on_windows=0 6 let on_windows=0
4 if has('win32') || has('win64') 7 if has('win32') || has('win64')
5 " vim in cygwin has win32 = 0 and win32unix = 1 8 " vim in cygwin has win32 = 0 and win32unix = 1
6 let on_windows=1 9 let on_windows=1
7 end 10 end
8 11
9 12
10 " >> Setting up Vundle - the vim plugin bundler 13 " {{{ Set up Vundle and plugins
11 let installed_vundle=0 14 let installed_vundle=0
12 15
13 if on_windows == 0 16 if on_windows == 0
14 let vundle_readme=expand('~/.vim/bundle/vundle/README.md') 17 let vundle_readme=expand('~/.vim/bundle/vundle/README.md')
15 else 18 else
73 " have some odd errors and get a weird UI at the end. 76 " have some odd errors and get a weird UI at the end.
74 echo "Please restart vim to continue with plugins installed." 77 echo "Please restart vim to continue with plugins installed."
75 quit 78 quit
76 endif 79 endif
77 endif 80 endif
78 " Setting up Vundle - the vim plugin bundler end 81 " }}}
79 82
80 83
81 " >> F-key maps, mostly plugin stuff 84 " {{{ Key maps, mostly plugin stuff on F-keys
82 nmap <silent> <F1> :Unite buffer<CR> 85 nmap <silent> <F1> :Unite buffer<CR>
83 nmap <silent> <F2> :Unite file<CR> 86 nmap <silent> <F2> :Unite file<CR>
84 nmap <silent> <F3> :VimShell<CR> 87 nmap <silent> <F3> :VimShell<CR>
85 map <silent> <F4> :noh<CR> 88 map <silent> <F4> :noh<CR>
86 nmap <silent> <F5> :GundoToggle<CR> 89 nmap <silent> <F5> :GundoToggle<CR>
102 imap <F5> <C-O><F5> 105 imap <F5> <C-O><F5>
103 "imap <F6> <C-O><F6> 106 "imap <F6> <C-O><F6>
104 "imap <F7> <C-O><F7> 107 "imap <F7> <C-O><F7>
105 imap <F8> <C-O><F8> 108 imap <F8> <C-O><F8>
106 109
107 110 " chdir to the directory of the open buffer
108 " >> General settings 111 map <leader>cd :cd %:p:h<cr>:pwd<cr>
112
113 map <leader>pp :setlocal paste!<cr>
114 "}}}
115
116
117 " {{{ General settings
109 syntax on 118 syntax on
110 filetype plugin indent on 119 filetype plugin indent on
111 120
112 set enc=utf-8 121 set enc=utf-8
113 122
120 129
121 set autoindent 130 set autoindent
122 set expandtab 131 set expandtab
123 set shiftwidth=2 132 set shiftwidth=2
124 set softtabstop=2 133 set softtabstop=2
125 " vim: enc=utf-8 et sts=2 sw=2
126 134
127 set backspace=indent,eol,start 135 set backspace=indent,eol,start
128 136
129 "set nu 137 "set nu
130 set scrolloff=2 138 set scrolloff=2
131 set ruler 139 set ruler
132 set showcmd 140 set showcmd
133 set wildmenu 141 set wildmenu
134 142
143 " Ignore compiled files and repositories
144 set wildignore=*.o,*~,*.pyc
145 if on_windows == 1
146 set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
147 else
148 set wildignore+=.git\*,.hg\*,.svn\*
149 endif
150
135 " Don't assume to scan includes when autocompleting 151 " Don't assume to scan includes when autocompleting
136 set cpt-=i 152 set cpt-=i
137 153
138 " Never open with folds collapsed 154 " Never open with folds collapsed
139 set nofoldenable 155 set nofoldenable
187 203
188 if has('persistent_undo') 204 if has('persistent_undo')
189 set undofile 205 set undofile
190 set undodir=$MYVIM/var/undo//,. 206 set undodir=$MYVIM/var/undo//,.
191 end 207 end
192 208 " }}}
193 209
194 " >> File type-specific settings 210
211 " {{{ File type-specific settings
195 autocmd FileType text setlocal textwidth=78 212 autocmd FileType text setlocal textwidth=78
196 213
197 function! PerlSettings () 214 function! PerlSettings ()
198 setlocal keywordprg=perldoc\ -f 215 setlocal keywordprg=perldoc\ -f
199 setlocal makeprg=perl\ -c\ %\ $* 216 setlocal makeprg=perl\ -c\ %\ $*
209 "autocmd BufWritePre * :%s/\s+$//e 226 "autocmd BufWritePre * :%s/\s+$//e
210 227
211 " perl fold scanning is slow 228 " perl fold scanning is slow
212 "let perl_fold = 1 229 "let perl_fold = 1
213 let perl_include_pod = 1 230 let perl_include_pod = 1
214 231 " }}}
215 232
216 " >> Plugin settings 233
234 " {{{ Plugin settings
217 " > Gundo 235 " > Gundo
218 " I prefer python3 on windows if I have to use it. 236 " I prefer python3 on windows if I have to use it.
219 if on_windows == 1 237 if on_windows == 1
220 let g:gundo_prefer_python3=1 238 let g:gundo_prefer_python3=1
221 endif 239 endif
255 let g:unite_source_grep_recursive_opt = '' 273 let g:unite_source_grep_recursive_opt = ''
256 endif 274 endif
257 275
258 " > Airline 276 " > Airline
259 let g:airline#extensions#whitespace#enabled = 0 277 let g:airline#extensions#whitespace#enabled = 0
260 278 " }}}
261 279
262 " >> Local stuff, finish up 280
281 " Local stuff, finish up
263 try 282 try
264 if on_windows == 1 283 if on_windows == 1
265 source ~/_vimrc.local 284 source ~/_vimrc.local
266 else 285 else
267 source ~/.vimrc.local 286 source ~/.vimrc.local

mercurial