LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   change up arrow behavior with bash history (https://www.linuxquestions.org/questions/linux-software-2/change-up-arrow-behavior-with-bash-history-520242/)

galle 01-18-2007 10:10 AM

Well I can definitely relate to "vi culture shock". I've tried it a couple of times, but never had the patience to actually learn it. Usually I'm a fan of shortcuts, but I guess I'm happy enough with kedit or something...

Quote:

You need two hands to type a single character (/)?
'&' is also a single character, don't you need two keys for that one on the english keyboard? On the norwegian keyboard you press shift-7 to get '/'.

nx5000 01-18-2007 10:22 AM

Quote:

Originally Posted by galle
Well I can definitely relate to "vi culture shock". I've tried it a couple of times, but never had the patience to actually learn it. Usually I'm a fan of shortcuts, but I guess I'm happy enough with kedit or something...

Wait to have a system crash and no more xwindow, you will realize how practical vi is ;)
Quote:

'&' is also a single character, don't you need two keys for that one on the english keyboard? On the norwegian keyboard you press shift-7 to get '/'.
Same on a german keyboard.

MensaWater 01-18-2007 10:23 AM

Point taken on the &. I did allow for the possibility other keyboards wouldn't make a / natively. Only God knows what I'd have to do to type "ø". :D

galle 01-18-2007 10:33 AM

Quote:

Wait to have a system crash and no more xwindow, you will realize how practical vi is
I know, I know... Luckily it hasn't happened very often so far :)

MensaWater 01-18-2007 10:36 AM

I think in a system crash the least of my worries will be which editor I'm using.

nx5000 01-18-2007 10:40 AM

Quote:

Originally Posted by jlightner
I think in a system crash the least of my worries will be which editor I'm using.

Well, with no Xwindow, the choice is easily done :)

cfaj 01-18-2007 01:36 PM

Quote:

Originally Posted by nx5000
Well, with no Xwindow, the choice is easily done :)

Indeed; emacs works perfectly without X.

Sometimes, rather than use vi, I've edited files with sed or awk.

cfaj 01-18-2007 01:39 PM

Quote:

Originally Posted by galle
Is it possible to change how up arrow works in bash? I would like to be able to browse through the bash history with the up arrow like it is now, but in addition to that, if I've started writing something, I would like it to only browse through the commands which start with the same letters. (If anyone is familiar with the command line interface in Matlab, that's the behavior I'm looking for).

Is this already implement somewhere, or can I make my own script somehow?

Cheers


Put the following in ~/.inputrc:

"\e[A": history-search-backward ## up-arrow
"\e[B": history-search-forward ## down-arrow

Check that those are the correct key sequences for your terminal by pressing Ctrl-v then an arrow key.

nx5000 01-18-2007 03:46 PM

I love these people who repeat exactly stuff that's already been said...


All times are GMT -5. The time now is 04:59 PM.