Friday, November 8, 2013

Re: Bash's vi command line editing mode

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.

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

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


Best regards,
Tony.
--
"Wouldn't it be terrible if I quoted some reliable
statistics which prove that more people are driven
insane through religious hysteria than by drinking."
[W. C. Fields]

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

Post a Comment