Thursday, October 28, 2010

5 most important reasons why a Unix developer should use VIM

  VIM is a text editor, an extension of vi.   VIM is called so because it has lot of Vi Improved features, and hence the name. We saw how to install VIM in one our earlier articles: VIM Installation. Let us see the 5 most compelling reasons why a UNIX developer should use VIM:

1.  File already open alert: Every Unix programmer will have at least one bad experience of overwriting a file which is being opened in  more than one terminal. This CANNOT happen in vim. If a file is opened in an terminal, when the same file is already opened in a different terminal, a warning message appears. This is very helpful feature for the programmers.

2.  Commented Code: A developer analyses lot of codes in a function only to realize at the end what he had been analyzing all the day is commented code.  When the commented code span a few lines, it can be easily made out in vi, however if it runs for pages, it is very tough for a developer to find out. Vim's color feature provides us with many options in which we can set color for the normal code, commented code, keywords and so on. As a result, all the comments get displayed in a specific color and hence no pain analyzing the commented code.

3. Diff between files: The diff done by the diff command is not easy to analyze when the file has lot of changes. Vim has a folding feature and split tab feature due to which it opens the two files in split screen and shows exactly the differences alone.

4. Visual Mode: The big catch of the Vim is the visual mode. Visual mode has lots of features some of which are not possible with vi. Visual mode brings a lot of windows like features. Say in MS Office, if you want to delete 10 lines, you will highlight those 10 lines using mouse, and press delete. Vim allows you to do the same in UNIX.

5. Finish quotes or brackets: Programmers write printf statement in a hurry only to miss the finishing double quote. Or write an if condition having a bracket less. These hardly get noticed when you use vi. However, because of the coloring feature in vim, the moment the ending double quote is missing in printf, all the remaining code will appear like hard-coded string making it clear immediately. The same is the case with missing brackets in case of which the next bracket will be shown in a different color indicating something wrong.

   VIM has many other powerful features. We will see in our future articles a lot about these vim features and the vim commands and shortcuts.

Related Posts Plugin for WordPress, Blogger...

No comments:

Post a Comment