I recently installed vim-go from github via this command:
git clone https://github.com/fatih/vim-go.git ~/.vim/pack/plugins/start/vim-go
and it all worked.
But I want to see the line numbers and do some stuff in the "global" vimrc file.
So I added ~/.vim/vimrc and the options also work.
But now I can't use commands like :GoRun anymore ("No command"). If I remove the vimrc, it works again...
Recent versions of Vim source a script at startup when you don't have a
vimrcso that new or casual users get a slightly richer out-of-the-box experience. This is a laudable idea on paper but it broke a lot of things and caused the very issue you are having for a lot of people.Case in point, filetype-specific plugins like vim-go rely on filetype detection being enabled. This is done by the script I mentioned above but you are on your own when you decide to create your own
vimrc: the script in question is not sourced, so filetype detection is disabled by default, so filetype-specific plugins like vim-go don't work.You can handle the situation in two ways:
source that script from your
vimrc, as mentioned in:help defaults.vim:take full control of your config by adding what you need to your
vimrc, as you need it:I would go with the second solution.