Learn Essential Vim Skills
with Drew Neil, author of Practical Vim
plugins
category applies to 19 screencasts and 5 articles:
This video covers a couple of small but delightful Neovim features. You’ll see how to make Neovim show a live preview of how the substitute command will change our document. And you’ll find out how to make the yank operation highlight the range of text that it copied.
Watch screencastMeet minpac
#70
Minpac is a minimal package manager for Vim 8. It makes it easy to add plugins, keep them up to date, and remove them. In this video, we’ll see how it works.
Watch screencastPackages are a new feature in version 8 of Vim.
In this video, we’ll see how we can use packages to easily install Vim plugins.
The process will be familiar if you’ve used pathogen
.
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 readingWhen 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.
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 screencastMeet UltiSnips
#66
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 screencastSwapping 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 screencastChoosing 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.
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 screencastVim’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 screencastThe 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 screencastThe :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 screencastThe *
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.
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 readingGit 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 screencastFugitive.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 readingWith 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 screencastWhen 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 screencastThe 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 screencastThe 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 screencastThere 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 screencastEver 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 readingIf 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