当前位置:  开发笔记 > 开发工具 > 正文

在哪里:命令历史存储?

如何解决《在哪里:命令历史存储?》经验,为你挑选了2个好方法。

我想知道:为特定的vim会话存储命令历史记录的位置.我知道我们可以滚动并搜索历史记录.我的目标是使用反复试验来执行我执行的部分命令,并创建一个vim源文件.



1> Arkaitz Jime..:

它存储在$ HOME/.viminfo中

从vim help命令:

The viminfo file is used to store:
- The command line history.
- The search string history.
- The input-line history.
- Contents of registers.
- Marks for several files.
- File marks, pointing to locations in files.
- Last search/substitute pattern (for 'n' and '&').
- The buffer list.
- Global variables.



2> rampion..:

您还可以使用q::命令在迷你缓冲区中打开最近的命令历史记录

 OPEN

 There are two ways to open the command-line window:
 1. From Command-line mode, use the key specified with the 'cedit' option.
    The default is CTRL-F when 'compatible' is not set.
 2. From Normal mode, use the "q:", "q/" or "q?" command.  *q:* *q/* *q?*
    This starts editing an Ex command-line ("q:") or search string ("q/" or
    "q?").  Note that this is not possible while recording is in progress (the
    "q" stops recording then).

 When the window opens it is filled with the command-line history.  The last
 line contains the command as typed so far.  The left column will show a
 character that indicates the type of command-line being edited, see
 |cmdwin-char|.

您可以在此窗口中移动,并像普通缓冲区一样进行复制.点击命令将执行它.

推荐阅读
pan2502851807
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有