endif
endfunction
- " Display unexpected 'fileformat' and 'fileencoding' settings.
+ " Display unexpected 'fileformat', 'fileencoding' and 'bomb' settings.
function! s:StatuslineFileFormat()
if &fileformat != 'unix'
return '[' . &fileformat . ']'
return ''
endif
endfunction
+ function! s:StatuslineFileBOMB()
+ if exists('+bomb') && &bomb
+ return '[BOM]'
+ else
+ return ''
+ endif
+ endfunction
" Return current syntax group in brackets or nothing if there's none.
function! s:StatuslineSyntaxGroup()
function! SFE()
return s:StatuslineFileEncoding()
endfunction
+ function! SFB()
+ return s:StatuslineFileBOMB()
+ endfunction
function! SSG()
return s:StatuslineSyntaxGroup()
endfunction
set statusline+=%#Error# " display warnings
set statusline+=%{SFF()} " - unexpected file format
set statusline+=%{SFE()} " - unexpected file encoding
+ set statusline+=%{SFB()} " - unexpected file byte order mask
set statusline+=%## " continue with normal colors
endif
" Don't manage the working directory (the default setting is too slow for
" me).
let g:ctrlp_working_path_mode = 0
+
" Path to cache directory. I prefer to keep generated files as local as
" possible.
let g:ctrlp_cache_dir = $HOME . '/.vim/cache/ctrlp'
" cache manually.
let g:ctrlp_clear_cache_on_exit = 0
+ " Don't switch the window if the selected buffer is already open. I want
+ " to open another view on this buffer in most cases.
+ let g:ctrlp_switch_buffer = 0
+
" FSWitch settings.
" Defaults don't work well for my projects.
augroup vimrc
" Switch to corresponding header/source file.
nnoremap <silent> <Leader>h :FSHere<CR>
+
+" netrw settings.
+ " Don't create ~/.vim/.netrwhist history file.
+ let g:netrw_dirhistmax = 0
endif
" the recommendation for git commit messages (http://tpope.net/node/106).
autocmd FileType gitcommit let g:secure_modelines_allowed_items = [] |
\ setlocal textwidth=72
+" Fix 'include' setting for shell files to recognize '.' and 'source'
+" commands. Use &l:include instead of setlocal which requires excessive
+" escaping of \.
+ autocmd FileType sh let &l:include = '^\s*\(\.\|source\)\s\+'
" Use the same comment string as for Vim files in Vimperator files.
autocmd FileType vimperator setlocal commentstring=\"%s
" Use TeX compiler for (La)TeX files.