Open Source Software Technical Articles

Want the Best of the Wazi Blogs Delivered Directly to your Inbox?

Subscribe to Wazi by Email

Your email:

Connect with Us!

Current Articles | RSS Feed RSS Feed

Nine all-purpose plugins for Vim

  
  
  

In its 22 years of existence, the Vim editor has become the center of an ecosystem of plugins. Whether you are coding or writing a text document, you can probably find a plugin that will make you more productive.

If you're coding in a specific programming language, you can find multiple plugins that will customize Vim to transform it into a dedicated editor for your language, but you don't have to be so specialized to benefit from many Vim plugins. Consider the following.

Pathogen

The more plugins you use in Vim, the harder it is to keep them updated or delete them. A number of plugin managers for Vim can help. The oldest and most popular, Pathogen, simplifies plugin management by requiring that each plugin have its own subdirectory. It is popular among those who prefer to manage plugins for themselves, but appreciate having a tool that simplifies the process.

Vundle ("Vim bUndle") uses the same directory structure as Pathogen, but takes the additional step of requiring modifications to the .vimrc directory in order to allow automatic updates and provide the ability to turn off a plugin without actually deleting it.

NERDTree

Switching from Vim to a file manager can break your concentration, especially if you are working in a maximized terminal. NERDTree solves the problem by adding a directory tree in a separate pane inside Vim. The tree highlights files, directories, symbolic links, read-only files, and binaries in different colors for easy identification. You can also bookmark files so that you can jump directly to them.

When you start NERDTree with the command :NERDTree, it shows the current directory. If you prefer, you can specify a directory or a bookmarked file as the starting point instead by adding its path to the end of the commandYou can also use the command :NERDTreeFind [String]. to search for a specific file and jump to it.

If you like the idea of having a file manager within Vim but don't love NERDTree, you have other options. Easytree, for instance, has fewer features, while Vimpanel and wimanager have more.

YankRing

"Yank" is Vim's term for copying or cutting and pasting. A yankring is a retrievable history of yanks, similar to the one provided by Klipper on the KDE desktop.

By default, Vim stores the last nine yanks. However, with the YankRing plugin, you can reconfigure Vim to store more or fewer. Even more importantly, YankRing allows you to copy or cut in a separate pane or with a series of commands that give you the choice of yanking everything from the current word or line to a range of lines. If you store the ring in a file, you can use it with multiple instances of Vim, which may be especially handy on a network.

Surround

Surround is useful with many programming languages because it deals with delimiters – characters that appear in pairs to define a string, such as quotation marks, brackets, parentheses, and complete tags in markup languages like HTML and XML. Surround adds, deletes, and replaces delimiters via a series of keyboard commands.

If you want to compare Surround with similar alternatives, closetag and ragtag offer something of the same functionality, specifically for markup languages.

Showmarks

Marks are bookmarks within a Vim document. You can set a mark by pressing m followed by another letter that designates the mark. To jump to a mark, enter ' followed by the mark's letter.

The great weakness of marks is that they are invisible. This limits the number you can use to however many you can remember, and you can easily accidentally overwrite an existing mark by creating another with the same name.

Showmarks allows you to toggle the visibility of marks off and on – and that tiny functionality is enough to increase the usefulness of marks several times over.

NERD-commenter

NERD-commenter is a general-purpose plugin designed for writing code or using markup languages. Even if you are not writing code or markup, comments are still helpful when you're collaborating with others on a document. You may also find comments more convenient than storing thoughts in a separate buffer, as the Notes plugin does.

NERD-commenter installs with a series of keyboard shortcuts for adding and removing comments based on various selections of words or lines or of cursor position. It supports nested comments, the use of alternate delimiters to mark comments, and selecting the positioning of delimiters.

Vim-abolish

Vim-abolish is so elegant that you wonder why no one thought of it before, but it's hard to describe. It has aspects of a word processor's spell checker or autocorrect, but might best be described as a configurable search and replace tool. What makes Vim-abolish so powerful is that it allows you not only to search and replace one word or spelling for another, but also to include all instances of a word. Upper case, lower case, noun and adverb, past and present tense, participles – all can be added to the search and replaced with a few dozen characters.

Admittedly, you might take a while to learn how to think in the terms necessary to set up a Vim-abolish command, and learning how to construct a command may take some time too. However, once you understand how Vim-abolish works, you will probably find it an invaluable proofreading tool.

VimOutliner

VimOutliner is exactly what its name suggests: a way to create hierarchial outlines. It is so popular that most major distributions package it, but you must add two lines to your .vimrc file before you can use it:

filetype plugin indent on
syntax on

Once you have VimOutliner up and running, creating a new level is as simple as starting a new line with an additional indent and adding a heading. Start a line below a heading with a colon (:), and text will be wrapped automatically and formatted when you export the current document to another format; start a line with a semicolon (;) and you can insert a line break. You can also collapse or open outline levels as useful, with everything color-coded for convenience.

You can save a VimOutiner document to a file with an .otl extension. However, VimOutliner also includes a series of Python scripts to save to awk, PDF, DocBook, HTML, and LibreOffice Impress formats – the latter presumably chosen because its Outline view is the best outline tool available in the office suite.

Gundo

