VIM

February 4, 2012 / Mad Coding, Vim, Well.ca

One of the things I kick started at Well.ca is the weekly tech talks. I started the tech talks off by showing a security hole in the software and brought attention to the team the Threat Modelling practices at Microsoft. I encouraged the team to think about what cool things they know and start sharing knowledge within the team. Late last year I was asked by a team mate to give a demo on VIM since I’m one of the few VIM users within the team. I’m sharing my presentation and reasons on this blog now as well.

Pros:

Cons:

Demo

After telling the team at Well.ca about the pros and cons of using VIM, I dive right into showing demos of using VIM to do various things. I showed some of what VIM could do natively and I also showed some plugins that really make working with the code or files a lot easier. You can find many useful plugins from the Janus project as well.

I showed various plugins for working with files such as Lusty-Explorer, NERDTree, using ctags, and with Command-T. I showed how to use vim-fugitive plugin to do git grep and open files from the search result. I demonstrated autocomplete, jump to definition and performing a diff within a file.

I also showed the awesome NrrwRgn plugin for doing things within a section of a file without impacting rest of the file. I also showed how you can manipulate text and sort things all within VIM.

Command-T

One of the plugins that I love is the CommandT plugin. It allows you to type a keyboard shortcut and then just start typing file names that you’d like to open. It’s a really fast way to navigate through projects. However, one of the projects at Well.ca has tons of files that really slows down CommandT’s initial start time due to CommandT needing to index the files in the directory when VIM first starts. I forked the CommandT project on github and implemented a caching mechanism so that for big projects you only have to index it once and VIM will use the cached index upon initial load. If you want to refresh the cached index then all you need to do is a :CommandTFlush and then bring up CommandT again to re-index and cache.

VIM is great and I keep learning new things about it that makes me even faster at manipulating text and coding. When I was at Microsoft I sometimes felt handicapped when helping out a team mate who doesn’t use VIM. For example, VIM has built-in ability to show HEX value of a file, so when I needed to analyze C++ object files or when debugging I felt handicapped at a team mate’s computer that doesn’t have VIM already.