![]() I use tpope's vim-unpaired which advertises itself as "Pairs of handy bracket mappings" but it also provides many toggles that use a yo_ mapping. Note that this uses in addition to your and this is required since we're using printf. I'll use your sz mapping here: nnoremap sz printf(":set bg=%s \| colo %s\r", &bg =# 'dark' ? 'light' : 'dark', &bg =# 'dark' ? 'modest' : 'moonfly') This mapping toggles both the background to light or dark, and the colorscheme, using printf. First, using your mapping, then a specific mapping pattern I use to mirror another popular plugin with many provided toggles. Here's an alternative two parter answer, that toggles both the colorscheme and the background. I must have exhausted nearly all possibilities, but the problem is still not going away.Īny suggestion is very welcome. in the if else endif clause then the background stops toggling between dark/ light. While if colorscheme solarized is executed directly after set background=. So I remove from ~/.vimrc call togglebg#map("") and replaced it with what most google/superuser/vim.wikia commentators, in various flavors, have suggested with the following: function! BgToggleSol()īut this has the same problem (that toggling resets colorscheme to default). ![]() For this purpose :help solarized (in vim) suggests to use: call togglebg#map("")īut this doesn't work because it changes the colorscheme from solarized to default (my intention was to toggle only in solarized between dark and light). I'm trying to map in ~/.vimrc background toggling. My general settings in ~/.vimrc are: Plug 'altercation/vim-colors-solarized' "I use plug.vim I have setup solarized to work on vim and it can manually toggle between background light/ dark. Both background and colorscheme in ~/.vimrc are badly misbehaving! ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |