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

86275Re: Simple hiding all comments by folding

Expand Messages
  • Charles E. Campbell, Jr.
    Jan 6, 2008
    • 0 Attachment
      arctgx wrote:

      > I wouldn't like to insert into file any strings ({{{, 'token' etc.)
      >that are deserve only to define fold range, especially as I open some
      >files only for reading.
      >
      >Vince Negri's patch doesn't exists for 7.1 vim version. I tried to
      >patch 7.1 but patching exited with fails. Charles, does your commands
      >work only with this patch (E492: Not an editor command:
      >cmmnt_toggle=1<bar>hi link shComment Ign)?
      >
      >
      >
      I did say that the mapping was untested! Which means some debugging may
      be involved. OK, I've gone and done it:

      map <silent> <f1> :if !exists("g:cmmnt_toggle")<bar><bar>g:cmmnt_toggle
      == 0<cr>:let g:cmmnt_toggle= 1<cr>hi link shComment
      Ignore<cr>else<bar>let g:cmmnt_toggle= 0<bar>hi link shComment
      Comment<cr>endif<cr>

      (all one line) This mapping toggles shComment between linking to
      Comment and Ignore highlighting. It doesn't fold the lines; instead, it
      "Ignore"s them. Of course, if your colorscheme is obnoxious and makes
      Ignore visible, it won't help, but I don't think that's common.

      Regards,
      Chip Campbell



      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Show all 17 messages in this topic