Tuesday, March 27, 2012

Re: Bash's vi command line editing mode

Hi Chip,
   Sorry for not being clear. I typed in a command from the bash shell, then launched vim by doing the <Esc> and v, which resulted in the command being put into vim. This is the part where I got stuck, because
it seemed like no matter what I did (:wq or :q!) it still executed the command when I exited vim.
   The solution was :cq, or alternatively, delete the command in the vim editor, but then rather than doing :q!, run :wq, so the blank command gets executed by Bash. 
   In my post I also tried to answer the questions some people were asking about why I couldn't do this 
directly on the command line, using the "set -o vi", and I was trying to explain how the vim editor (as opposed to the command line) gives you full access to all of vim's features (registers), whereas Bash's vi editing mode only allows for a small subset.  That and the fact that due to my own clumsiness, I accidentally find myself hitting <Esc> v and entering the vim editor sometimes when I don't want to.

Thanks,
Ven

On Tue, Mar 27, 2012 at 12:27 PM, Charles Campbell <Charles.E.Campbell@nasa.gov> wrote:

I'm afraid that I've looked over the OP's first two messages and don't see where vim was launched, though:

Title:  Bash's vi command line editing mode
Excerpt: ...but when I do the "set -o vi" in the bash command line shell,...
Excerpt: ...if I hit <Esc> and v on the command line, it goes into vi editing mode...
Excerpt: ...when I exit the editor it runs the command...  (when one exits Vim, typically it doesn't cause any commands to run)

Regards,
Chip Campbell



--

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment