The command :wd! is not a standard, built-in Vim command.
Let's break down why and what it might be if you encountered it:
: : This indicates an Ex command (a command-line command in Vim).
w: This is the standard "write" command in Vim. It's used to save the current buffer to a file.
d: When paired with w in a standard command, d isn't used. Common w commands are:
:w (write the current buffer)
:wq (write and quit)
:wa (write all modified buffers)
:w filename (write current buffer to filename)
!: This is the "force" or "override" modifier. When used with :w, it typically means:
:w! : Force writing the file, even if it's read-only.
:wq! : Force write and quit, ignoring unsaved changes in other buffers or read-only status.
What :wd! could mean if you saw it:
Since :wd! is not a standard command, it's almost certainly one of the following:
A Typo or Misremembered Command: The most likely scenario is that it's a typo for :wq! (write and quit forcefully) or :wa! (write all buffers forcefully).
A User-Defined Command (Alias/Function): Someone might have created a custom command or a mapping that defines :wd! to do something specific. This is done using the :command directive in a Vim configuration file (like ~/.vimrc). For example:
vim
command! WD wa
In this case, typing :WD (or :wd if the command! doesn't specify -nargs=0) would execute :wa. The ! would then modify the custom command.
A Command Provided by a Plugin: Some Vim plugins introduce their own custom commands. It's possible a specific plugin you or someone else is using defines :wd!.
How to check if it's a user-defined command:
If you are in Vim and suspect it might be a custom command, you can try:
vim
:verbose command WD
(Note: You might need to try WD, wd, or other case combinations). If it's a defined command, this will tell you where it was defined. If it says No such user-defined command: WD, then it's not a custom command in your current Vim setup.
In summary, :wd! is not a built-in Vim command; it's probably a typo or a custom definition.