Friday, November 8, 2013

Re: Bash's vi command line editing mode

On 2013-11-08, Tony Mechelynck wrote:
> On 07/11/13 12:58, Gilles Ruppert wrote:
> >I'm having the opposite problem:
> >
> >I use vi mode with bash on OSX (10.9). As expected, <esc> v puts
> >the current command into a buffer. However, when I :wq, the
> >command is *not* executed.
> >
> >Could there be a setting in .vimrc that causes this?
> >
> I tried ESC v in bash, and to my surprise, the command-line was
> opened in Vim as a file in /tmp/ with a name starting with
> "bash-fc-". My .vimrc had been run, and in particular my colorscheme
> was set. After :wq or even after :q! bash tried to execute the
> command (and complained, because it was a nonsense command). However,
> the command which bash tried to execute was the *unmodified*
> command-line, not the result of any edits.

When I do that, bash executes the edited version of the command, as
it should.

> The following options (q.v.) set by my vimrc may be relevant:
> nobackup
> writebackup
> backupcopy=auto

nobackup
writebackup
backupcopy=yes

> Indeed, setting 'backupcopy' to "no" on entry into this Vim editor
> made edits to the command-line relevant (so that, e.g., after
> prefixing # to the line bash treated it as a comment and did not
> complain).
>
> Another thing that I notice is that on return from this Vim
> commnd-line editor, Bash finds itself (apparently) in vim-like
> "normal mode" so that letters typed at the keyboard in bash seem to
> have no effect until one of them is a or i. Then bash "starts working
> again".

Mine does that, too. Very annoying. I don't remember it ever not
doing that, though.

I used to use ksh on HP-UX and it did not have that problem--the
shell worked fine after an Esc-v edit.

Regards,
Gary

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: