hjkl and Touch Typing

I use hjkl, after disabling arrow keys for a few months. If you don't use hjkl, I think you should try it because it's a lot easier to get used to than you might think. You just have to dive in to the deep end and practice.

hjkl and touch typing is a post on reddit by benekastah that asks if it would be more optimal to move the keys to the natural home keys, like jkl;.

There are some interesting points raised in the discussions, like this one by Syfrix:

Read More →

Swift Support for Vim

Toyama Satoshi has created a vim-swift project that adds support for Swift's syntax highlighting and indentation.

Swift is Apple's new programming language that is REPL friendly and has some innovative "playground" features in the new Xcode.

Even though it's currently a small project, vim-swift has some nice touches: each part of the plugin is cleanly separated, and there are test .swift files that could probably be tied in to automated testing.

Read More →

Script Roundup: Merginal

Merginal

Merginal (GitHub: idanarye / vim-merginal) by Idan Arye is a Git branch merge tool. It has an interactive UI for viewing branches, checking out branches, merging branches, and solving merge conflicts.

The branch list supports some keyboard commands, including R to refresh the buffer list, and M to merge the branch under the cursor into the currently checked out branch.

I like tools that help me step through merge conflicts because it's usually something that I struggle with when working in feature branches. I often use vimdiff as a mergetool, but even then I find it hard to visualise changes in certain file types -- XML regularly breaks my brain.

Read More →

Vim Polyglot

If you consider yourself a bit of a polyglot, then managing lots of syntax files can get annoying. For example, I have plugins for CoffeeScript, Markdown, Jade, CSS pre-preprocessors, and Clojure. I think this situation is pretty common for web developers who use Vim. Even though Vim has some pretty sensible built-in syntax files, languages change pretty quickly.

I recently found vim-polyglot by Adam Stankiewicz which bundles over 50 "language packs" together. It has all of the ones I wanted, and more I didn't even know about.

The author claims it has some advantages over installing separate plugins:

Read More →

Cross-Platform Swiss Army Knife

I found myself working on Objective-C, JavaScript, and C# all at the same time today. One issue I ran into was our C# model classes used camel case property names, but the JSON from the Node server used underscores.

I wrote a dictionary to map the fields by using Vim to convert all the underscore field names into something C#-friendly. This is what I ended up with:

private static readonly Dictionary<string, string> FieldMap = new Dictionary<string, string>
{
    {"ExampleFieldOne", "example_field_one"},
    {"ExampleFieldTwo", "example_field_two"},

The data on the server originally came from an sqlite database, so I pulled out the column names which used underscores, and then put them in a text file.

Read More →

Script Roundup: caniuse.vim, Joyent Plugin List

caniuse.vim

If you're writing CSS and can't remember what browsers support a given feature, then you probably switch to a browser and open caniuse.com. A new alternative is caniuse.vim (GitHub: zoeesilcock / vim-caniuse) by Zoee Silcock.

You can trigger a search from Normal mode by using <leader>ciu. You can also use a command: :Caniuse border-radius.

If you're writing a lot of CSS then this might improve your workflow.

Read More →

Core Vim Course

Drew Neil, author of Practical Vim, has published a set of learning materials for Vim called the Core Vim Course. It includes 10 videos, 16 exercises, PDFs, and transcripts for each video.

The course costs $120, which is cheaper than a workshop, plus you can follow along at your own speed. The videos don't have DRM, so you could download them and work offline -- I usually do courses like this on the train because that's the only chance I get!

There's also a $255 "online" option which allows you to get a four hour live tutorial and a realtime question and answer session.

Read More →

Shougo's AMA

I enjoyed reading Tim Pope's AMA on reddit, and it has now been followed by a Shougo AMA. Shougo is the author of several popular Vim plugins, including unite.vim and neocomplete.

[–]ShougoMatsuDark Vim Master / 暗黒美夢王(Uncock Vim Awe)[S] 41 points 3 days ago

Yes, I have watched neovim repository. I think "neovim" is the result of Vim community division. I think Vim community has 3 types people.

Read More →

Script Roundup: vital.vim

vital.vim

vital.vim (GitHub: vim-jp / vital.vim, License: NYSL) from the Japanese Vim User Group is a collection of useful Vim functions. It includes libraries for assertions, various data types, SQLite, options parsing, JSON, XML, and more.

Modules can be installed with :Vitalize, and functions can be imported with vital#of.

The modules are used internally to construct other modules. For example, JSON.vim builds on Data.String.

Read More →