LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   bash question (https://www.linuxquestions.org/questions/linux-newbie-8/bash-question-282557/)

gsgleason 01-26-2005 03:20 PM

bash question
 
greetings all. I am running a machine with slack 10. here's what I want to do..

At work I use a sun solaris system, using ksh, and it's set up so when I press esc, I can use vi commands to go through my history (k and j to go up and down, etc, using standard vi commands)

I can't seem to get this to work on my linux server. I'm using bash. I can switch to ksh if need be - no big deal.

I imagine I have to set it up in my .bash_profile or .bashrc

help?

Tinkster 01-26-2005 03:26 PM

By default bash uses emacs style key-bindings.

If you want to use vi style you just need to ... :)
Code:

man bash
/ vi

Note: in the code bit there's a SPACE before and
behind the vi ;)


Cheers,
Tink

gsgleason 01-26-2005 03:43 PM

dude the man page for bash is huge and cryptic. it's not making sense to me.

it looks like I have to specify something +o vi but I'm not sure where.

stanleyg76 01-26-2005 03:44 PM

# this gets you in vi mode
% set -o vi
# this gets you in emacs mode
% set -o emacs

gsgleason 01-26-2005 03:55 PM

found it I think

set -o vi

I'll put that in my profile

Tinkster 01-26-2005 04:52 PM

Quote:

Originally posted by gsgleason
dude the man page for bash is huge and cryptic. it's not making sense to me.

Which is why I provided you with a code snippet
that would search for vi in the man-page ... oh well,
never mind ;)


Cheers,
Tink


All times are GMT -5. The time now is 08:24 AM.