X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=vimrc;h=306e838615498c0975fefa448bdb7b7e524dea24;hb=c7773137ac274d58e7bd68d7c6bb67e6b7f272bf;hp=5bc0894bb96d27f5a174276aa8c84b13c7b57ec1;hpb=35f1d8f86e839023a837fe978cd219fba168ff95;p=config%2Fdotfiles.git diff --git a/vimrc b/vimrc index 5bc0894..306e838 100644 --- a/vimrc +++ b/vimrc @@ -105,9 +105,6 @@ if exists('+cryptmethod') 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') @@ -236,6 +233,11 @@ endif " (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 @@ -385,6 +387,23 @@ if has('statusline') endif endfunction + " Display unexpected 'fileformat' and 'fileencoding' settings. + function! s:StatuslineFileFormat() + if &fileformat != 'unix' + return '[' . &fileformat . ']' + else + return '' + endif + endfunction + function! s:StatuslineFileEncoding() + if &fileencoding != '' && &fileencoding != 'utf-8' + \ && &filetype != 'help' + return '[' . &fileencoding . ']' + else + return '' + endif + endfunction + " Return current syntax group in brackets or nothing if there's none. function! s:StatuslineSyntaxGroup() let l:group = synIDattr(synID(line('.'), col('.'), 1), 'name') @@ -402,6 +421,12 @@ if has('statusline') function! SRF() return StatuslineRelativeFilename() endfunction + function! SFF() + return StatuslineFileFormat() + endfunction + function! SFE() + return StatuslineFileEncoding() + endfunction function! SSG() return StatuslineSyntaxGroup() endfunction @@ -422,6 +447,10 @@ if has('statusline') set statusline+=%m " [+] if buffer was modified, " [-] if 'modifiable' is off set statusline+=%r " [RO] if buffer is read only + set statusline+=%#Error# " display warnings + set statusline+=%{SFF()} " - unexpected file format + set statusline+=%{SFE()} " - unexpected file encoding + set statusline+=%## " continue with normal colors " on the right set statusline+=%= " right align @@ -582,7 +611,7 @@ nnoremap ; :call setline(line('.'), getline('.') . ';') " 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.