vim-colors-solarized
vim-colors-solarized copied to clipboard
ToggleBG not defined
I've installed vim-colors-solarized commit 528a59f26d on vim 7.3 using pathogen. When trying to use :ToggleBG or the Toggle Background menu item from menu Solarized -> Background in mvim I get
E492: Not an editor command: ToggleBG
The error happens using vim in terminal as well.
I see togglebg.vim is in vim-colors-solarized/autoload/ but seems it's not loaded. I've tried moving it to ~/.vim/autoload/ but got the same result.
Is this an issue with my configuration or in the plugin?
I also have this problem. Running Vim 7.3 on Archlinux. UPD: I add this line to my .vimrc and now F5 works good so ~/.vim/bundle/vim-colors-solarized/autoload/togglebg.vim
And you are using pathogen as well.
Turns out that "autoload" vim isn't loaded at start time but on demand when a function defined in the script is needed, so we either :so ~/.vim/bundle/vim-colors-solarized/autoload/togglebg.vim or :call togglebg#map("<F5>").
This issue hence became the request to clarify Toggle Background Function paragraph in README.mkd file to state that one of the two actions has to be taken. The paragraph currently seems to imply that ToggleBG would automatically bind to F5 at start and that user should only call it explicitly if the key isn't available.
So I put call togglebg#map("") instead of so ~/.vim/bundle/vim-colors-solarized/autoload/togglebg.vim and everything's work fine. Thank you!)
I experienced this issue after installing with pathogen as described by others. I also was able to solve the problem by including call togglebg#map("")
in my .vimrc
. I agree the current README is misleading. Thank you anddam and yuriihabrusiev!
moving togglebg.vim
to ~/.vim/autoload/
and it work..
@ssiano provides more details on the issue here.