Home Download Buy Blog Forum Support

Sublime Text 2 with Vim keybindings?

Sublime Text 2 with Vim keybindings?

Postby thekube on Thu Feb 10, 2011 8:40 pm

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.
thekube
 
Posts: 1
Joined: Thu Feb 10, 2011 8:38 pm

Re: Sublime Text 2 with Vim keybindings?

Postby guillermooo on Thu Feb 10, 2011 9:01 pm

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 (http://www.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.
guillermooo
 
Posts: 729
Joined: Thu Jul 23, 2009 9:06 am

Re: Sublime Text 2 with Vim keybindings?

Postby guillermooo on Fri Feb 11, 2011 2:04 pm

Sounds good! Then I'll take a look again!
guillermooo
 
Posts: 729
Joined: Thu Jul 23, 2009 9:06 am

Re: Sublime Text 2 with Vim keybindings?

Postby stiang on Fri Feb 11, 2011 3:26 pm

sublimator wrote:command_mode is working for me after >>> view.settings().set('command_mode', True)


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.
stiang
 
Posts: 39
Joined: Sat Jan 29, 2011 12:34 pm

Re: Sublime Text 2 with Vim keybindings?

Postby guillermooo on Fri Feb 11, 2011 4:31 pm

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.
guillermooo
 
Posts: 729
Joined: Thu Jul 23, 2009 9:06 am


Return to General Discussion

Who is online

Users browsing this forum: koan and 15 guests