mirror of https://github.com/akelge/zsh
12 lines
470 B
VimL
12 lines
470 B
VimL
" Append modeline after last line in buffer.
|
|
" Use substitute() (not printf()) to handle '%%s' modeline in LaTeX files.
|
|
function! AppendModeline()
|
|
let save_cursor = getpos('.')
|
|
let append = ' vim: set ts='.&tabstop.' sw='.&shiftwidth.' tw='.&textwidth.' ft='.&filetype.' : '
|
|
$put =substitute(&commentstring, '%s', append, '')
|
|
call setpos('.', save_cursor)
|
|
endfunction
|
|
nnoremap <silent> <Leader>ml :call AppendModeline()<CR>
|
|
|
|
" vim: set ts=4 sw=4 tw=78 ft=vim :
|