Re: VIM, History and Readline.
- On 2005-08-02, Ayoub890 <ayoub890@...> wrote:
> Hi,From the shell, the fc command will open a $VISUAL or $EDITOR window
> I want to use readline in vi mode but support for vi appears to be
> rather limited. It has better support for emacs and I do not want to go
> back to using emacs.
> Because of its limited support for vi, I want to try and circumvent the
> readline and open the command history file directly with VIM. I am using
> several xwindows but my login directory has only one ".bash_history"
> file. The other history files are probably stored in temporary files.
> Can I open them with VIM and grab commands and edit them and thus not be
> limited by the inadequate readline support for vi?
> The silly and incomplete way of doing it is:
> $ history > temporaryfile
> $ vim temporaryfile
> Shell and Vim gurus can help here. We need Vim to pull the history file,
> allow editing/composing of a new command (in full screen mode, not just
> in line mode), exiting, issuing the new command to the shell CLI. Also,
> the history file must be updated with the new executed command. Does
> there exist a way of doing this?
(I forget which--I have both set to vi which really points to vim)
containing the last shell command you executed. You can then
to load the last n lines of command history into the vim buffer,
edit the buffer to get the command you want, then write the buffer
and quit vim and the shell will execute the command.
Gary Johnson | Agilent Technologies
garyjohn@... | Wireless Division
| Spokane, Washington, USA