Use slippery snippet (textmate-like) on VIM)

Source: Internet
Author: User

After adding this plug-in to VIM, write c ++ Java and so on.ProgramYou can automatically add some fixed-format structures, just like Eclipse. For example, you can enter for <tab> to see the complete

For (<{I }>=<{}>;< {I }><{count };< {I }>+=<{}>)
{
<{}>
}
<{}>

Press the tab key one by one to locate and write at each position.

It seems that there is a problem with a file in the branch pulled from SVN. Just modify it.

--- After/ftplugin/c_snippets.vim (Revised 152)
++ After/ftplugin/c_snippets.vim (working copy)
@-44,7 + 44,7 @@
-Exec "snippet main int main (INT argc, char const * argv []) <CR >{< Cr> ". st. ET. "<CR> return 0; <CR} <CR> ". st. ET. ""
+ EXEC "snippet main int main (INT argc, char const * argv []) <CR >{< Cr>". St. Et. "<CR> return 0; <CR>} <CR> ". St. Et .""

 

========================================================== ==========================================================

 

Friends who have obtained step-by-step can also use Script Security, which is faster than running.

First, create a. Vim object under your home.

$ Mkdir. Vim
$ Cd. Vim

First, if you do not have SVN installed, you can use apt to install subversion under Ubuntu.

$ Apt-Get install Subversion

Use SVN to capture the latest Vim script.

$ SVN Co http://snippetsemu.googlecode.com/svn/branches/textmateOnly/

This should be the final structure of the project after completion.

~ /. Vim/textmateonly

Next, we recommend that. vimrc restart

$ Vim ~ /. Vimrc

New:

Filetype on
Filetype plugin on
Set runtimepath + =
~ /. Vim/textmateonly
Set runtimepath + =
~ /. Vim/textmateonly/after

Storage and finished.

Test

When loading a test. cpp example, you can view the snippet effect by entering for <tab>. You can press tab to jump to the next placehoder.

Support

To ~ /. Vim/textmateonly/after tree to see which scheme cases are currently supported

Actionscript_snippets.vim
Asp_snippets.vim
C_snippets.vim
Css_snippets.vim
Django_model_snippets.vim
Django_template_snippets.vim
F-script_snippets.vim
Haskell_snippets.vim
Html_snippets.vim
Javascript_snippets.vim
Java_snippets.vim
Latex_snippets.vim
Logo_snippets.vim
Markdown_snippets.vim
Movable type_snippets.vim
Objc_snippets.vim
Ocaml_snippets.vim
Perl_snippets.vim
Phpdoc_snippets.vim
Php_snippets.vim
Propel_snippets.vim
Python_snippets.vim
Rails_snippets.vim
Ruby_snippets.vim
Sh_snippets.vim
Slate_snippets.vim
Smarty_snippets.vim
Symfony_snippets.vim
Tcl_snippets.vim
Template_toolkit_snippets.vim
Tex_snippets.vim
Xhtml_snippets.vim

There are too many! PHP, C ++, C, Ruby, Perl, and python! The opening case shows what snippet exists.
Enjoy!

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.