Oftentimes, after importing your .dotfiles
(including your Neovim configuration files) to a new machine, installing your Neovim plugins using :PlugInstall
(if you're on vim-plug
) isn't ideal. This is mainly because of all the error messages that you would have to skip through before you're even able to run the install command.
This can be circumvented by doing the following:
nvim -u .dotfiles/.config/nvim/plugins.vim --headless +"PlugInstall" +"qall"
Here, .dotfiles/.config/nvim/plugins.vim
is the file where you define your plugins within the set of function calls provided by your plugin manager (plug#begin()
and plug#end()
on vim-plug
). Running nvim
with the --headless
flag will prevent the error messages that you would otherwise get.
If you have plugins with some post-installation hooks, you can continue by specifying them with the +
flag, like below:
nvim -u .dotfiles/.config/nvim/plugins.vim --headless +"TSUpdate" +"call nvim_ghost#installer#install()" +"qall"
(cd ~/.vim/plugged/telescope-fzf-native.nvim && make)
(sudo pacman -S go) # For Arch; Go is needed to compile Hexokinase
(cd ~/.vim/plugged/vim-hexokinase && make hexokinase)
For example, in here, since I use nvim-treesitter
, I'd want to install all its available parsers. I also use telescope-fzf-native.nvim
and vim-hexokinase
, both of which needs some extra post-installation steps to make them work. In the above code, I put some commands in a subshell so that the cd
commands doesn't get carried over to the next commands.