LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 01-26-2005, 03:20 PM   #1
gsgleason
Member
 
Registered: Oct 2004
Posts: 69

Rep: Reputation: 15
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?
 
Old 01-26-2005, 03:26 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,004
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
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
 
Old 01-26-2005, 03:43 PM   #3
gsgleason
Member
 
Registered: Oct 2004
Posts: 69

Original Poster
Rep: Reputation: 15
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.
 
Old 01-26-2005, 03:44 PM   #4
stanleyg76
LQ Newbie
 
Registered: Dec 2004
Posts: 16

Rep: Reputation: 0
# this gets you in vi mode
% set -o vi
# this gets you in emacs mode
% set -o emacs
 
Old 01-26-2005, 03:55 PM   #5
gsgleason
Member
 
Registered: Oct 2004
Posts: 69

Original Poster
Rep: Reputation: 15
found it I think

set -o vi

I'll put that in my profile
 
Old 01-26-2005, 04:52 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,004
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A question about BASH operand Linux - Newbie 2 11-27-2005 10:49 PM
BASH question robscott Linux - Software 3 11-23-2005 10:39 AM
Bash question lnxduck Programming 3 09-30-2005 09:50 AM
bash question? shanenin Linux - Software 1 11-26-2004 01:22 PM
little bash question gplacek Linux - General 2 09-01-2004 01:10 PM


All times are GMT -5. The time now is 05:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration