You are not logged in.
Pages: 1
Topic closed
I just switched to rxvt-unicode - mostly because of its ability to set the WM_CLASS variable (Xfce's terminal, my previous terminal application, was unable to do so, and I was tired of dragging all my apps to the virtual desktop I wanted to have them on). So far so good, but I bumped into a problem I knew from a previous encounter with urxvt: it maps ctrl+left/right differently than xterm (and Xfce's terminal), and I can't jump words in Vi anymore.
I have been trying to map them in my ~/.virc to reproduce the behaviour, but that's not working (and I'm clueless why). This is the excerpt from .virc:
map ^[Oc W
map ^[Od B
map! ^[Oc ^[Wa
map! ^[Od ^[Ba
Ctrl+Left generates ^[Od, Ctrl+Right generates ^[Oc. Vi will put itself in insert mode (if it isn't already) when i press those combinations and insert a d or c, depending on the combination pressed, but no jumping words.
Does someone know what I'm doing wrong?
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
Does someone know what I'm doing wrong?
You're using arrow keys with vi
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
+1 for humour... I know the b/B and w/W keys, thank you. I don't like them.
Seriously... If that's all you can come up with, keep your hand off that post button and spare both of us the effort .
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
I'm sorry, I just couldn't resist
I'm not sure how you can fix that, if no one helps you before I wake up in the morning I'll look into it...
Last edited by moljac024 (2009-05-03 22:59:07)
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
I guess it was too good a chance to let go indeed . Thanks.
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
The solution that RedHat uses is to modify /etc/inputrc. I assume that means that ~/.inputrc can be used also. These are the two lines that they added in the rxvt section for Ctrl <Right, Left>:
"\eOc": forward-word
"\eOd": backward-word
Offline
I had a similar problem with the alt-arrows key combination. I solved it by using following code in my .Xresources
URxvt.keysym.M-Down: \033[1;3B
URxvt.keysym.M-Up: \033[1;3A
URxvt.keysym.M-Left: \033[1;3D
URxvt.keysym.M-Right: \033[1;3C
I expect you can do something similar with the control-key combination. And of course, do not forget to load your .Xresources at the beginning of your X session if you are not doing this already!
Offline
As an alternative to making vi recognize urxvt's Ctrl-Arrow keycodes, these settings will make urxvt generate the same keycodes as xterm (usually) generates on Ctrl-Arrow:
URxvt.keysym.Control-Up \033[1;5A
URxvt.keysym.Control-Down \033[1;5B
URxvt.keysym.Control-Left \033[1;5D
URxvt.keysym.Control-Right \033[1;5C
Offline
@ davvil & hbekel: Awesome, I'll try that when I get back home and report .
The solution that RedHat uses is to modify /etc/inputrc. I assume that means that ~/.inputrc can be used also. These are the two lines that they added in the rxvt section for Ctrl <Right, Left>:
"\eOc": forward-word
"\eOd": backward-word
Skottish, I already have those in my ~/.inputrc. The thing is, I understood /etc/inputrc and ~/.inputrc are used by readline and apps using it, but vim is not one of them. Those sequences make Ctrl+Right/Left work like in xterm and similar terminals (Xfce's terminal e.g.) - you can jump words - but Vim won't pick it up, since it doesn't use readline.
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
Okay i'm happy to report it works .
I dropped those mappings in my .Xdefaults, reloaded them with xrdb, restarted urxvt, and behold... Ctrl+Left/Right works again . Thanks a lot!
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
thanks for :
URxvt.keysym.Control-Up: \033[1;5A
URxvt.keysym.Control-Down: \033[1;5B
URxvt.keysym.Control-Left: \033[1;5D
URxvt.keysym.Control-Right: \033[1;5C
you need the ":"
do you know other important keysym to modify to have urxvt again more compatible with vim
Offline
thanks for :
URxvt.keysym.Control-Up: \033[1;5A
URxvt.keysym.Control-Down: \033[1;5B
URxvt.keysym.Control-Left: \033[1;5D
URxvt.keysym.Control-Right: \033[1;5C
you need the ":"do you know other important keysym to modify to have urxvt again more compatible with vim
Don't necro-bump please, see here.
Closing.
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
Pages: 1
Topic closed