vim-colors-solarized icon indicating copy to clipboard operation
vim-colors-solarized copied to clipboard

ToggleBG not defined

Open anddam opened this issue 12 years ago • 6 comments

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?

anddam avatar Mar 05 '12 11:03 anddam

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

yuriihabrusiev avatar Mar 23 '12 08:03 yuriihabrusiev

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.

anddam avatar Mar 23 '12 12:03 anddam

So I put call togglebg#map("") instead of so ~/.vim/bundle/vim-colors-solarized/autoload/togglebg.vim and everything's work fine. Thank you!)

yuriihabrusiev avatar Mar 26 '12 06:03 yuriihabrusiev

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!

areinisc avatar Jul 14 '15 22:07 areinisc

moving togglebg.vim to ~/.vim/autoload/ and it work..

redfish-lee avatar Jul 13 '17 18:07 redfish-lee

@ssiano provides more details on the issue here.

polyzen avatar Dec 03 '17 23:12 polyzen