Loading ...
Sorry, an error occurred while loading the content.

Re: vimscript inserting a blankline / newline

Expand Messages
  • Charles E Campbell Jr
    ... or you could use put = Regards, Chip Campbell --~--~---------~--~----~------------~-------~--~----~ You received this message from the vim_use
    Message 1 of 3 , Feb 14, 2008
    • 0 Attachment
      Gary Johnson wrote:

      >On 2008-02-13, Sadarax <sadarax@...> wrote:
      >
      >
      >>I am writing a function within my .vimrc to do some automatic function
      >>documentation. I am currently using the call append('.', something) function,
      >>but I need to insert a blank line sometimes. How do I do this?
      >>
      >>Here is what I have written so far:
      >>
      >>nmap <silent> <F5> :call DocumentFunctionComments() <CR>
      >>function! DocumentFunctionComments()
      >> if expand("%:e") =~ "^cpp$" || expand("%:e") =~ "^cc$" || expand("%:e") =~ "^
      >>c$" || expand("%:e") =~ "^h$" || expand("%:e") =~ "^hpp$"
      >> let s:line = getline('.')
      >> exec "normal 0k"
      >> call append('.', '/*')
      >> exec "normal 0j"
      >> call append('.', "\t" . s:line)
      >> " how to insert blankline/newline ?
      >> exec "normal 0j"
      >> call append('.', '*/')
      >> endif
      >>endfunction
      >>
      >>
      >
      > call append('.', '')
      >
      >
      or you could use

      put =''

      Regards,
      Chip Campbell


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.