我想知道:为特定的vim会话存储命令历史记录的位置.我知道我们可以滚动并搜索历史记录.我的目标是使用反复试验来执行我执行的部分命令,并创建一个vim源文件.
Ark*_*nez 17
它存储在$ 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.
Run Code Online (Sandbox Code Playgroud)
您还可以使用q:或:<CTRL-F>命令在迷你缓冲区中打开最近的命令历史记录
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|.
Run Code Online (Sandbox Code Playgroud)
您可以在此窗口中移动,并像普通缓冲区一样进行复制.点击<Enter>命令将执行它.