Tag Archives: vim

You don’t need multiple cursors in Vim

MasteringVim tweeted an article by Christoph Hermann:

There is a plugin for vim (vim-multiple-cursors) which allows you to mimic that behaviour, but it has some problems.

After using it for quite some time I came to the conclusion that there is no situation which canโ€™t be addressed (IMHO even better) with โ€œnativeโ€ vim features.

Editing text in a non-Vim environment is a pain, so multiple cursors might seem a good idea (in fact, it was one of the major selling features of Sublime Text). But with all the modal editing features in Vim, you don’t need to go into the trouble of manipulating multiple cursors. Check out the article for some cool tips, including the powerful visual-at function.

ACTUAL Vim in Sublime Text

ActualVim is a fucking brilliant project:

The goal is to use a hidden Vim instance to accurately manipulate a Sublime Text buffer as though you were editing the text directly in Vim. This has been accomplished.

It’s not simply a terminal emulator embedded in a text editor. Sublime is still in control of the text buffer. You will be able to use the entire native Sublime interface while in INSERT mode, including plugins.

IMNSHO, all Vim emulators suck. This freak of a project will surely make you feel you’re at home. Heck, you can use your complete Vim setup with this.

The only downside is (you saw this coming :twisted:), it does not work on Windows. On Linux or OS X you can simply use Vim itself, but the Windows version is ugly and Sublime is the best alternative out there. Perhaps I’m asking for too much. ๐Ÿ˜

Anywho, this is wonderful news for Linux/OS X Sublime Text users out there.

Trying out the cheat codes before you play the game

Did I mention how much I love analogies? Can’t stop but post when I come across a good one. ๐Ÿ™„

From /r/vim:

I have two half brothers who came along when I was 11. When they were old enough to play video games, I got them a good one, and just to round out the present and make it a two-stack of wrapped gifts, I threw in the big walkthrough/cheats guide book. I’d had a few of those back in the mid/late 80s for Nintendo, which I would turn to when I got really stuck, or after I beat a game to go back and have some additional fun cheating.

To my horror, they ran into the other room, put in the game, then opened the book and found the cheats and put in several cheat codes before even playing! They wouldn’t even hear of not doing it. It’s what “everyone” did. I’m fine with cheating for fun like that – I did it – but at least play for awhile so you can tell you are cheating. How are you going to think “Ah, that’s much better now that I don’t die as often” unless you’ve died often for a bit to set a baseline? How are you going to think “Wow, the light saber makes this level ridiculously easy” unless you knew that there is no light saber in the normal game, and it’s actually a difficult level without that easter egg?

How will you even know what Vim even is if you’ve immediately bolted on a bunch of upgrades? How are you going to ask for help? “Hey guys, I’m not sure if this is a Janus thing, or something from my coworker’s configuration, or one of the 15 plugins I installed, because some guide said they were cool (I have no idea, I’ve never really used Vim before!), but, uh… when I press ‘b’, isn’t it supposed to go back a word? It’s doesn’t.”

Yeah? Well, good luck.

Most popular .vimrc options

There’s an interesting research on .vimrc files in blog.venthur.de:

I downloaded 155 .vimrc files from the net (mostly from dotfiles.org and github.com), and wrote a little script which counts the number of times an option has been set.

The most popular option seems to be nocompatible, which doesn’t really do much at all. I guess the reason for the high rank is that plugin managers like Vundle ask the users to set the option before anything.

Understandably, tab-related options like tabstop, shiftwidth and autoindent rank high in the list. I was a bit shocked to find out that incsearch, which ranks number 3, doesn’t appear in my own .vimrc, but later realized that it had already been taken care of by vim-sensible ๐Ÿ˜€

ShortcutFoo

As you may have guessed from the name, ShortcutFoo lets you master keyboard shortcuts in various apps including Vim, Emacs, Eclipse, Git, Excel, Visual Studio and many more. It first lets you learn the shortcuts, then presents drills and a practice mode to master them. So you actually use the shortcuts, instead of just memorizing them. Clever idea.

The downside is, only a few shortcut bundles in each app is free. To unlock the rest, you’ll have to pay a one-time fee of $8.99. That’s too high. I may subscribe one day if I happened to learn Emacs or some crazy text editor other than Vim. But no thanks for now.

Why the ‘Foo’ anyway? Shouldn’t it have been ‘Fu’?