Configuring Vim

Configuring Vim A coworker recently said To change config in vim, you have to be a power user - including understanding how to configure plugins. I’m sorry to say that he is not alone in this belief. Vim won’t hold your hand by giving you a bunch of preferences windows with checkboxes to turn functionality on and off. So, yes it is “harder”, but it absolutely does not require “Power User” levels of understanding. [Read More]

Cut, Copy, & Paste in Vim

Cut, Copy, & Paste Before we get to any of these, remember that in a graphical Vim client like MacVim all your normal OS cut, copy, and paste commands like ⌘x, ⌘c, and ⌘v (on the Mac) will work just fine when combined with mouse selections. The following commands will make a huge difference in your speed because, they’ll enable you to efficiently rearrange code without ever reaching for the mouse. [Read More]

Emergency Vim Quickstart

EMERGENCY VIM QUICKSTART You’ve ssh’d onto a server. You need to edit a file now. You need to use vim, and you haven’t a clue. You don’t have time for long explanations. Let’s go! READ THIS NOW You’re in the terminal so normal mouse usage for editing isn’t an option. Sorry, that’s a terminal thing, not Vim. Vim has a writing mode, and a not writing mode. You type i to start Inserting text into the document. [Read More]

Hello World in Vim

Every programmer starts a new language by writing hello world, and as you’ll see, Vim is a small DSL for text editing. So, here goes. On the command line, tell Vim you want to create a new text document called hello_world.txt. Note, there are some great grapical Vim clients if you’re not a fan of working on the command line. $ vim hello_world.txt Once you’re in vim, tell it you want to insert some text into this file [Read More]

Opening Files in Vim

When you launch Vim It’s important that you always launch Vim from the command line and at the root of your project. I’ll explain why later in the section on projects, but for now just remember to start your work from there. From your shell We already saw this one in the hello world: $ mvim path/to/file.txt Every time you do this you’ll open up a new window. [Read More]

Vim help when help is needed

Before I started writing this I thought “Vim’s got good help docs, people just tend to ignore them.” I should print them out and use them as a reference while writing this. Then I discovered there were 2,956 pages of them. After spending a fair amount of time spelunking through :help for this site, I’ve finally begun to understand why people mostly ignore Vim’s thousands of pages of help. It’s because they’re not help docs, at least not in the traditional sense. [Read More]

Graphical Vim Clients

One of the major complaints of Vim and other terminal editors, is that they’re terminal editors. Most people are used to using really nice Graphical editors with buttons, good mouse support, and good integration with the system clipboard. Fortunately, there’s no need to use a terminal version of Vim unless you’re SSH’d onto a remote computer. It should be noted that Neovim is getting a lot of interest these days and there many attempts to put a GUI wrapper on it. [Read More]