Added myFuynx.vim for local functions

Added AppendModeLine function
This commit is contained in:
Andrea Mistrali 2009-10-21 07:25:31 +00:00
parent 731b236ba4
commit 1484a69fb9
2 changed files with 12 additions and 0 deletions

11
vim/plugin/myFunx.vim Normal file
View File

@ -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 <silent> <Leader>ml :call AppendModeline()<CR>
" vim: set ts=4 sw=4 tw=78 ft=vim :

View File

@ -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