What is the easiest way to find all the settings in your .vimrc/init.vim that are already default?

Viewed 334

In neovim (and sometimes even in vim) some default settings change occasionally. I'd like to keep my .vimrc and init.vim tidy and remove the settings which are already the default. Is there an easy way to find those superfluous options?

An example, in neovim they recently enabled hidden by default, so I can remove it now from init.vim. But there's more options and they are changing over time too, so keeping track of them manually is cumbersome and error prone. I'm looking for a command or so that lists all the options which are not needed anymore.

1 Answers

The command :set without parameters displays all settings that are changed.

Put them into buffer (e.g. "=execute("set!")<CR>p) and compare with your vimrc.

In neovim you have to use "=execute("set")<CR>p (i.e. without exclamation mark) instead.

Related