Vim
Project: https://www.vim.org/Setup
Install
Install thcon.vim with your preferred plugin manager. For example, under vim-plug:
" ~/.vimrc
call plug#begin()
+ Plug 'theme-controller/thcon.vim', { 'tag': 'v0.5.0' }
call plug#end()
Load
At the bottom of your .vimrc, replace your colorscheme statement with
commands that load your thcon-managed settings and listen for changes:
" ~/.vimrc
" ...
set number
set laststatus=2
-colorscheme evening
+" Load dynamic config file
+call thcon#load()
+" Listen for theme switches and source the appropriate file
+call thcon#listen()
Create configs
Write a pair of small config files, one for dark-mode settings and one for
light-mode (by default ~/dark.thcon.vimrc and ~/light.thcon.vimrc):
echo "colorscheme evening" > ~/dark.thcon.vimrc
echo "colorscheme morning" > ~/light.thcon.vimrc
Advanced Usage
Since those files are sourced by each vim instance, they can contain
any arbitrary Vimscript you'd like. Consider changing statusline themes,
adjusting indent levels, or whatever other settings you'd like.
Configuration
Section: [vim]
| Key | Default | Description |
|---|---|---|
| dark | ~/dark.thcon.vimrc |
Path to the file to |
| light | ~/light.thcon.vimrc |
Path to the file to |
| disabled | false | Disables Vim |
Example
[vim]
dark = "~/.config/vim/my-dark-settings.vimrc"
light = "~/.config/vim/my-light-settings.vimrc"