brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: vim --clean starts Vim without your vimrc and plugins

Vim
~/tips/tip-vim-clean-flag

vim --clean file.txt

Starts Vim with default settings and no personal config, to find out whether your setup causes a problem.

When Vim does something odd, the first question is whether the fault is in Vim or in my own setup. Commenting out lines in a vimrc one at a time is the slow way to find out.

vim --clean file.txt

The --clean argument is documented as similar to -u DEFAULTS -U NONE -i NONE. Your vimrc and the files and environment variables Vim would normally read at startup are skipped, runtimepath and packpath leave out your home directory, and no viminfo file is used. Vim runs with its stock defaults, so you see what a fresh install does.

If the problem is gone, it came from your config. Start Vim normally again and bisect: disable half of your plugins, test, and repeat. If the problem is still there, it isn’t your setup, and a bug report or a search becomes more useful. A report that says it happens with vim --clean is also much easier for a maintainer to reproduce.

A caveat: your colors, key mappings and settings are all missing, so the editor will feel strange. You also can’t test anything that needs a plugin. If you only want to skip plugins and keep your vimrc, --noplugin does that.

Further reading: Vim help: starting, –clean

Going deeper: Guide: advanced tmux, a config that grows with you, formats, layouts and more

More Vim tips :%s/<Ctrl-r><Ctrl-w>/newname/g /oldname find . -name "*.conf" | vim – :set textwidth=72 :mksession All Vim tips (45) All topics

Link