Filephp.snippets
There are more and more snippet...endsnippet blocks;
It becomes more and more difficult to manage, especially when some code blocks are very large;
Observed Download honza/vim-snippets
, and find that there is also one language and one file;
Is there any method or folk remedy to manage it?
See the documentation
See the documentation
See the documentation
https://github.com/SirVer/ultisnips/blob...
For example, if you have a bunch of ruby snippets, you can split these snippets into separate files. Then they can be managed through directories
ruby/*[.snippets]
, 也可以直接用文件管理ruby_*.snippets
Actually, how do you manage code?
Solution: folding (based on the following assumptions)
According to my guess, it is assumed that your inconvenient management refers to the more snippets blocks, the longer the file, and it is not easy to browse
.vimrc settings are as follows
Command (in normal mode):
Comparison before and after folds are closed (via the above command)
Operation: First close all snippets blocks through the zM command (the file becomes very small, each snippets only displays one line), then browse easily to find the snippets you need (move the cursor there), and then use zR Or zi opens all snippets. At this time, you can view the content of this snippet;
Bonus: After you follow the above operations, the cursor should be at the bottom. Use the command zz to move the content to the middle of the screen for easy viewing.
At last, a simple .vimrc is attached for reference (Plugin is managed by Vundle):