gvim - Is there a command in vim to undo the last command line operation?
淡淡烟草味
淡淡烟草味 2017-05-16 16:36:35
0
2
973

In vim (I use gVim under Windows), we know that u is the command to undo the last editing operation. Is there a command to undo the last command line operation? For example, after I type: set list, I want to cancel the operation directly. Is there any other more direct shortcut keys and commands without typing: set nolist?

淡淡烟草味
淡淡烟草味

reply all(2)
Peter_Zhu

If you want to ask about key mapping, there is really no key mapping. However, in the specific example you gave, you can use :set list! to switch the switch state. In fact, most vim options can be switched in this way, so you can also use commonly used keys. mapped to the keys, which will be much more convenient. Tim Pope has written a plug-in called unimpaired. This plug-in pre-maps many of these switching commands for you, which is very helpful to improve efficiency.

阿神

To be more prepared, u is to undo the last modification operation. The so-called modification operation refers to changing the text, including the text content and text position.

On this basis, such as :s replacement operation and command line operation, the text has been changed, so :s替换操作, 命令行操作, 改变文本了, 所以ucan be restored.

But :set是设置编辑器特性, 并不属于修改操作, 不改变文本, 所以u is setting editor features, it is not a modification operation and does not change the text, so

does not work.

:setThere is no other shortcut for

, cancel the last recognition.🎜
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!