Adding vim fragments

I found this resource for ruby / rails snippets , it looks like it has a lot of interesting snippets that I could use with vim.

But since I'm new to vim, I don't know how to include these snippets in my vim editor. There is no instruction in this.

can someone help me on how to get this kind of snippets available for vim editor

early

+6
source share
2 answers

These snippets are for snipMate - TextMate style snippets for the Vim plugin . First you need to install it.

Please note that although this plugin is no longer supported, it still works fine (and will probably continue to do so thanks to the large Vim backward compatibility record) and is still used by many people (including me). There is an updated fork: garbas / vim-snipmate . The newer, more powerful plugin, UltiSnips, is the ultimate Vim-enabled python skinning solution that can convert older snipMate snippets into its format. So there are many choices.

+9
source

About the Snippet plugin in Vim

I recommend the Neosnippets plugin: https://github.com/Shougo/neosnippet This is the best in my opinion.

Step 1: Install the plugin. Recommend using Pathogen for installation

Step 2: Download / clone a piece of the fragment that you like on the local computer, or create your own (recommended)

Step 3: Set the elevation path as a folder with Neosnippets fragments in vimrc

let g:neosnippet#snippets_directory='~/path/to/above/snippets/' 

Step 4. Customize more if you want, according to the help file.

For repo you mentioned

I checked it out.

One problem is obsolescence, a lot of Rails code a few years ago. Now they are little used.

Another problem is that the format is not compatible with NeoSnippet. You can check :help neosnippet-snippet-syntax how to write snippets for NeoSnippets. It is simple, easy to use.

+7
source

All Articles