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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-13-2010, 11:55 PM
|
#1
|
|
LQ Newbie
Registered: Sep 2005
Location: California
Distribution: Ubuntu
Posts: 17
Rep:
|
Bash vi mode not working perfect
Hey guys,
I am trying to use bash vi mode by issuing "set -o vi" but I am facing two issues; first many of the vi commands are not working and second once I am in the command mode by pressing the Esc key just after I press a single button (e.g., b to go back a word) the mode changes to the normal insert mode. I'm wondering whether there is a way around these two problems.
Thanks
-Hamid
|
|
|
|
08-14-2010, 12:15 AM
|
#2
|
|
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,903
|
Your first problem is somewhat nondescript shall I say.
Which vi commands aren't working?
Re the 2nd issue: My bash *doesn't* exit vi command mode
after the first command; it stays in command mode until I
press i,a, ... some editing command. Maybe you're using
odd keybindings?
Cheers,
Tink
|
|
|
1 members found this post helpful.
|
08-14-2010, 02:56 AM
|
#3
|
|
Member
Registered: Jul 2010
Location: India
Distribution: RHEL, Ubuntu
Posts: 35
Rep: 
|
Hi hhamid,
Why you not use vim? it is advance version of vi.
regard,
|
|
|
0 members found this post helpful.
|
08-14-2010, 05:02 AM
|
#4
|
|
Guru
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019
Rep: 
|
Vi is vim on Ubuntu.
|
|
|
0 members found this post helpful.
|
08-14-2010, 05:35 AM
|
#5
|
|
Member
Registered: May 2007
Posts: 555
Rep:
|
vi vim
you could try a different editor and see if the same thing happens.
|
|
|
0 members found this post helpful.
|
08-14-2010, 05:41 AM
|
#6
|
|
Member
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638
Rep: 
|
there is no package called vi in ubuntu.
vim-tiny is a compact version installed by default.
|
|
|
0 members found this post helpful.
|
08-14-2010, 05:46 AM
|
#7
|
|
Member
Registered: Jul 2010
Location: India
Distribution: RHEL, Ubuntu
Posts: 35
Rep: 
|
my apologize..
thanks jay73 and sem007
|
|
|
0 members found this post helpful.
|
08-14-2010, 01:16 PM
|
#8
|
|
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,903
|
Did ANY of you guys actually READ his question? He's trying to use line-editing in
bash in vi-mode, rather than in bash's default, emacs mode.
Cheers,
Tink
|
|
|
1 members found this post helpful.
|
08-14-2010, 01:22 PM
|
#9
|
|
Guru
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019
Rep: 
|
Yes, I did. I have actually tried it out on my box and I haven't experienced any problems so it's probably a matter of configuration.
Last edited by jay73; 08-14-2010 at 01:23 PM.
|
|
|
0 members found this post helpful.
|
08-15-2010, 07:31 AM
|
#10
|
|
LQ 5k Club
Registered: Sep 2009
Distribution: Arch x86_64
Posts: 6,443
|
Quote:
Originally Posted by babunix
Hi hhamid,
Why you not use vim? it is advance version of vi.
regard,
|
He is NOT using vi or vim!
He is using bash's vi input mode which lets you type commands as it it were a vi editor.
|
|
|
1 members found this post helpful.
|
08-16-2010, 02:56 AM
|
#11
|
|
LQ Newbie
Registered: Sep 2005
Location: California
Distribution: Ubuntu
Posts: 17
Original Poster
Rep:
|
Actually it's kinda weired. Playing more with it, it sounds like sometimes it works well and sometimes I have the mentioned problem. I'm not sure why that is. BTW, once I enter in the vi mode, how can I exit from this binding? I mean is there like an unset command or sth (what is it exactly)? Also what are the different keyboards bindings available besides the vim and emacs? Does anyone have a good reference or link for these stuff?
Thanks
--Hamid
Quote:
Originally Posted by Tinkster
Your first problem is somewhat nondescript shall I say.
Which vi commands aren't working?
Re the 2nd issue: My bash *doesn't* exit vi command mode
after the first command; it stays in command mode until I
press i,a, ... some editing command. Maybe you're using
odd keybindings?
Cheers,
Tink
|
Last edited by hhamid; 08-16-2010 at 03:02 AM.
|
|
|
|
08-16-2010, 03:16 AM
|
#12
|
|
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,903
|
The bash man-page basically has it all. There's only emacs (the default)
and vi mode; to get from vi back to emacs, just use 'set -o emacs'.
Cheers,
Tink
P.S.: Please, don't "top post". It's a pointless and ugly habit in
e-Mail, but on a forum even more so.
|
|
|
1 members found this post helpful.
|
08-16-2010, 03:27 AM
|
#13
|
|
LQ Newbie
Registered: Sep 2005
Location: California
Distribution: Ubuntu
Posts: 17
Original Poster
Rep:
|
Tinkster,
Thanks for the useful info.
BTW as for doing top post, if you're referring to quoting by that I don't see why you think it is pointless and even ugly. Especially in a thread like this where there are multiple posts from different people, it would make it really easy to follow whom and what you're responding to. Ofcourse, you could always refer to people by their names as an alternative but what if there are many posts over multiple pages. And also again in that case whoever is following the thread would need to go back and forth between different posts which would make it kinda hard to follow. So, I really think quoting is actually beneficial....
PS: Not quoting this post as you requested though! :P
Thanks
--Hamid
|
|
|
|
08-16-2010, 03:31 AM
|
#14
|
|
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,903
|
Quote:
Originally Posted by hhamid
Tinkster,
So, I really think quoting is actually beneficial....
|
So do I. Quoting the whole post AFTER/UNDER the response
is what's pointless. And ugly. And wasteful. ;}
Code:
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
Cheers,
Tink
|
|
|
|
08-16-2010, 03:36 AM
|
#15
|
|
LQ Newbie
Registered: Sep 2005
Location: California
Distribution: Ubuntu
Posts: 17
Original Poster
Rep:
|
Quote:
Originally Posted by Tinkster
So do I. Quoting the whole post AFTER/UNDER the response
is what's pointless. And ugly. And wasteful. ;}
Cheers,
Tink
|
This makes sense and I completely agree with! :-)
--Hamid
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:59 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|