Use vim under UltiSnips
A recent study Linux programming, corresponding also learn vim. UltiSnips plug-in can be achieved vim complement a more powerful effect than the general code. Here on the record about it.
UltiSnips installation, basic and advanced: https://vimzijun.net/2016/10/30/ultisnip/
C ++ to some common, already built snips
- inc: #include <xxx.h>, which is introduced c library
- incc:#include
The introduction of C ++ libraries - main: the main function
Custom snips
In the
~/.vim/UltiSnips
folder New xx.snippets, xx that you want to apply these snips file format, ifLaTex
the file thattex.snippets
, so if you want to apply to all formats write all.snippets.Snip defined in these files formats:
snippet 关键词 “说明” 设定 内容 endsnippet
Set as follows:
b
Only when the representative keyword appears at first before they can be deployedA
It stands for Auto Expandw
Representatives can expand this "word", the specific definition of "word" can be viewed:help iskeyword
. Intuitive feeling is that this is a separate keywords, and other text separated. For example, before and after all spaces.i
Representatives around bytes can be ignored, expand keyword directly. (This ratio is setw
to be looser)
Others include r
, s
, t
, m
and so on, can be found in the documentation that comes with this command:
:help ultisnip
After Just enter keywords in vim, and then press the tab will automatically filled.
See more advanced content above Gangster blog