|
@@ -24,12 +24,12 @@ set directory=~/.vim/tmp "directory to place swap files in
|
|
|
|
|
|
"Encoding settings
|
|
|
if has("multi_byte")
|
|
|
- if &termencoding == ""
|
|
|
- let &termencoding = &encoding
|
|
|
- endif
|
|
|
- set encoding=utf-8
|
|
|
- setglobal fileencoding=utf-8 bomb
|
|
|
- set fileencodings=ucs-bom,utf-8,default,latin1
|
|
|
+ if &termencoding == ""
|
|
|
+ let &termencoding = &encoding
|
|
|
+ endif
|
|
|
+ set encoding=utf-8
|
|
|
+ setglobal fileencoding=utf-8 bomb
|
|
|
+ set fileencodings=ucs-bom,utf-8,default,latin1
|
|
|
endif
|
|
|
|
|
|
"Syntax highlight
|
|
@@ -148,17 +148,17 @@ set softtabstop=4
|
|
|
set showmatch "brace/parenthese/bracket matching
|
|
|
set nowrap "wrap long lines
|
|
|
if has("multi_byte")
|
|
|
- set showbreak="…"
|
|
|
+ set showbreak="…"
|
|
|
else
|
|
|
- set showbreak="+++"
|
|
|
+ set showbreak="+++"
|
|
|
endif
|
|
|
|
|
|
"show some not printable chars
|
|
|
set list
|
|
|
if has("multi_byte")
|
|
|
- set listchars=trail:·,extends:>,precedes:<,nbsp:•,tab:→\
|
|
|
+ set listchars=trail:·,extends:>,precedes:<,nbsp:•,tab:→\
|
|
|
else
|
|
|
- set listchars=tab:>.,trail:·,extends:>,precedes:<,nbsp:%
|
|
|
+ set listchars=tab:>.,trail:·,extends:>,precedes:<,nbsp:%
|
|
|
endif
|
|
|
|
|
|
"search settings
|
|
@@ -181,10 +181,10 @@ set foldlevel=1
|
|
|
"
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
if has('autocmd')
|
|
|
- autocmd BufRead ~/.mutt/tmp/mutt-* set filetype=mail
|
|
|
- autocmd FileType mail set autoindent expandtab formatoptions=tcqn
|
|
|
- autocmd FileType mail vmap D dO[...]<CR>
|
|
|
- autocmd FileType mail call EnableSpellChecking()
|
|
|
+ autocmd BufRead ~/.mutt/tmp/mutt-* set filetype=mail
|
|
|
+ autocmd FileType mail set autoindent expandtab formatoptions=tcqn
|
|
|
+ autocmd FileType mail vmap D dO[...]<CR>
|
|
|
+ autocmd FileType mail call EnableSpellChecking()
|
|
|
endif
|
|
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
@@ -198,11 +198,11 @@ filetype plugin indent on
|
|
|
"
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
if has('autocmd')
|
|
|
- "reload Vim config file after saving
|
|
|
- autocmd BufWritePost $MYVIMRC :source $MYVIMRC
|
|
|
- "always limit the width for text files
|
|
|
- autocmd BufRead *.txt set tw=78
|
|
|
- autocmd QuickFixCmdPre * botright cwindow 5
|
|
|
+ "reload Vim config file after saving
|
|
|
+ autocmd BufWritePost $MYVIMRC :source $MYVIMRC
|
|
|
+ "always limit the width for text files
|
|
|
+ autocmd BufRead *.txt set tw=78
|
|
|
+ autocmd QuickFixCmdPre * botright cwindow 5
|
|
|
endif
|
|
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
@@ -211,21 +211,21 @@ endif
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
"set spellfile=~/.vim/spell/words
|
|
|
function! EnableSpellChecking()
|
|
|
- setlocal spell spelllang=fr,en_us
|
|
|
- let b:spell = 1
|
|
|
+ setlocal spell spelllang=fr,en_us
|
|
|
+ let b:spell = 1
|
|
|
endfunction
|
|
|
|
|
|
function! DisableSpellChecking()
|
|
|
- setlocal nospell
|
|
|
- unlet b:spell
|
|
|
+ setlocal nospell
|
|
|
+ unlet b:spell
|
|
|
endfunction
|
|
|
|
|
|
function! ToggleSpell()
|
|
|
- if !exists("b:spell")
|
|
|
- execute 'call EnableSpellChecking()'
|
|
|
- else
|
|
|
- execute 'call DisableSpellChecking()'
|
|
|
- endif
|
|
|
+ if !exists("b:spell")
|
|
|
+ execute 'call EnableSpellChecking()'
|
|
|
+ else
|
|
|
+ execute 'call DisableSpellChecking()'
|
|
|
+ endif
|
|
|
endfunction
|
|
|
|
|
|
nmap <F4> :call ToggleSpell()<CR>
|
|
@@ -237,18 +237,29 @@ imap <F4> <Esc>:call ToggleSpell()<CR>a
|
|
|
"
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
" Settings for taglist.vim
|
|
|
-let Tlist_Use_Right_Window=1
|
|
|
-let Tlist_Auto_Open=0
|
|
|
-"let Tlist_Enable_Fold_Column=0
|
|
|
-let Tlist_Compact_Format=1
|
|
|
-"let Tlist_WinWidth=28
|
|
|
-let Tlist_Exit_OnlyWindow=1
|
|
|
-let Tlist_File_Fold_Auto_Close=1
|
|
|
-let Tlist_Process_File_Always=1
|
|
|
-"dip F1 to open previous buffersplay tags only for the current buffer
|
|
|
-let Tlist_Show_One_File=1
|
|
|
-let Tlist_Use_SingleClick=1
|
|
|
-let Tlist_Ctags_Cmd="~/.vim/bin/ctags-exuberant"
|
|
|
+
|
|
|
+" Define ctags parser path
|
|
|
+let Tlist_Ctags_Cmd = "~/.vim/bin/ctags-exuberant"
|
|
|
+"Tlist pane get focus on toggle
|
|
|
+let Tlist_GainFocus_On_ToggleOpen = 1
|
|
|
+" Tlist pane is closed once something is selected
|
|
|
+"let Tlist_Close_On_Select = 1
|
|
|
+" vim exists if the Tlist window is the last remaining
|
|
|
+let Tlist_Exit_OnlyWindow = 1
|
|
|
+" highlight current position in tag list
|
|
|
+let Tlist_Auto_Highlight_Tag = 1
|
|
|
+" Update the tag list regularly
|
|
|
+let Tlist_Auto_Update = 0
|
|
|
+" remove empty lines on Tlist pane
|
|
|
+let Tlist_Compact_Format = 1
|
|
|
+" show functions/methods signatures
|
|
|
+"let Tlist_Display_Prototype = 1
|
|
|
+" show only the tags for the current buffer
|
|
|
+let Tlist_Show_One_File = 1
|
|
|
+" Tlist pane width
|
|
|
+let Tlist_WinWidth = 50
|
|
|
+
|
|
|
+" toggle Tlist with F9
|
|
|
nnoremap <silent> <F9> :Tlist<CR>
|
|
|
|
|
|
|
|
@@ -257,16 +268,48 @@ nnoremap <silent> <F9> :Tlist<CR>
|
|
|
"
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
function! CleanClose()
|
|
|
- let todelbufNr = bufnr("%")
|
|
|
- let newbufNr = bufnr("#")
|
|
|
- if ((newbufNr != -1) && (newbufNr != todelbufNr) && buflisted(newbufNr))
|
|
|
- exe "b".newbufNr
|
|
|
- else
|
|
|
- bnext
|
|
|
- endif
|
|
|
- if (bufnr("%") == todelbufNr)
|
|
|
- new
|
|
|
- endif
|
|
|
- exe "bd".todelbufNr
|
|
|
+ let todelbufNr = bufnr("%")
|
|
|
+ let newbufNr = bufnr("#")
|
|
|
+ if ((newbufNr != -1) && (newbufNr != todelbufNr) && buflisted(newbufNr))
|
|
|
+ exe "b".newbufNr
|
|
|
+ else
|
|
|
+ bnext
|
|
|
+ endif
|
|
|
+ if (bufnr("%") == todelbufNr)
|
|
|
+ new
|
|
|
+ endif
|
|
|
+ exe "bd".todelbufNr
|
|
|
endfunction
|
|
|
|
|
|
+
|
|
|
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
+" Load pathogen
|
|
|
+"
|
|
|
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
+
|
|
|
+if filereadable($HOME . "/.vim/bundle/pathogen/autoload/pathogen.vim")
|
|
|
+ source ~/.vim/bundle/pathogen/autoload/pathogen.vim
|
|
|
+ call pathogen#infect()
|
|
|
+endif
|
|
|
+
|
|
|
+
|
|
|
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
+" Gundo Setup
|
|
|
+"
|
|
|
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
+
|
|
|
+" Gundo sidebar on the right
|
|
|
+let g:gundo_right = 1
|
|
|
+" Gundo layout
|
|
|
+let g:gundo_width = 60
|
|
|
+let g:gundo_preview_height = 40
|
|
|
+" Gundo status lines
|
|
|
+let g:gundo_tree_statusline = "Gundo"
|
|
|
+let g:gundo_preview_statusline = "Gundo Preview"
|
|
|
+" Preview pane below the buffer
|
|
|
+let g:gundo_preview_bottom = 1
|
|
|
+" Close Gundo panes on revert
|
|
|
+let g:gundo_close_on_revert = 1
|
|
|
+
|
|
|
+" F3 key to show/hide Gundo sidebar
|
|
|
+nnoremap <F3> :GundoToggle<CR>
|