Closed chusiang closed 8 years ago
@nylon7 提到 Vim 裡有查詢歷使記錄的功能,survey 後得知是 history 的功能。
想問個簡單的問題,我記得vim可以用之前打過的紀錄 例如 我進入某個.c 然後我用:grep -nr --color hello 應該可以在重複叫出之前打過的? 不用再重打一次
想問個簡單的問題,我記得vim可以用之前打過的紀錄
例如
我進入某個.c
然後我用:grep -nr --color hello 應該可以在重複叫出之前打過的? 不用再重打一次
在 normal mode 裡按下 q: 即可開啟小視窗 (command window),並用 h, j 上下選擇要執行的項目後再按下 Enter (或 <C-m>)。
q:
h
j
Enter
<C-m>
q/
q?
最後附上 history in vim 的操作錄影。
@nylon7 提到 Vim 裡有查詢歷使記錄的功能,survey 後得知是 history 的功能。
在 normal mode 裡按下
q:
即可開啟小視窗 (command window),並用h
,j
上下選擇要執行的項目後再按下Enter
(或<C-m>
)。q:
: last command.q/
: last search.q?
: last search backward.最後附上 history in vim 的操作錄影。
Reference