diff --git a/vim/plugin/myFunx.vim b/vim/plugin/myFunx.vim new file mode 100644 index 0000000..fe0b839 --- /dev/null +++ b/vim/plugin/myFunx.vim @@ -0,0 +1,11 @@ +" 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 ml :call AppendModeline() + +" vim: set ts=4 sw=4 tw=78 ft=vim : diff --git a/vim/plugin/skeleton.vim b/vim/plugin/skeleton.vim index 85a1a32..0bc4648 100644 --- a/vim/plugin/skeleton.vim +++ b/vim/plugin/skeleton.vim @@ -38,6 +38,7 @@ augroup newfiles if has("gui_running") autocmd BufWritePost ~/.gvimrc so ~/.gvimrc endif + autocmd BufRead,BufNewFile *.mako set ft=mako " Set up python support augroup END