John Montgomery
John Montgomery

Reputation: 1

How to use a hyphen as the second character of a Vim-Plug plugin

In my init.vim file, I'm trying to load my default .vimrc from a github repo (so that I can load the same customization file from anywhere). However, the second character of my github username is a hyphen and when I try to include it in the string to source it as a pluggin, the syntax highlighting makes it seem like it escapes the string (this doesn't appear to be the case for echo so it seems related to the Plug command perhaps).

set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath

call plug#begin(stdpath('config') . '/plugged')
Plug 'j-ace-svg/vimrc.vim'
call plug#end()

If I ignore it as messed up syntax highlighting and still try to run it, it doesn't register the Plugin. If I try to escape it it still doesn't register the Plugin, and using double quotes doesn't work because it's registered as a comment (see here). Is something wrong in the way I'm trying to load the plugin?

Edit: After completely reinstalling my WSL Ubuntu (where I'm running neovim), I copied this back into my init.vim and it appears to work, the syntax highlighting is still weird but it correctly installed my vimrc and then the rest of my plugins from there

Edit 2: The same problem reappeared, and it turns out it's due to the fact that I was loading plugins in two locations (my init.vim and my .vimrc) so the init.vim plugin list was getting overridden, hence my .vimrc not appearing in my plugin list.

Upvotes: 0

Views: 114

Answers (1)

John Montgomery
John Montgomery

Reputation: 1

I was loading plugins both in my init.vim and in my .vimrc, which I loaded as a plugin, so the plugin list in my init.vim was getting overridden. The fix was to have a git repo with my .vimrc—which I had anyways since I had to edit it—and then source that .vimrc file from my init.vim, rather than loading it as a plugin.

Upvotes: 0

Related Questions