How to disable a built-in command in vim
问题 In vim, when I hit :wq it is almost always an accident that occurred when attempting to input :w . I would like to disable :wq . The closest I found is cmap , but it has some odd behavior. If I do something like :cmap wq w I can no longer even input :wq ; it just remaps the keystroke sequence wq to w in command mode. Now I cannot, for example, input a search/replace command on a string containing wq . I would just like to alias the exact command :wq to :w or a no-op. Is there a way to do this