Use vim under UltiSnips

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/

  1. C ++ to some common, already built snips

    1. inc: #include <xxx.h>, which is introduced c library
    2. incc:#include The introduction of C ++ libraries
    3. main: the main function
  2. Custom snips

    In the ~/.vim/UltiSnipsfolder New xx.snippets, xx that you want to apply these snips file format, if LaTexthe file that tex.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 deployed
  • A It stands for Auto Expand
  • wRepresentatives 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.
  • iRepresentatives around bytes can be ignored, expand keyword directly. (This ratio is set wto be looser)

Others include r, s, t, mand 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

Guess you like

Origin www.cnblogs.com/jiading/p/11666319.html