Vim supports powerful undo functionality that tracks not only changes, but branches of changes. However, good luck finding a particular change with vanilla Vim so you can revert to it. If you don't want to simply revert one step at a time until you find what you are looking for, you can try to jump according to your best guess as to the time the change was made. Of course, if you guess wrong, or fail to keep track of what branch you are on, you are more likely to be confused than successful.

Gundo eliminates this confusion with a text-based representation of the undo tree and a few simple tools for navigation. At all times, you know exactly where in the undo tree you are, and that allows the undo functions to really come into their own.

Learning curves and alternatives

Add a few of these plugins, and functionally Vim soon begins to rival a word processor. However, no matter how many plugins you add, Vim is never going to match the convenience of an office suite, even if you use GUI-Vim. Some of these plugins include a lengthy list of keyboard commands that take practice and repeated use to master. However, the control and power they offer makes the effort worthwhile, especially if you work regularly without a display manager.




This work is licensed under a Creative Commons Attribution 3.0 Unported License
Creative Commons License.

Comments

Another good vim plugin manager is Vimana: 
 
http://www.lowlevelmanager.com/2010/12/more-perl-vim-goodness.html
Posted @ Friday, March 22, 2013 11:16 AM by stampeder
Good write-up. Two points: 
 
#1. The way to manage vims undo structure is built in and magically awesome. :earlier and :later works with "events" (standard undo), works with time ":earlier 5m" to go back 5 minutues or even ":earlier 3f" (go back 3 filesaves). I find that I generally know about when I want to go back to, and :earlier is awesome at that. 
 
#2. I feel CtrlP was sorely missing from this roundup, it is an amazing way to manage tags, buffers and files in vim, and is nice and generic.
Posted @ Saturday, March 23, 2013 4:51 AM by Robert Melton
This modern-day women can certainly imagine out-of-the-box on the subject of the chanel 2.55 bags. The modern movements with marriage vogue provide women having several choices with colorings between environment friendly, mint, magenta, lime, peach, in addition to many this eye-catching colorings on the rainbow. This diamonds light, simply light, regular light, ravenscroft light, a bottle of champagne, sterling silver, ivory, along with the overall choice of replica chanel of which many this women are likely to buy is usually substituted that fake chanel. This holiday season, this bunch of bridal gowns is utterly fresh with regard to necklines having laces. Necklines having tulle in addition to guipure shoelace, popular think shoelace, sequined shoelace, to a great extent beaded shoelace, for example. usually are a lot of the illusions which might be viewed in this stunning wedding dress variety. A different appreciative fake chanel which might be welcomed in this Wedding planning Gowns is usually the detailed embellishment. This clever by using gems, appliqué, adornments, beading, shoelace and likewise embellishments helps make this wedding planning gowns all the more fake rolex watches. Women this holiday season include undoubtedly lots from which to choose it will always be the most beneficial. Accessorizing is usually within an important factors for just a replica chanel tote. In truth, it truly is a different technique which the women can certainly opt for to manufacture a trendy record on their marriage prada outlet. This holiday season, this women may easily buy vibrant in addition to tasteful bracelets, happens to be in addition to neckpieces on their special day. This an abundance of ornaments that they may decide on include things like replica chanel coco ring set having Swarovski Deposits in addition to Pearls, Cubic Zirconia Ring having Globule Sheds, Ravenscroft Globule Lower Bracelets, Swarovski Ravenscroft Lower Bracelets, Multi-Strand Lower Bracelets, Swarovski Happens to be in addition to Globule chanel replica. In conjunction with most of these ornaments, this women may decide on this wonderful headpieces acquiring delicate beadwork in addition to custom made fake omega watches to feature simply just a wonderful number of glint on their d-day. 
Posted @ Tuesday, May 13, 2014 3:40 AM by rolex day date watches
Thank you for sharing this article. fake Cartier Necklaces It is really useful for me.
Posted @ Wednesday, May 28, 2014 3:38 AM by anyous
If you do not have to keep a lot of Dior Replicareplica louis vuitton handbags items, but only a few things like your makeup, mobile phones, etc., will be more Prada replica like women coloriffics about HB210 model than you, which is in four different colors, black, ivory, latte and silver satin. So you can choose one to match with your hermes replica clothes.  
 
Posted @ Wednesday, July 30, 2014 4:21 AM by Jonny
The above three sheepskin handbags, LV monogram vernis can be said to be the locomotive bag lady, boxy shopping bag modelling, practical and easy, bag cover with a different color, add fashion sense. Luxuriant snakeskin handbag, whether color or gray, appear bright, noble compelling, abnormal contracted design, highlight the snakeskin characteristic of natural decorative pattern. In addition to the leather, canvas also appear in the spring/summer 2014, color, easy leisure, canvas deft, lash package as practical and beautiful, is a good choice. The weekend and holidays small swiss replica watches uk bag is the popular trend of spring and summer of next year, nature is little not, color collocation is very beautiful. Classic scooter bag is an essential part of every season, color and material have some breakthroughs, the suede and hollow out leather.
Posted @ Tuesday, August 26, 2014 8:59 PM by probably
Post Comment
Name
 *
Email
 *
Website (optional)
Comment
 *

Allowed tags: <a> link, <b> bold, <i> italics