togglecursor (GitHub: jszakmeister / vim-togglecursor, License: Vim) by John Szakmeister will change the cursor to a caret-style graphic when entering insert mode in iTerm and Konsole. I tested it in iTerm2 and it works. I'm not sure how I feel about it though, it makes the cursor harder to see on my screen which is probably a bad idea.
The script itself takes into account tmux, and I confirmed it works with Vim in tmux as well.
jk-jumps
jk-jumps (GitHub: teranex / jk-jumps.vim, License: Vim) by Jeroen Budts makes j and k add entries into the jumplist, so they behave more like jump motions (:help jump-motions). If I'm reading the source correctly, it remaps j and k to work using the G command, which modifies the jumplist.
A big part of editing that often gets overlooked is file navigation. Effective file navigation is a skill that can help improve productivity, but also aids visualisation of a project.
Vim's bare interface belies a wealth of hidden functionality that can help you dart around a project like a fake US crime drama hacker. One key feature is support for tag files. Tag files are simple text files that list "language objects" alongside file names and locations. It's very much like an index in a book, except it's generally interpreted by software rather than human readers.
I'm doing a talk about custom motions at the next Vim London meetup, which I'm looking forward to. Why did I pick the topic "custom motions"? Well, mainly because it'll force the audience to revise modes, operators, motions, and Vim's grammar.
Drew Neil is one of the organizers of this group, and I'm going to use his Practical Vim book as a reference. Not specifically to explain custom motions -- mainly because it contains useful quotes that explain the underlying concepts. For example:
If we think of Vim as a finite-state machine, then Operator-Pending mode is a state that accepts only motion commands. It is activated when we invoke an operator command...
Supertab (GitHub: ervandew / supertab, License: BSD) by Eric Van Dewoestine and created by Gergely Kontra is a plugin for invoking completion in Insert mode with the <Tab> key. It knows when not to invoke completion, but has a setting for preventing <Tab> from completing.
It's actually been kicking around since 2006, so over time it's grown to include several settings which are fully documented. For example, the first completion entry can be preselected, and completion functions can be chained together.
scriptease.vim
"Enjoy this amalgamation of crap I use for editing runtime files," says Tim Pope, about scriptease.vim (GitHub: tpope / vim-scriptease, License: Vim). It includes lots of useful functions for plugin developers, like :PP {expr} -- pretty print, :Time {command} -- a simple benchmarking function, zS -- show the active syntax highlighting groups under the cursor.
If you're like me, when you learn something new you rush straight in without a strategy -- picking up things as you go, using newly learned skills for practical work as soon as possible. The danger of this approach is you can miss out on some core skills, and develop bad habits. So what are the essential skills required to learn Vim?
As an experiment, I decided to write a list of what I consider the core skills for working with Vim. You can find the full list at the end of this article. It doesn't contain everything ever -- just the things I use on a daily basis. It will put you off from learning Vim! In one sense it's long and intimidating, in other it's testament to just how ridiculously flexible and powerful Vim is. However, you can learn everything on this list. Even being vaguely aware of the key topics will give you pointers on how to use Vim more productively.
Most books and tutorials focus on editing with Vim, but there's a lot more to daily work than editing. To master Vim you need to optimise your entire workflow, and that means configuring the editor, navigating between files, and even visualising the structure of projects and their myriad components.
sensible.vim (License: Vim) by Tim Pope is a selection of default settings:
Think of sensible.vim as one step above 'nocompatible' mode: a universal set of defaults that (hopefully) everyone can agree on.
Tim suggests that it can be used by beginners who are new to Vim, without relying on "some random vimrc you found". The settings aren't a million miles off my own .vimrc, to the point that I'm wondering if I should just start using sensible.vim and clean it up a little bit.
vim-steam (GitHub: raphaelr / vim-steam, License: New BSD) by Raphael Robatsch is capable of launching your Steam games, with tab completion! It uses Ruby to parse and launch the games -- if you look at the source the vdf.treetop file is a Treetop grammar for pulling out titles from Steam's cache.
It currently works in Windows, but the author is also working on Linux support.
File Pirate
File Pirate (GitHub: nfd / filepirate, License: MIT) by Nicholas FitzRoy-Dale is a fuzzy file finder designed purely for speed. It requires Python, and works using a window that appears at the top of the screen. It doesn't automatically reindex files when directories change, so you'll have to press CTRL-R to make it update them. It is, however, asynchronous -- searching an indexing runs in the background, so you can continue to use Vim without it blocking.
If you were born and raised on GUI editors, switching to the console and Vim feels like it lacks some of the speed of file navigation. Vim has a lot of different ways to quickly flip between files, and one that I like is the gf command (:help gf).
When in Normal mode, typing gf over text that refers to a file name will cause Vim to attempt to open that file. This is great when working with programming languages that include or require files relative to the current working directory.
By default, however, gf needs a little bit of assistance to find files. Let's say you're working on a project that's written with Node. In Node, files are referred to like this:
"That all said I still have some ideas on Clojure tooling I want to experiment with. So I will continue to work on the interactive part of VimClojure, but things will probably move in a much slower pace compared to the other projects."
So it's not exactly time to say goodbye to VimClojure, but the author himself is recommending moving to other projects.
Looking back over the past 40 or so script roundup posts, it's impressive just how much activity there is in the Vim plugins community. It really takes me no effort at all to find new and interesting scripts to write about.
Here are a few of my favourites that I covered in 2012.
EasyMotion
EasyMotion (GitHub: Lokaltog / vim-easymotion) by Kim Silkebaekken (who also wrote Powerline) helps make Vim's motions easier to visualise by highlighting the possible choices for motions like f: