small medium large xlarge

Back to: All Forums  Modern Vim
26 Nov 2017, 02:36
Thiago Araújo Silva (5 posts)

Hello Drew, I’m really enjoying the book so far. I’d like to suggest a simpler method of running vim/neovim with factory settings: vim -u NONE or nvim -u NONE

Is there a reason why the book suggests temporarily renaming the config file?

26 Nov 2017, 14:30
Drew Neil (45 posts)

Thanks for suggesting that. I used that technique in Practical Vim, but the requirements here are slightly more complex. The -u NONE flag causes Vim to load without a vimrc. That’s cool if you just want to run Vim with factory settings. But if you want to start with factory settings then apply customisations on top of those settings, you need to load a vimrc.

The technique that you suggest might work ok for tip 5 (Installing Plugins to Your Package). Although that tip suggests relaunching Vim after adding a plugin to your package, so in that context I’d have to remind the reader to use -u NONE again. I think that might be a bit distracting.

In tip 6 (Managing Plugins with minpac), we have to add call minpac#add() to the vimrc file to install plugins. In this context, you definitely need a vimrc file, so the technique that you suggest doesn’t help.

The technique that I suggest for using factory settings might seem a bit heavy-handed, but it should work in most circumstances. Some readers might have never installed a Vim plugin before, and in that case they might even be able to skip the steps to run with factory settings. Other readers might already be using a plugin manager such as vim-plug or pathogen, which could interfere with minpac with unpredictable results. Renaming ~/.vim to ~/.xvim is a sure way to give yourself a blank slate, and can easily be reversed again later.

Does that all make sense?

I’m really enjoying the book so far.

I’m pleased to hear that, thanks!

26 Nov 2017, 20:58
Thiago Araújo Silva (5 posts)

Yes, it totally makes sense. Thanks for the detailed answer.

You must be logged in to comment