Thursday, December 15, 2016

How to fold or hide the comment in vimrc file?

I want to fold or hide the comment in the vimrc file.
I Google it and find mainly the 2 solution below but none of them worked.


syn match comment "\v(^\s*\".*\n)+" fold

set foldmethod=expr foldexpr=getline(v:lnum)=~'^\s*"'


My Vimrc file is like this, when I enter the 2 commands above nothing happens.

```
if g:atCompany
" set tags+=D:/Ruchee/Files/code/self/ci/tags
" set tags+=D:/Ruchee/Files/code/self/laravel/tags
" set tags+=D:/Ruchee/Files/code/self/sf/tags
else
```

So how to hide the comments?

-----------
Another question plz, how to edit the code format in this edit box? It's terriable that I can't post code here.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment