plugins

category applies to 16 screencasts and 5 articles:

Doing more with each change

I’ve noticed a pattern running through a few recent episodes of Vimcasts: I’ll demonstrate one way of doing something, and remark that to revert the change requires two or more undos. Then I’ll demonstrate another way of doing the same thing, perhaps using functionality from a plugin, and this time I can revert the change with a single undo. That seems to me to be a good criteria for deciding which method is better: it’s the one that can be reverted with the fewest number of undos.

Continue reading
Run time:

When UltiSnips is triggered from Visual mode it captures the selection and makes it available to our snippets. We can then insert the selection unchanged with the $VISUAL placeholder, or we can use UltiSnips Python interpolation to transform the text before inserting it back into the document.

Watch screencast
Run time:

UltiSnips can execute Python code and interpolate the result into a snippet. This makes it possible to create snippets that react to the text entered in each field. We’ll look at an example that performs a simple calculation and inserts the result into our document.

Watch screencast
Run time:

Snippets allow you to quickly insert predefined chunks of text into your document. The feature as I know it was first introduced in TextMate, but it has since been emulated by many other editors. For Vim users who want this functionality, the UltiSnips plugin is a great choice. Let’s start by looking at the basics.

Watch screencast
Run time:

Swapping two regions of text is a common task, which normally requires that we make two separate changes to the document. Tom McDonald’s exchange plugin offers an elegant alternative, by providing an operator that swaps two regions of text in one go.

Watch screencast

Follow my leader

Choosing a key-map for your custom Vim commands can be difficult. The common advice is to use <leader> for user-defined mappings, but that’s not the only option. There are dozens of two-key mappings that are not bound to any built-in functionality. These available mappings are easy to find if you follow a simple formula.

Continue reading
Run time:

Vspec is a library that allows you to test-drive your Vimscript code. In this tutorial, we’ll cover the basics: how to inspect the contents of a buffer, how to simulate the actions of a user, and how to invoke user-defined mappings.

Watch screencast
Run time:

Vim’s built-in abbreviation feature is handy if you want to auto-correct words that you frequently misspell, but it requires a lot of setup. The :Abolish command makes it easy to generate abbreviations that will correct multiple forms of the same word.

This is the final of a three-part series on Tim Pope’s abolish plugin.

Watch screencast
Run time:

The abolish plugin provides a command called :Subvert, which is like a supercharged version of Vim’s built-in :substitute command. The :Subvert command is especially useful for changing singular and plural variants of a word, and for refactoring names that appear in snake_case and MixedCase.

This is part two of a three-part series on Tim Pope’s abolish plugin.

Watch screencast
Run time:

The :Subvert command lets us create a particular style of regular expressions with ease. It’s great for matching irregular singular and plural words in plain English and also for variable names that come in snake_case and MixedCase forms.

This is part one of a three-part series on Tim Pope’s abolish plugin.

Watch screencast
Run time:

The * command searches for the word under the cursor. That makes sense in Normal mode, but from Visual mode it would be more useful if the star command searched for the current selection, rather than the current word. We can add this feature to Vim using the visual star search plugin.

Watch screencast

On sharpening the saw

Vim users sit somewhere on a spectrum, based on how much they customize their editor. At one end of the spectrum, there are those who use Vim with no customizations whatsoever. At the other end are those who customize Vim to the point where it barely resembles the stock install.

Continue reading
Run time:

Git provides tools for searching the contents of files, commit messages, and even whether text was added or removed by a commit. In this episode, we’ll see how fugitive’s Ggrep and Glog commands wrap this functionality up so that we can search the contents and history of a git repo from right inside of Vim.

This is the last of our five part series on fugitive.vim.

Watch screencast

The Fugitive Series - a retrospective

Fugitive.vim: a git wrapper so awesome, it should be illegal. That’s how Tim Pope describes his git plugin for Vim. I’ve had fugitive.vim installed since it was released, but until recently I never took the time to figure out what was so awesome that could make it illegal.

Continue reading
Run time:

With the fugitive plugin, you’re not limited to just working with files in your working tree. The :Gedit command allows you to open files in other branches, and to browse any git object, including tags, commits and trees. Plus, if your repository is hosted on github, you can easily bring up the webpage for any git object using the :Gbrowse command.

This is the penultimate of a five part series on fugitive.vim.

Watch screencast
Run time:

When git branches are merged, there is always the chance of a conflict arising if a file was modified in both the target and merge branches. You can resolve merge conflicts using a combination of fugitive’s :Gdiff command, and Vim’s built in diffget and diffput. In this episode, we’ll find out how.

This is the third in a five part series on fugitive.vim.

Watch screencast
Run time:

The fugitive plugin provides an interactive status window, where you can easily stage and review your changes for the next commit. The :Gdiff command visualizes the changes made to a file, by comparing the working copy with the index. In this episode, we’ll learn how to stage hunks of changes to the index without using the git add --patch command.

This is the second of a five part series on fugitive.vim. In the next episode, we’ll learn how to resolve a git merge conflict by performing a 3-way vimdiff.

Watch screencast
Run time:

The fugitive plugin, by Tim Pope, is a git wrapper for Vim. It complements the command line interface to git, but doesn’t aim to replace it. In this episode, we’ll see how some of fugitive’s commands can streamline your workflow.

This is the first of a five part series on fugitive.

Watch screencast
Run time:

There are times when you can improve the readability of your code by lining up the elements on neighbouring lines. In this episode, I demonstrate how this can be achieved using the Tabular plugin.

Watch screencast

A text-object for ruby blocks

Ever since learning about Vim’s text-objects I have wished that there was a way of selecting blocks in ruby code. Well, now there is. Today I am releasing a plugin that creates a custom text object for selecting ruby blocks. Merry Christmas!

Continue reading
Run time:

If you use Vim on muliple machines, it can be difficult to keep your configuration files synchronized across them. One solution is to put your dotfiles under version control. In this episode, I demonstrate how to keep your vimrc and plugins synchronized using git submodules and the pathogen plugin.

Watch screencast