你如何搜索 Vim 的命令历史? [英] How do you search through Vim's command history?

查看:52
本文介绍了你如何搜索 Vim 的命令历史?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我也想在 Vim 中进行以下搜索

I would like to have the following search in Vim too

(reverse-i-search)`':

输入你之前命令的一个词,你会得到完整的命令.

Enter a word of your previous command, and you get the full command.

我知道 Vim 中的时间顺序历史工具

I know the chronological history tool in Vim

q:

然而,它不如模糊反向搜索有用.

However, it is not that useful as the fuzzy reverse search.

如何在 Vim 中进行与终端中类似的反向搜索?

推荐答案

输入上一个命令的第一个字母并按 <向上>箭头(或 Ctrl+p).

Enter the first letters of your previous command and push <Up> arrow (or Ctrl+p).

:set li<up>
:set lines=75

不要忘记检查历史选项并将其设置为足够大的值

Don't forget to check history option and set it to big enough value

:set history=1000

这篇关于你如何搜索 Vim 的命令历史?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