Author Topic: Vim emulation question: how to map <Space> to <C-f>  (Read 3639 times)

jamesqiu

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
Vim emulation question: how to map <Space> to <C-f>
« on: December 13, 2007, 07:30:40 am »
slickedit do has a great vim emulation!

How can I do following map in slickedit as in vim:

imap jj <ESC>
map <Space> <C-f>

thanks.

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 987
  • Hero Points: 77
Re: Vim emulation question: how to map <Space> to <C-f>
« Reply #1 on: December 13, 2007, 03:26:48 pm »
I'm sorry...I'm not quite understanding the request  :-[.  Do you want to bind "jj" to what <ESC> does in Vim?  And also bind <Space> to what "Ctrl + F" does?  Or something different?

- Ryan

jamesqiu

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
Re: Vim emulation question: how to map <Space> to <C-f>
« Reply #2 on: December 14, 2007, 02:44:14 pm »
It really is!  Please tell me how.

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 987
  • Hero Points: 77
Re: Vim emulation question: how to map <Space> to <C-f>
« Reply #3 on: December 14, 2007, 03:18:14 pm »
Hmm...ok.  Ctrl + f does PgDn...and I'm assuming you don't want to bind <Space> to PgDn in insert mode, so to create this binding for command mode you can use the Key Bindings dialog. 

  • Tools > Options > Key Bindings...
  • Search for command vi-page-down.
  • Double-click one of the bindings for vi-page-down to open the Bind Key dialog.
  • Open the Advanced options, check Bind to mode, and select Vi Command Mode in the drop-down list.
  • Now just click in Key Sequence, hit <Space>, and then click Bind.

That should do the trick...but I'm still confused about the "jj" to <ESC> binding.  I don't think you would want this for command mode, because <ESC> doesn't do much in command mode.  If we do it for insert mode, well, that would seriously affect your ability to type j's.  Let me know if I'm missing something.

- Ryan