A Personal Wiki For Vim Plugin

I was reading Ask HN: How do you organize your text files?, and I noticed Vimwiki mentioned by gregmorton. Sometimes writing anything in something that isn't Vim (Evernote, OneOne, etc.) feels awkward, but directories full of text files are hard to manage. That's where Vimwiki comes in.

Vimwiki adds syntax highlighting for a text-based wiki language that allows you to organise notes and to-do lists. If you press enter over a word you can create a vimwiki page. It seems like a good alternative to a mess of text files!

Read More →

Script Roundup: Buffersaurus, CMake

Buffersaurus

Buffersaurus (GitHub: jeetsukumaran / vim-buffersaurus) by Jeet Sukumaran is a plugin for searching (and replacing) across all open buffers. Typing :Bsgrep searches all buffers for a regular expression, and you can use an exclamation mark to only search the current buffer.

The :Bstoc command generates a table of contents for patterns based on filetype, which means you can use it to generate lists of method names.

There's also a :Bsreplace command for replacing text. For full documentation, see buffersaurus.txt.

Read More →

CTags and Vim

Supercharge your VIM into an IDE with CTags by sensible.io is a guide to using CTags with Vim:

CTags generates an index file of all your classes, methods and all other identifiers. You can use that index in your editor to jump straight to the methods you're interested in. In this article, I'll show you how to use them with Vim and Rails.

It's a short tutorial that introduces the basics, like how to generate CTags with the ctags command, and how to jump to methods with :ta.

Read More →

Script Roundup: characterize.vim

characterize.vim

Did you know a has a character code of 97, and A is 65? Sometimes I need to look up character codes for things like keyboard shortcuts in web interfaces, and in such cases I usually print out the events and look at the character codes.

With Vim you can press ga over a character, which also shows hex and octal values. characterize.vim by Tim Pope adds some additional values as well:

  • Unicode character names: U+00A9 COPYRIGHT SYMBOL
  • Vim digraphs (type after <C-K> to insert the character): Co, cO
  • Emoji codes: :copyright:
  • HTML entities: &copy;

HTML entities will be useful to web developers, and Vim digraphs are cool if you're writing Vim scripts like Tim. The emoji codes are used by certain chat services.

Read More →

Painless Vim

Painless Vim

Painless Vim by Nate Dickson is a new book about Vim, with a lighthearted tone yet well-researched content. It's published on Leanpub with no DRM, and the minimum price is $5.99. There's a free chapter so you can try it first, and a table of contents so you can see the planned content:

Painless Vim is written by a professional developer who tried to learn vim a number of times before it finally stuck. I kept falling into the same cycle: I'd read a wide a array of books, online tutorials, print-outs, go through all their steps, and in the end get almost nowhere. Then I'd quietly go back to my editor of choice until next time I decided to try it out.

Read More →

VimR

VimR

I've just managed to build VimR by Tae Won Ha. It's a Mac version of Vim that started out as an attempt to get the author's earlier MacVimFramework embedded in a real application.

Building it wasn't that hard -- all I had to do in addition to the guide in the readme was sudo gem install cocoapods.

One cool feature that VimR adds is a "quickly open" dialog that seems to index files quickly, and you can even search before indexing has finished.

Read More →

Script Roundup: tslime.vim, diffchar.vim

tslime.vim

tslime.vim (GitHub: lord-garbage / tslime.vim) by Christian Brauner is a fork of slime.vim that uses tmux instead of screen. It has been refactored to use tmux's panels.

If you used slime.vim, Christian has put the same shortcuts into the readme so you can make it feel like the original.

diffchar.vim

diffchar.vim by Rick Howe is a plugin for diff mode that shows differences based on characters.

Read More →

Spell Checking: Managing Mistakes

I wrote about spell checking in my last article, and there was a small but useful detail that I missed: skipping to the next misspelled word. You can type ]s to do this, and it helps when you're writing long text files.

In my case I write a lot of blog posts and even my books in Vim, so I now type ]sz= instinctively. To search backwards, use [s.

You can also add words to the dictionary, with zg. You can think of this as "add good word".

Read More →

Spell Checking

Replacing text with z=.

You probably already know that you can enable spell checking in Vim with :set spell. This is great for drafting up blog posts, particularly if you write in a lightweight format like Markdown. If you type :help 'spell' you'll see some other options, like 'spelllang' and 'spellsuggest'. Vim actually has quite a few options for tailoring the behaviour of the spell checker, but I usually find it works fine out of the box.

Something new to me that I learned recently is z=. Typing z= shows a menu of words that are similar to the text under the cursor. You can press a number to quickly select one of the words, so if it's an obvious mistake you may even be able to type z=1.

The :spellr command repeats the previous replacement for all matches in the current window. I've done this where I've pasted text with a consistent error.

Read More →