Windows系统下如何完全重置Vim?
Glad you're making the switch to Vim! Resetting it fully to start fresh is pretty straightforward—you just need to locate and remove the key files/folders where Vim stores its settings, history, and plugins. Here's how to do it across different operating systems:
Windows
On Windows, Vim keeps its user-specific data in a few key spots:
- Custom assets folder:
%USERPROFILE%\.vim(holds plugins, syntax files, colorschemes, and other added resources) - Main config file:
%USERPROFILE%\_vimrc(your personal Vim settings and custom commands) - Session/history file:
%USERPROFILE%\_viminfo(stores command history, search history, marks, and session state)
To reset completely:
- Close all running instances of Vim (make sure none are hiding in the background).
- Open File Explorer, paste
%USERPROFILE%into the address bar, and hit Enter. - Delete the following items:
- The
.vimfolder - The
_vimrcfile - The
_viminfofile
- The
- (Optional) If you ever modified the system-wide config, check your Vim installation directory (usually
C:\Program Files\Vim) for avimrcfile—delete it only if you want to wipe system-level settings too (most users only need to touch user-specific files).
macOS & Linux
On Unix-like systems, Vim's user data lives directly in your home directory:
- Custom assets folder:
~/.vim(plugins, custom scripts, and themes live here) - Main config file:
~/.vimrc(your core Vim configuration) - Session/history file:
~/.viminfo(tracks command history, marks, and session data) - GUI config (optional):
~/.gvimrc(if you use GVim, this stores GUI-specific settings)
To reset completely:
- Quit all running instances of Vim or GVim.
- Open your terminal and run these commands to delete the key files/folders:
rm -rf ~/.vim rm ~/.vimrc rm ~/.viminfo rm ~/.gvimrc # Only run this if you use GVim - (Optional) For system-wide resets, check
/etc/vim/vimrcor/usr/share/vim/vimrc—but be cautious with system files; most users only need to remove user-specific files for a fresh start.
Quick Post-Reset Note
Once you delete these files, the next time you launch Vim, it will start with a completely default state—no custom settings, plugins, or history. If you want to rebuild your config later, running :help vimrc in Vim will guide you through creating a new configuration file.
内容的提问来源于stack exchange,提问作者user15437779

