diff --git a/.vimrc b/.vimrc index b776603..051bbd7 100644 --- a/.vimrc +++ b/.vimrc @@ -156,6 +156,18 @@ endfunction inoremap =Smart_TabComplete() +" Append modeline after last line in buffer. +" Use substitute() instead of printf() to handle '%%s' modeline in LaTeX +" files. +function! AppendModeline() + let l:modeline = printf(" vim: set ts=%d sw=%d tw=%d :", + \ &tabstop, &shiftwidth, &textwidth) + let l:modeline = substitute(&commentstring, "%s", l:modeline, "") + call append(line("$"), l:modeline) +endfunction +nnoremap ml :call AppendModeline() + + "switch spellcheck languages let g:myLang = 0 let g:myLangList = [ "nospell", "fr_fr", "en_gb" ]