Script Roundup: VimL Parser, Pry/Vim Integration

Send in your Vim scripts for review through our contact form.

VimL Parser

VimL Parser (GitHub: ynkdir / vim-vimlparser) by Yukihiro Nakadaira is a Vim Script parser that, given a suitable file, will output a parenthesized Polish prefix notation version of the script. For example, call vimlparser#test('.vimrc') will display a parsed version of your Vim configuration.

The project also includes tests, with examples of the expected output. The source in this plugin is pretty huge, so you might like to check it out if you want to see something extreme in Vim Script.

Pry/Vim Integration

pry for Ruby is a popular IRB replacement. Ryan King has created a script to integrate Vim and pry that has some interesting ideas behind it.

Read More →

Vim 101: Efficient HTML Editing with Text Objects

If you're working with XML or HTML, then the at and it text objects are useful. You can remember at with the mnemonic "a tag block", and it as "inner tag block". The difference is that at includes the tags.

Consider the following example:

<p><a href="">This is a link</a> and <em>this is an emphasis</em>.
<a href="">This is another link</a>, which points to another page.</p>

If I position the cursor anywhere inside the <em> tags and type dat, it'll remove the text and tags, because it means "delete a tag block":

Read More →

Understanding 'listchars'

I was searching GitHub to see what weird and wonderful characters people use for their 'listchars' setting. This all started because I was using a Chromebook, and the built-in shell had trouble displaying some of the characters I use for showing invisible characters. Looking at my .vimrc, I realised my 'listchars' setting hadn't been changed in years, and it was probably due a bit of refactoring.

The purpose of the 'list' (:help 'list') setting is to visualise tabs, spaces, and line endings. The 'listchars' setting (:help 'listchars', abbreviation: 'lcs') determines the strings that will be used when list mode is active. It includes just about everything a programmer generally needs for keeping track of pesky invisible characters:

  • eol: The character to show at the end of each line
  • tab: The characters used to show a tab. Two characters are used: the second will be repeated for each space
  • trail: Character to show for trailing spaces. This is probably the thing most of us are looking for

There are more settings which are all documented, but these are the ones that are used the most often. A typical 'listchars' setting might look like this:

Read More →

Script Roundup: Git Gutter, vim-nodejs-complete

Send in your Vim scripts for review through our contact form.

Git Gutter

Vim Git Gutter (GitHub: airblade / vim-gitgutter, License: MIT) by Andrew Stewart shows a symbol in the sign column to indicate where lines have been added, modified, or deleted. This is based on Git Gutter for Sublime Text 2.

Vim's documentation in :help sign-intro explains what the sign column is for if you're not familiar with it.


vim-nodejs-complete (GitHub: myhere / vim-nodejs-complete) by Lin Zhang adds 'omnifunc' support for Node developers. For example, typing:

Read More →

Vim 101: Object Motions

Discovering and retaining good habits for file navigation is one way to vastly improve your productivity when using Vim. Other than jumps and searching, text object motions are also a great way for skipping around a file like a Vim virtuoso.

Text object motions (:help object-motions) cause the cursor to move in Normal mode based on rules that sometimes seem archaic, but the basic ones are easy to get the hang of.

The ( and ) motions move the cursor [count] sentences backward and forward, respectively. If you type 3) the cursor will move 3 sentences forward. Of course, the concept of a "sentence" may vary depending on what you're writing, and Vim's documentation defines a sentence as text that ends in a ., !, or ?, followed by whitespace (:help sentence). This might not make a lot of sense if you're writing code, but if I'm writing documentation or blog posts then I find myself using it.

Read More →

Stop the Vim Configuration Madness

We used to use TVs as monitors and it was terrible

Convention over configuration is an established paradigm, it even has a Wikipedia page! I like the idea of things working well out of the box. However, when it comes to Vim many people are attracted to it because they've heard how configurable it is. I think most of us are drawn to hackable things -- there's probably a strong correlation between Vim users, Arduino hackers and Android tinkerers. But the obsession with configuration has got to go.

Too many new Vim users obsess over plugins and configuration. Let me give you an extremely important Vim tip: practice using it. I've seen one too many love-letter-to-Vim blog posts where the author recommends a flashy plugin that does nothing to really improve productivity. You know what improves productivity? Mastering motions and operators. Digging into Vim's grammar to better understand how to navigate within lines, and quickly hop around large files. Are you really hammering the arrow keys or page up/down, or are you instantly flipping to a previous position with a mark, or jumping between characters with t and f?

Read More →

Script Roundup: ingo-library, Evil

Send in your Vim scripts for review through our contact form.


Ingo Karkat has released ingo-library, which contains all of the common autoload functions that he uses with his scripts. In his documentation he mentions previous initiatives for developing a Vim "standard library", which I think is an interesting idea.

Ingo has included a function for opening external instances of Vim, and functions for working with Vim error messages and warnings.


This isn't a Vim plugin, but an Emacs major mode called Evil. It effectively provides a vi layer for Emacs, and offers support for some well-known plugins through Evil ports.

Read More →

Vim 101: The Jump and Change Lists

Moving around a file efficiently can improve your productivity, but it takes a while to get the hang of Vim's jumps. Last week I wrote some tips for practicing marks -- ideas for working marks into your daily workflow. Marks and jumps are closely related, mainly because of the jump list.

Certain commands are considered jumps: you probably already use the Normal mode command G which means 'go to line'. Searching (/ and ?) also causes jump list entries to be added, and the same is true for repeating searches (n, N). Also, motions that move the cursor based on the window's size (L, M, and H) will add entries into the jump list.

These commands are motions, because they move the cursor, and the Vim manual calls them 'jump motions' because they add jump list entries.

Read More →

Language-Specific Settings

I like the idea that programmers should be eclectic:

eclectic [i╦łklektik]: adjective deriving ideas, style, or taste from a broad and diverse range of sources: her musical tastes are eclectic.

Playing around with different languages, libraries, and systems can lead to new ideas. One of my favourite programming languages for experimentation has always been Lisp: nobody pays me to use it, but I enjoy it nonetheless.

Read More →

Script Roundup: YouCompleteMe, JavaScript Libraries Syntax

Send in your Vim scripts for review through our contact form or @vimnews.


YouCompleteMe (GitHub: Valloric / YouCompleteMe, License: GPL3) by Strahinja Val Markovic got a huge amount of attention last week (it's quickly approaching 1000 GitHub stars). It's a fuzzy code completion engine, and can use Clang-based semantic completion for C-family languages (including Objective-C).

Completion is invoked automatically, so it behaves more like GUI IDEs rather than Vim's built-in style of handling completion. The <Tab> key can be pressed to accept a match or cycle through results. The matching algorithm is based on the order of characters in a string, so a given sequence of characters can appear interleaved with other characters as long as the order they appear is the same.

You'll need a build system to install YouCompleteMe, and it can be compiled with or without support for semantic matching in C languages. The documentation covers all of this and more, including configuration and detailed command explanations.

Read More →