pinpox / base16-universal-manager

A universal manager to set base16 themes for any supported application
https://github.com/chriskempson/base16
MIT License
89 stars 20 forks source link

Wiki config updates: dunst,i3,foot,mako,rofi,shell,termite,xresources & update vim #48

Closed paul-ri closed 3 years ago

paul-ri commented 3 years ago

Hi, thanks for your program! I've migrated from base16-manager. Yours is much more flexible!

I've pushed some wiki updates on a fork of your wiki on https://github.com/paul-ri/base16-universal-manager/wiki/Configuration-examples

As stated in another issue, you can update with

git clone https://github.com/pinpox/base16-universal-manager.wiki
git pull https://github.com/paul-ri/base16-universal-manager.wiki.git
git push

The vim entry is a bit controversial as I found it wasn't so straightforward to make it work with the base16-vim plugin.

I hope that helps.

Happy to edit some bits if needed

Quitlox commented 3 years ago

I was also stumped by this, but I've found a cleaner way to get the vim configuration working.

First of all, you don't need the base16-vim plugin. The only thing the plugin does is add precompiled themes to the <install dir>/vim/colors/ folder (themes in this folder are automatically picked up by vim). The Base16 Universal Manager already takes care of generating these themes.

So in theory, what you want is that Base16 Universal Manager just generates a theme and places it under $HOME/.config/vim/colors/base16_<theme>.vim.

The problem is that the name of the theme file (base16_<theme>.vim) has to correspond to the line let g:colors_name = "base16_<theme>" within that file, and your vimrc should specify this theme with the line colorscheme base16_<theme>.

So instead of figuring out how to get the correct theme name in the three places just mentioned, I've made it so that the theme name is statically set to the generic name base16_theme (notice the lack of <>).

So for this setup you need Base16 Universal Manager to generate the file $HOME/.config/vim/colors/base16_theme.vim and you add colorscheme base16_theme to your vimrc. The only problem left is that the file generated by the Manager contains the line let g:colors_name = "base16_<actual theme>", which I overwrite by taking advantage of the replace functionality.

~/.config/base16-universal-manager/config.yaml

vim:
    enabled: true
    files:
        default:
            path: ~/.config/vim/colors/base16_theme.vim
            mode: replace
            start_marker: "\" <<<<<"
            end_marker: "\" >>>>>"

~/.config/vim/colors/base16_theme.vim

" <<<<<
" Theme generated by Base16 Universal Manager goes here
" >>>>>
let g:colors_name="base16_theme"

vimrc

let g:colors_name="base16_theme"
paul-ri commented 3 years ago

Thanks @Quitlox , I've updated the vim entry in my wiki here: https://github.com/paul-ri/base16-universal-manager/wiki/Configuration-examples#vim it works nicely. The latest official wiki entry for vim doesn't work for me: https://github.com/pinpox/base16-universal-manager/wiki/Configuration-examples#vim

I've also added a config for foot which will work once https://github.com/chriskempson/base16-templates-source/pull/97 is merged in.

Rebased on origin/master

@pinpox : let me know if you want me to edit some entries.

pinpox commented 3 years ago

@paul-ri Thanks for updating the docs! Would be great to have that in the wiki of the repository

paul-ri commented 3 years ago

Unfortunately, the wiki doesn't allow for being pushed onto by people other than you. You'd need to run the commands from the first message as suggested in another ticket too.

pinpox commented 3 years ago

Unfortunately, the wiki doesn't allow for being pushed onto by people other than you. You'd need to run the commands from the first message as suggested in another ticket too.

Done! The wiki is updated, feel free to reopen if I missed something.