set cryptmethod=blowfish
endif
-" Create new split windows on the right (and not left).
-set splitright
-
" Clear all vimrc-related autocmds. Has to be done here as the vimrc augroup
" is used multiple times. Necessary to support reloading the vimrc.
if has('autocmd')
" (add ! to override)" warning when switching buffers.
set hidden
+" When splitting vertically put the new window right of the current one.
+if has('vertsplit')
+ set splitright
+endif
+
" DISPLAY SETTINGS
set statusline=
" on the left
- set statusline+=%02n " buffer number
- set statusline+=%{SBC()} " highest buffer number
+ set statusline+=%02n " buffer number
+ set statusline+=%{SBC()} " highest buffer number
set statusline+=:
if has('modify_fname') && v:version >= 700 " some functions need 7.0
- set statusline+=%{SRF()} " path to current file
- set statusline+=\ " space after path
+ set statusline+=%{SRF()} " path to current file
+ set statusline+=\ " space after path
else
- set statusline+=%f\ " path to current file in buffer
+ set statusline+=%f\ " path to current file in buffer
endif
- set statusline+=%h " [help] if buffer is help file
- set statusline+=%w " [Preview] if buffer is preview buffer
- set statusline+=%m " [+] if buffer was modified,
- " [-] if 'modifiable' is off
- set statusline+=%r " [RO] if buffer is read only
+ set statusline+=%h " [help] if buffer is help file
+ set statusline+=%w " [Preview] if buffer is preview buffer
+ set statusline+=%m " [+] if buffer was modified,
+ " [-] if 'modifiable' is off
+ set statusline+=%r " [RO] if buffer is read only
" on the right
set statusline+=%= " right align
" and all nerds involved (godlygeek, strull in #vim on Freenode).
if has('eval')
function! s:VSetSearch()
- let l:temp = @@
+ let l:temp = @@ " unnamed register
normal! gvy
" Added \C to force 'noignorecase' while searching the current visual
" selection. I want to search for the exact string in this case.
autocmd InsertLeave * set nopaste
endif
-" Write file when running :mak[e] before 'makeprg' is called. QuickFixCmdPre
-" doesn't exist in older Vims.
+" Write all files when running :mak[e] before 'makeprg' is called.
+" QuickFixCmdPre doesn't exist in older Vims.
if exists('##QuickFixCmdPre')
- autocmd QuickFixCmdPre * write
+ autocmd QuickFixCmdPre * wall
endif
" Don't ignore case while in insert mode, but ignore case in all other modes.
return
endif
- echohl WarningMsg
- echo 'Do not edit this file! (Maybe a template file.)'
- echohl None
+ echoerr 'Do not edit this file! (Maybe a template file.)'
endfunction
autocmd BufRead * call <SID>SearchForDoNotEditHeader()