Tagged: vim

linked

Side-by-side diff and Git commit message editing in vim #

Adam Roben shared a handy Vim function for opening diffs in a new vertical split when you edit your commit message with git commit.

linked

vimtronner #

Learn to navigate using the core vim keys in a Tron-inspired multiplayer game.

linked

A good vimrc #

Doug Black begins his extensive, approachable guide to organizing your .vimrc with a warning against cargo culting:

Don't put any lines in your vimrc that you don't understand.

I would agree with that statement — for intermediate and advanced users. If you're new to the shell, starting with a framework or someone else's dotfiles bootstrap can ease your immersion into text mode.

Your goal should be to get comfortable enough to craft your own workflow and build your .vimrc from the ground up.

linked

vim-sensible #

A sane starting point for your .vimrc from Tim Pope, one of the community's most prolific plugin writers.

Think of sensible.vim as one step above 'nocompatible' mode: a universal set of defaults that (hopefully) everyone can agree on.

Looks like a great starting point to build upon by cherry-picking from other people's Vim setups instead of starting with an opinionated setup and whittling down from there.

linked

Vim anti-patterns #

Great list from Tom Ryder on things you should be doing in Vim, including this little timesaver:

It’s always useful to jump back to where you were, as well, which is easily enough done with `` (two backticks).

linked

Move faster in Vim with relative line numbers #

Jeff Kreeftmeijer:

Since 7.3, Vim has a setting called relativenumber (you can set it up with :set relativenumber or :set rnu), which is a lot like the number setting you’re probably using to have line numbers already. But, instead of showing the absolute line numbers from the top of the file, it shows them relative to the line you’re currently on. That means the line below the current one is marked with 1, as is the line above. Now it’s quite easy to find out how many lines you need to jump up or down.

I've been trying out relative line numbers and I agree, it makes it simpler to get around in normal mode. Jeff has released a plugin to add some smart toggling based on Vim's focus state and mode.

Installed.

linked

Aliases for common Vim typos #

I've been enjoying Tom Ryder's blog which is chock full of Vim, bash, and git smarts. Today's tip alias those commonly fat-fingered Vim commands:

command! -bang E e<bang>
command! -bang Q q<bang>
command! -bang W w<bang>
command! -bang QA qa<bang>
command! -bang Qa qa<bang>
command! -bang Wa wa<bang>
command! -bang WA wa<bang>
command! -bang Wq wq<bang>
command! -bang WQ wq<bang>

Add these to your .vimrc (here's mine), and your Vim is a bit more forgiving.

If you're new to Vim, be sure and read Tom's rundown of buffers, windows, and tabs.

linked

Vim + tmux = custom IDE #

Alex Young on stitching together your own development environment with tmux, vim, and other text-mode apps:

The difference between this approach and a traditional IDE is this interface adapts around my current task, and is only limited by the thousands of commands and scripting languages that I have installed.

As a recent command-line Vim convert, I agree. I use tmuxinator to automate the process. I have tmux environments for development projects, blogging, and even GTD with taskpaper.vim.

I'm also anxious to try the upcoming iTerm + tmux integration.

All tags