Sublime Forum

Sublime Text 2 with Vim keybindings?

#1

Hi, is there a pre-written plugin or mode to add vim keybindings to Sublime Text 2? I found a plugin in an old thread, but it didn’t seem to have any effect.

0 Likes

#2

There isn’t any existing plugin/key map that comes even near to Vim’s modal behavior. There is some basic support for a command mode (controlled by the command_mode option) built-in to Sublime Text 2, but I haven’t been able to make it work, although it’s been advertised in the relase notes (sublimetext.com/2).

It was available in Sublime Text 1 and I built a simplified Vim emulator around it which worked ok-ish, but was hard to expand/mantain/test. I’m eagerly awaiting progress or improvements in this area in Sublime Text 2, and would like to see a decent and comprehensive Vim emulation at some point (not necessarily shipped with the editor). Sublime Text Multiselect looks like a solid foundation to build a very powerful visual mode on.

But that’s all wishful thinking at the moment… Although let’s not forget that Sublime Text 2 is in alpha.

0 Likes

#3

Sounds good! Then I’ll take a look again!

0 Likes

#4

What is command_mode? Is it documented somewhere? It was hinted at in this post that command_mode might be helpful in getting ctrl-p and ctrl-n mapped to up/down in the quick panel (if I understood guillermoo correctly), which I am very interested in.

0 Likes

#5

The command_mode setting controls whether key presses should be sent to the buffer (False) or not (True). It’s useful to define key bindings that otherwise would cause characters to be typed. In order to resume normal typing, you first have to set it to False again. It’s similar to Vim’s command mode, hence the name, I believe.

0 Likes