Archive for the 'Windows' Category

23
Jul
10

vim/NERDTree/snippetsEmu in Windows

Text editors have been remarkably recognized for their intuitive support for the coders “developers”. There are two worth-mentioning features in vim in which you can, explore the filesystem and open files directly from a tree-view explorer. Also, the flexibility to assign a generic tab-triggers “Snippets” –provided originally by TextMate.

So, in this article, we will use both, NERTree and snippetsEmu plugins in vim.

NERDTree

  • Download NERDTree from vim website
  • Place NERD_tree.vim in “~/.vim/plugin”. In Windows, the exact path is “C:\Program Files\Vim\vimfiles\plugin”.
  • Restart vim and run :NERDTree in vim’s command mode “case-sensitive”. voila!

Now, we need to build the helptags in order to be able to read the help files from the command “:help NERDTree”.

  • Copy NERD_Tree.txt to “C:\Program Files\Vim\vimfiles\doc”. This path might differ from yours according to the installation directory. I am assuming the default installation folder in this context.
  • Run the command :helptag c:\program\ files\vim\vimfiles\doc\ Keep in mind the tab-auto-completion is tightly integrated here.
  • From vim’s command mode :help NERDTree

snippetsEmu

To cut this to the chase, download the complete bundle from vim website. The installation of the vimball can be done as the following:

  • Copy snippy_bundles.vba to “C:\Program Files\Vim\vimfiles\after\ftplugin”. Most probably, you will have to create the folder “after” and subfolder “ftplugin” manually. Remember, vba stands for VimBall-Archive and not ** for Application.
  • Open the bundle file using vim
  • In vim’s command mode, run the command :so % In more simple terms, :so opens the source file (:source) % means the current file.
  • Restart vim
  • In the command mode, run :Snippet or :help Snippet — Again, it’s case-sensitive

To do some test with it, create a new python file “.py” and type for as a keyword. You should get something like the below.

Now, you have both, NERDTree and snippetsEmu running in your vim. Enjoy hacking!




Follow

Get every new post delivered to your Inbox.