VIM 我现在禁用了箭头键,如何浏览之前的命令?
我禁用了箭头键,我很高兴我这么做了,仅仅几天没有它们,我几乎没有想念它们,直到我发现我可以输入“:<向上>”或“:<向下>”并浏览我之前的命令。但既然我禁用了它们,我该如何导航这些命令呢?我们不能使用普通的 hjkl..
I disabled my arrow keys and I am glad I did, just couple of days without them and I hardly miss them, until I discovered that I can type ": < UP > " or ":< DOWN >" and navigate through my previous commands. But now that I disabled them, how do I navigate my those commands? we can't use plain hjkl..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
draevor 几乎这么称呼它,但我想建议使用 control-F。
您可以输入:,然后输入control-F,以获取与q:相同的历史记录。
我喜欢它,因为你也可以将它用于搜索历史记录:/,然后 control-F 或......类似地,q/ >。
我更喜欢 / 或 : 因为通常我想在命令模式下进行搜索或其他操作,然后意识到,“哦,是的,我不是已经这样做过一次了吗? ?” Control-F 来救援!
draevor pretty much called it, but I'd like to suggest control-F.
You can type : followed by control-F to get to the same history that q: gets you too.
I like it b/c you can use it for search history too: / and then control-F or....similarly, q/.
I prefer the / or : because generally I want to do a search or or something in command mode and then realize, "Oh yeah, didn't I already do this once?" Control-F to the rescue!
如果您只想要一个命令,请尝试输入 q: (您可以滚动该列表并查看常见的命令)。如果您确实使用历史记录,您可以在此页面上找到更多详细信息: http://vim .wikia.com/wiki/Using_command-line_history
If you just want one command try typing q: (you can scroll that list with the usual suspects). If you are really using the history, you can find many more details on this page: http://vim.wikia.com/wiki/Using_command-line_history
您可以使用
CTRL+p
在命令历史记录中后退(“向上”),使用CTRL+n
在命令历史记录中前进(“向下”)。如果您想向左和向右移动 - 没有箭头键就无法完成,因此您必须使用q:
来编辑命令历史记录缓冲区。You can use
CTRL+p
to go back("up") in the command history, andCTRL+n
to go forward("down") in the command history. If you want to go left and right - that can't be done without the arrow keys, so you'll have to useq:
to edit the command history buffer.我在我的 vimrc 中使用这个:
如果你这样做,你仍然可以让箭头在“命令模式”下工作。
I use this in my vimrc:
If you do this way you'll still have arrows working in "command mode".