WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: vim keybindings  (Read 3108 times)

Offline althalus

  • Sr. Member
  • ****
  • Posts: 351
vim keybindings
« on: November 07, 2009, 06:36:45 PM »
So it seems that ctrl+ left,right,up, down don't map properly in tinycore.
I would very much like to be able to map these keys in vim.
Instead, pressing those keys inserts the letters a through d above the current line.

Anyone know a solution to this?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11050
Re: vim keybindings
« Reply #1 on: November 07, 2009, 06:59:47 PM »
Is this is a tty or in X? Do you have a non-US keyboard?
The only barriers that can stop you are the ones you create yourself.

Offline althalus

  • Sr. Member
  • ****
  • Posts: 351
Re: vim keybindings
« Reply #2 on: November 07, 2009, 10:17:51 PM »
In X, using US layout. It works fine in Linux Mint (which uses xterm) but not in TC (Which appears to se rxvt). I can see via google that rxvt seems to handle ctrl+arrows slightly different to xterm, but nothing that seems to be a solution for vim.

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: vim keybindings
« Reply #3 on: November 08, 2009, 12:34:07 AM »
Arrows work without <ctrl>.  'w' and 'b' will move forward, back by word instead of space.  Puppy uses rxvt, and the ctrl + <-->   act like b/w  . ... probably can be set in .vimrc  

edit:  <shift> + <-->  moves like b/w
« Last Edit: November 08, 2009, 01:08:51 AM by jpeters »

Offline althalus

  • Sr. Member
  • ****
  • Posts: 351
Re: vim keybindings
« Reply #4 on: November 08, 2009, 01:10:30 AM »
Jumping back and forward by word isn't what I want them for. Hm, but puppy has it working? Thanks, I'll see if I can work out how they do it.

Offline althalus

  • Sr. Member
  • ****
  • Posts: 351
Re: vim keybindings
« Reply #5 on: December 19, 2009, 07:52:24 AM »
Arrows work without <ctrl>.  'w' and 'b' will move forward, back by word instead of space.  Puppy uses rxvt, and the ctrl + <-->   act like b/w  . ... probably can be set in .vimrc  

edit:  <shift> + <-->  moves like b/w

EDIT: Found my solution:
Code: [Select]
map <Esc>Oa <C-W>k
map <Esc>Ob <C-W>j
map <Esc>Oc <C-W>l
map <Esc>Od <C-W>h
This gives me the behaviour I was after. =)
« Last Edit: December 19, 2009, 08:03:05 AM by althalus »

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: vim keybindings
« Reply #6 on: December 19, 2009, 02:07:26 PM »

EDIT: Found my solution:
Code: [Select]
map <Esc>Oa <C-W>k
map <Esc>Ob <C-W>j
map <Esc>Oc <C-W>l
map <Esc>Od <C-W>h
This gives me the behaviour I was after. =)

Cool....glad you got it working!
« Last Edit: December 19, 2009, 02:22:37 PM by jpeters »