Last updated: Apr 4, 2024
Reading time·3 min

The error "'vim' is not recognized as an internal or external command,
operable program or batch file" occurs when we use the vim command without
having vim installed or added to the PATH environment variable.
To solve the error, install vim and make sure it's correctly configured.





vimrc settings selected and click
"Next".
vim will be
installed and click "Install".
Close your CMD (Command Prompt) shell and reopen it.
Try running the vim command.
vim example.txt

You can press i to enter insert mode and start typing.
Once you're done, press Esc and type :wq (write, quit) to save the changes
and exit.

vim to your PATH environment variable.


If you don't see the PATH to vim in the list, e.g.
C:\Program Files (x86)\Vim\vim90, click on "New" and then "Browse".
Note that your version of vim might be different, so unless you know the
path, use the "Browse" function.
We have to locate the directory that contains the executable file, e.g.
vim.exe.

Note that your version of vim might be different, e.g. Vim95.
Click "OK" twice to confirm adding the path.
Close your Command prompt application and then reopen it.
You might also have to restart your PC, but that's not always necessary.
Now you should be able to run the vim command.
vim example.txt

You can press i to enter insert mode and start typing.
Once you're done, press Esc and type :wq (write, quit) to save the changes
and exit.

I've also written an article on:
You can learn more about the related topics by checking out the following tutorials: