Vim-snippets ultisnips

Source: Internet
Author: User

Among the well-known plug-ins of VIM code snippet completion are vim-snipmate and ultsnips. In my environment, snipmate cannot be used because of conflicts, so ultisnips is used. They all use the same vim-snippets as the configuration file and store it in the corresponding directory. Their formats are basically the same, but there are also some differences. I personally feel that ultisnips provides more extensions.

Ultisnipsedit: Quickly open and edit the configuration file named <current file extension>. snippets

Basic Format:

Snippet <Tigger> "annotation" <flag> $ {1: Name }$ {1/(\ W +). */$ {1}/} endsnippet

You can directly use shell scripts or!vEmbed vimscript or!pEmbed Python

snippet date "date"`echo $(date)`end snippet

Passglobal !pDirectly embed Python scripts

global !pendglobal

Python Variables

FN: file name path: path T: placeholder T [1] snip: Provision Method

Example:

snippet def "def" def ${1:name}:    ${2:`!p `}endsnippet
snippet "rep (\d+) (\w+)" "def" rdef ${1:name}:    ${2:`!p snip.rv=int(match.group(1))*match.group(2)`}endsnippet

extends cReference other configurations

?
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.