Script Roundup: limelight.vim, Gist.vim

limelight.vim

limelight.vim is a WriteRoom-style plugin that has an additional feature: the active section or paragraph is highlighted. It dims paragraphs using colour calculations, and you can control this using some variables:

" Color name (:help cterm-colors) or ANSI code
let g:limelight_conceal_ctermfg = 'gray'
let g:limelight_conceal_ctermfg = 240

" Color name (:help gui-colors) or RGB color
let g:limelight_conceal_guifg = 'DarkGray'
let g:limelight_conceal_guifg = '#777777'

" Default: 0.5
let g:limelight_default_coefficient = 0.7

It also has support for Goyo.vim.

Gist.vim

I recently wrote about a Gist plugin, and Keith Smiley sent in his solution: Gist.vim. This one requires Python and has detailed documentation.

Read More →

Five Simple Lisp Tips Guaranteed to Boost Productivity

Even though I like to use Vim for pretty much everything, I can understand why Lisp programmers gravitate to Emacs. Five Simple Lisp Tips Guaranteed to Boost Your Productivity introduces some basic Lisp and then shows how to make Vim better at handling it.

For example, the first tip is improving highlighting for brackets by using Better Rainbow Parentheses. There's also some instructions on what motions to use with Lisp.

Another essential Lisp-related Vim script is fireplace.vim, which is like a REPL for Vim and Clojure. A REPL is really useful for beginners who are learning Clojure, because it allows you to interactively experiment with code until you understand it.

Read More →

Vim as a Language

Learning Vim in 2014: Vim as Language is one of a series of posts by Ben McCormick about learning "modern" Vim. It takes the approach of describing Vim in terms of grammar, which I think was nicely encapsulated by the famous You Don't Grok Vi comment on StackOverflow.

On motions, Ben writes:

If you're a grammar nerd or remember your 8th grade english classes, you can think of these as transitive verbs that need to act on a direct object. These "direct objects" come in 2 forms, motions and text objects. Motions are the motion commands that you can use at any time to move around Vim.

Read More →

Script Roundup: vim-autoformat, Fist of Vim

vim-autoformat

A reader sent in vim-autoformat, which uses external programs to format code. The default formatprograms include formatters for C, C#, C++, Java, JavaScript, and Python.

The reader mentioned that it's useful for Python programmers who want to format code according to PEP 8.

Fist of Vim

Fist of Vim (GitHub: ajh17 / vim-fist, License: Vim) by Akshay Hegde is an extremely simple Gist script. It uses <Leader>p for creating new Gists, and <Leader>u for updating them.

Read More →

Find Plugins with VimAwesome

VimAwesome

One of the things I do when looking for Vim scripts and programming libraries is check the number of GitHub watchers. If the project looks technically solid but has low attention, then I'll probably write about it or use it. If it has thousands of stars then I know it's probably pretty cool and should do what I want.

VimAwesome somewhat automates that process by providing a web app that shows an index of Vim scripts based on GitHub stats. Entries are categorised, so if you wanted to find ctags plugins then just search for tag:ctags.

Read More →

Vim for People Who Think Vim is Weird and Hard

I recently read Vim for people who think things like Vim are weird and hard by Harry Roberts, a post that attempts to explain why Vim is worth learning:

I'd watch friends using Vim and be perplexed as to why you'd possibly ever need to type <Esc>ggdG to delete the entire contents of a file. How on earth can something so bizarre do that? How on earth do you remember that? In what world does that even make sense?!

In fact, the <Esc>ggdG example is a great demonstration of misconceptions and misinformation in Vim world. The command to delete the entire contents of a file is simply dG: delete and Go to the bottom of the file. What <Esc>ggdG actually does is:

Read More →

Editing Macros

Sometimes people ask me "what's the point of macros in Vim?" I think of macros as repeatable complex commands: they're a lot like functions. I find them indispensable due to the fact you can easily manipulate them as strings, pulling them in and out of registers at will.

Macros are really just registers that you can replay at a different point in the file. Knowing that, you can start to manipulate macros on another level.

For example, imagine you've got a macro recorded in the q register. Type "qp to paste it to the current buffer. Now edit the text, and yank it back into a register. You could do this with a visual selection, or something like ^"qy$ to yank the entire line into q.

Read More →

fzf: Fuzzy Finder for the Shell

fzf

fzf by Junegunn Choi is a ctrlp.vim-inspired Ruby script that allows you to find shell commands with a fuzzy finder. If you use tmux then it can be launched in a split window.

It comes with keyboard shortcuts for bash, zsh, and fish, and there is Vi-mode compatibility support for bash.

Read More →

Script Roundup: Vimbed, Kerbal Space Program Syntax

Vimbed

Vimbed (GitHub: ardagnir / vimbed, License: MIT) by James Kolb is a script to make it easier to run Vim in the background when you want to embed Vim in another program.

It's used in Pterosaur for Firefox and Chalcogen for Atom.

Kerbal Space Program Syntax

If you play Kerbal Space Program, then you might like Kerbal Space Program Syntax (GitHub: mic47 / KSP-Syntax, License: MIT). It adds support for .craft files and save files.

Read More →