You are not logged in.

#1 2006-03-11 18:42:43

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

Vim key mapping question, Xterm question

Since i type Dvorak, I wish to have a mapping to allow me to move between windows in vim with Ctrl-W d/h/t/n instead of Ctrl-W h/j/k/l  . I have looked in the vim help files, and online, but can't find how to do it. I tried eg.

:noremap <c-w>d<c-w> <c-w>h<c-w>

in vimrc, and the same thing but with <Down> instead of 'h', but neither worked... i'm not sure how to do this.

--------------

The second thing I want to ask is what the easiest way to bind middlemouse button to a keyboard combo is, so that I can paste stuff highlighted in eg. firefox into my terminal running screen - any ratpoison users will understand my desire to use the mouse as little as possible.. i use Screen's scrollback buffer mode to copy and paste everything within the terminal itself using only the keyboard, but I wish to be able to do the same thing from firefox to the terminal.


---------------

The third thing is (and I'm aware I'm less likely to get a solution to this one  roll  ) are there any obvious reasons why I wouldn't be able to switch to a tty from an X server? I've had this problem for several months now, and have still not resolved it (mainly because my own research alongside forum posts hasn't turned up any potential causes of the issue).

---------------

I love you all   big_smile

Komodo


.oO Komodo Dave Oo.

Offline

#2 2006-03-12 02:06:56

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Vim key mapping question, Xterm question

Here's mine:


  :noremap d h
  :noremap h j
  :noremap t k
  :noremap n l
  :noremap k d
  :noremap l n
  :noremap j t
  :noremap ^Wd ^Wh
  :noremap ^Wh ^Wj
  :noremap ^Wt ^Wk
  :noremap ^Wn ^Wl
  :inoremap ^] ^[A
  :inoremap ð ^N

Dusty

Offline

#3 2006-03-14 13:39:20

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

Re: Vim key mapping question, Xterm question

Awesome Dusty, cheers - that solves Question 1.

Any takers for Qs 2 or 3? wink

Komodo


.oO Komodo Dave Oo.

Offline

#4 2006-03-14 14:49:47

SleepyDog
Member
Registered: 2004-10-15
Posts: 114

Re: Vim key mapping question, Xterm question

Komodo wrote:

Since i type Dvorak, I wish to have a mapping to allow me
The second thing I want to ask is what the easiest way to bind middlemouse button to a keyboard combo is, so that I can paste stuff highlighted in eg. firefox into my terminal running screen - any ratpoison users will understand my desire to use the mouse as little as possible.. i use Screen's scrollback buffer mode to copy and paste everything within the terminal itself using only the keyboard, but I wish to be able to do the same thing from firefox to the terminal.

shift+insert

Offline

#5 2006-03-14 22:06:27

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Vim key mapping question, Xterm question

There's also a few apps that can be called to dump the X selection/clipboard buffers... xcutsel comes to mind.
You can probably bind a key in screen to dump xcutsel to the tmp file screen can use as a copy/paste buffer, then use screen's paste functionality.

I bring this up only because there's potential here to do wacky things with screen's paste-from-file setup, i.e.

date > /tmp/screen-exchange

bam, you can bind a key to "insert current date"

Offline

#6 2006-03-14 22:11:11

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

Re: Vim key mapping question, Xterm question

SleepyDog wrote:

shift+insert

Sadly I don't have an insert key on my keyboard...

phrakture wrote:

There's also a few apps that can be called to dump the X selection/clipboard buffers... xcutsel comes to mind.
You can probably bind a key in screen to dump xcutsel to the tmp file screen can use as a copy/paste buffer, then use screen's paste functionality.

I bring this up only because there's potential here to do wacky things with screen's paste-from-file setup, i.e.

date > /tmp/screen-exchange

bam, you can bind a key to "insert current date"

Cool tip phrak, thanks muchly wink

So, that's Q2 down. Anybody brave enough to attempt Q3? It's a toughie  :?


.oO Komodo Dave Oo.

Offline

#7 2006-03-15 20:49:29

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

Re: Vim key mapping question, Xterm question

Dusty wrote:

Here's mine:

  :noremap ^Wd ^Wh
  :noremap ^Wh ^Wj
  :noremap ^Wt ^Wk
  :noremap ^Wn ^Wl

Dusty

I already had the navigation keys mapped, but I just tried these for window switching, and no joy... .vimrc didn't like the syntax. I tried them in this format:

:noremap <C-W>d <C-W>h

..but vim still doesn't like it; there's no effect.

Any suggestions?


.oO Komodo Dave Oo.

Offline

#8 2006-04-07 02:28:53

riwa
Member
From: Lund, Sweden
Registered: 2006-04-04
Posts: 214

Re: Vim key mapping question, Xterm question

Dunno if this will help you. I had the same problem though...

http://bbs.archlinux.org/viewtopic.php?t=18115


If you must have must. Have must.
- DKE supporters about this wonderful swedish soda.

Offline

Board footer

Powered by FluxBB