Is there a command in vim to undo the last command line operation?

  question, vim

In vim (I used gVim under Windows), we know that U is the command to revoke the last editing operation. Is there any command to revoke the last command line operation? For example, after I type: set list, I want to cancel the operation directly. Without entering: set nolist, are there other more direct shortcut keys and commands?

If you want to ask the key mapping, it is not, but the specific example you give can be changed.:set list!To switch the state of the switch, in fact, most vim options can be switched in this way, so you can also map the commonly used keys, which will be much more convenient. Tim Pope wrote a plug-in that seems to be called unimpaired. This plug-in maps many of these switching commands in advance for you, which is very helpful to improve efficiency.