Vim 8.0

Vim 8.0 is finally out! The Vim 8.0 announcement includes an overview of the main features of this major release. One of the significant changes is asynchronous I/O, which means plugins can execute without blocking Vim's UI. The communication protocol used for this supports JSON, which means you can write servers in practically any language as long as you can read and write JSON.

Here's what :help version8 says about asynchronous I/O with JSON:

Closely related to channels is JSON support. JSON is widely supported and can easily be used for inter-process communication, allowing for writing a server in any language. The functions to use are |jsonencode()| and |jsondecode()|.

Read More →

In Editor Linting with Syntastic

In this post I'm going to talk about setting up Syntastic in Vim, and why it's an important development tool. Syntastic is plugin that runs files through external syntax checkers (linters). It's capable of using built-in Vim features (statusline, sign, location-list) to show potential syntax and style issues.

This screenshot from the Syntastic developer (Martin Grenfell) shows what Syntastic in Vim terminology.

Syntastic Vim

Read More →


I'm going to take a break from usevim for a few weeks. We're about to have our second child, so things are going to be busy for a while!

Please keep sending in your scripts, colour schemes, and links to tutorials. I'll publish again soon.

Read More →


Karl Yngve Lervåg sent in vimtex (GitHub: lervag/vimtex), a script with lots of commands and mappings for LaTeX authors. It's inspired by LaTeX-Box, but is written from scratch with extensibility in mind.

Vimtex includes motions for section navigation and moving between matching delimiters, LaTeX-specific text objects, texcount integration, support for PDF viewers, and it even has completion for citations and labels. There are additional features like mappings and improved syntax highlighting: read more in :h vimtex.

The documentation includes details on the project's structure, so you can find out how vimtex initialises and manages state, and defines autocommands. If you're interested in extending vimtex with your own TeX-related features then the documentation helpfully provides enough details to get going!

Read More →


Ferret (GitHub: wincent/ferret) by Greg Hurrell is a search plugin that offers asynchronous search, multi-file replace, args list/argdo support, and QuickFix listing enhancements.

It supports The Silver Searcher, Ack, and grep. Asynchronous support is done with dispatch.vim -- you have to install dispatch.vim if you want asynchronous searching.

I've been trying it out, and it feels very similar to my usual Silver Searcher plugin, so I'm going to stick with it for a few weeks to see if I prefer it. So far I definitely like the multi-file replace, and the QuickFix list looks good.

Read More →

Terminus: Improved Terminal Support

Terminus (GitHub: wincent/terminus) by Greg Hurrell is a plugin for improving Vim's integration with terminals, with features designed for tmux and iTerm. Features include:

  • Cursor shape in Insert mode: thin vertical bar in the console
  • Mouse support: Activates 'mouse' support in all modes and additionally tries to activate sgr-mouse support
  • Terminal support for FocusGained and FocusLost events
  • Paste mode, so you don't have to set the 'paste' option

These features make Vim feel more like a GUI text editor, without doing anything too complex. I've seen quite a few plugins that attempt to improve the focus support, but I haven't yet tried using sgr-mouse. It seems like a good set of feature enhancements that people switching to console Vim are interested in.

Read More →

Visual Mode Increment

In Vim patch 7.4.754, I noticed Vim now supports incrementing numbers in Visual mode. You can increment numbers by pressing CTRL-A, and decrement with CTRL-X. It's one of those features that doesn't sound amazingly useful but can be handy once you've memorised it. If you build off Vim's master branch you can try it out now.

Visual increment

To enter Visual mode, type CTRL-V (technically Visual mode blockwise). You can then use hjkl to select multiple lines, and increment the numbers on each line with CTRL-A. I thought this might be good for shifting sets of numbers in a numerical list, like you might find in a Markdown file for example.

Read More →

Reloading Your vimrc

If you're tinkering with Vim's config, did you know you can easily reload the settings file without restarting Vim? You basically just need to "source" the settings file: :source ~/.vimrc. You can use the abbreviated command, so it's just :so ~/.vimrc. If you use a plugin manager like Vundle and keep the list of plugins in ~/.vimrc, then you'll need to source it after changing the list of installed plugins. There's no need to quit and restart!

Once you get the hang of this, you'll find you just open vimrc during editing sessions, without opening a new terminal and a fresh Vim to edit something.

There's a really cool section in Learn Vimscript the Hard Way about editing your vimrc that suggests creating some handy mappings for opening and reloading the settings file.

Read More →

CTerm to GUI

I've seen some tools that map from Vim GUI themes to console, but what about the other way around? A reader sent in vim cterm2gui2cterm (GitHub: 97-109-107/vim_cterm2gui2cterm), a tool that maps from console themes to GUI themes and back again.

It's a Python script that has a dictionary that maps colours from the console number to a hex equivalent (xtermMap). It outputs the result in a cterm or vim colour scheme file, so you can easily load it as a colour scheme. It might be useful if you often switch between gVim and console Vim and want to unify the themes.

Read More →

Vim for iOS: ctags

Xcode has Vim emulation plugins, but you can get by quite nicely with Vim and xcodebuild. If you want better code navigation, however, what do you do? Colin Drake has written an article about using ctags for iOS development:

With implementation files, header files, and the numerous set of frameworks we use to build apps, I’ve always found auto-completion and code navigation to be particularly difficult when writing Objective-C, especially when dealing with larger projects.

To remedy this, I've started using a very old tool, called ctags. ctags is able to parse source code and index methods, functions, classes, etc. for quick access later. Modern versions of Vim are built with ctags support by default, so this makes for a very easy integration.

Read More →