leader shortcut to append modeline after last line in buffer

This commit is contained in:
nojhan 2012-07-29 22:45:03 +02:00
commit 73226d9191

12
.vimrc
View file

@ -156,6 +156,18 @@ endfunction
inoremap <tab> <c-r>=Smart_TabComplete()<CR>
" 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 <silent> <Leader>ml :call AppendModeline()<CR>
"switch spellcheck languages
let g:myLang = 0
let g:myLangList = [ "nospell", "fr_fr", "en_gb" ]