function! AppendModeline()
let save_cursor = getpos('.')
let append = ' vim: set et ts='.&tabstop.' sw='.&shiftwidth.'
tw='.&textwidth.': '
$put =substitute(&commentstring, '%s', append, '')
call setpos('.', save_cursor)
endfunction
nnoremap <silent><Leader>ml :call AppendModeline()<CR>
I picked that up from the Vim wikia tips page. I like it but I would
like it to add a blank line before it places the text.
The current version:
01: use strict;
02: # vim: et ts=# sw=# tw=#
I would like:
01: use strict;
02:
03: # vim: et ts=# sw=# tw=#
I have tried a couple things but my function writing is
woefully...er...bad. On that note I was thinking of getting the new
vi/vim book. Or I can read the appropriate vim help file if I can be
given those. If that works I can send the price of the book to the Vim
charity that Bram has.
Thanks for any and all help and suggestions.
Robert
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---