You are not logged in.

#1 2009-08-20 09:13:32

Andrwe
Member
From: Leipzig/Germany
Registered: 2009-06-17
Posts: 322
Website

vim-like urxvt

Hi all,
I've an interesting question:

Does anyone of you have a urxvt which works like vim??

I have and I don't know why.
Means I can use all vim keybindungs in my urxvt and they behave also like in vim but the v this key opens a file in vim.

To activate it I just have to press "home" or "end".

So does anyone maybe know how I may got this behavior?

Last edited by Andrwe (2009-08-20 09:13:46)

Offline

#2 2009-08-20 09:54:59

davvil
Member
Registered: 2008-05-06
Posts: 165

Re: vim-like urxvt

Is your urxvt or your shell working like vim? Both bash and zsh (and probably others) have two basic modes of operation, vi mode and emacs mode (e.g. for zsh look at the keymaps section in the man page). I expect the "home" and "end" keys send an escape sequence that activates the vi command mode in your shell.

Btw. I use a mixture of vi command mode and emacs insert mode, and I find this quite efficient (using zsh).

Offline

#3 2009-08-20 12:57:18

Andrwe
Member
From: Leipzig/Germany
Registered: 2009-06-17
Posts: 322
Website

Re: vim-like urxvt

I'm using bash.
Where is the mode of operations set?

Offline

#4 2009-08-20 13:11:38

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: vim-like urxvt

In your .bashrc, add "set -o vi"


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#5 2009-08-20 13:11:47

majiq
Member
Registered: 2009-03-06
Posts: 259

Re: vim-like urxvt

While running the shell (or in your bashrc or zshrc or tshrc or etc.)

set -o vi #Sets to vi style keybindings
set -o emacs #Sets to emacs style keybindings

The keybinding used are the ones in the .inputrc or the global /etc/inputrc, so you can customize it if you want. You could man bash and readline for more info.

Offline

#6 2009-08-20 13:12:24

majiq
Member
Registered: 2009-03-06
Posts: 259

Re: vim-like urxvt

Oooh, beat by eleven seconds. The time it took me to check if there was a man inputrc. :-(

Offline

#7 2009-08-20 13:17:46

Andrwe
Member
From: Leipzig/Germany
Registered: 2009-06-17
Posts: 322
Website

Re: vim-like urxvt

majiq wrote:

Oooh, beat by eleven seconds. The time it took me to check if there was a man inputrc. :-(

lol

And is it possible to remove such a setting on the fly?

Offline

#8 2009-08-20 13:23:23

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: vim-like urxvt

Yes, you could type the "set" command in a session, or bind it to a key as majiq was saying. Maybe it's bound by default. Check "man readline" not "man inputrc". It says, in emacs mode type alt-control-j or alt-control-m (I guess, basically, alt-return) to go to vi mode (you must have done this at some point), in vi mode type control-e to go back to emacs mode.

Last edited by Profjim (2009-08-20 13:24:50)

Offline

#9 2009-08-20 13:51:42

Andrwe
Member
From: Leipzig/Germany
Registered: 2009-06-17
Posts: 322
Website

Re: vim-like urxvt

Thank to you all I'll start understanding why my shell have this behavior and I'm liking it more and more.:D

So thank you very much.

Offline

#10 2009-08-22 16:44:01

djszapi
Member
From: Cambridge, United Kingdom
Registered: 2009-06-14
Posts: 1,439
Website

Re: vim-like urxvt

Thanks too.

Offline

Board footer

Powered by FluxBB