Add colorscheme switching and airline/tmux autoset

Use <leader><F8> to set a new colorscheme in vim. The airline
automatically sets itself to the corresponding colorscheme, as does the
tmux statusbar at the bottom.

Use <F8> to toggle between dark and light mode for the colorscheme (not
all colorschemes support this unfortunately, I might restrict the
installed colorschemes to those that do). Again, Airline and tmuxline
will automatically adjust themselves.

Tmux prefix highlight plugin has been removed, since its functionality
can be replicated easily with the ?client_prefix function in tmux -
which also works regardless of any styles applied to the statusbar
through tmuxline. Currently, whenever the prefix is active the
clock-area will turn bright blue.
This commit is contained in:
Marty Oehme 2019-11-18 11:00:10 +01:00
parent b3db50f03b
commit 15e63044db
2 changed files with 11 additions and 7 deletions

View file

@ -117,9 +117,9 @@ Plug 'vim-airline/vim-airline-themes'
Plug 'edkolev/tmuxline.vim' Plug 'edkolev/tmuxline.vim'
" Colorschemes " Colorschemes
Plug 'morhetz/gruvbox' Plug 'rafi/awesome-vim-colorschemes'
Plug 'rakr/vim-one'
Plug 'reedes/vim-colors-pencil' Plug 'reedes/vim-colors-pencil'
Plug 'rakr/vim-togglebg'
call plug#end() call plug#end()
endif endif
@ -424,7 +424,7 @@ let g:ale_linters = {
" PLUGIN: AIRLINE " PLUGIN: AIRLINE
" PLUGIN: TMUXLINE " PLUGIN: TMUXLINE
let g:airline_powerline_fonts=1 let g:airline_powerline_fonts=1
let g:airline_theme='raven' " let g:airline_theme='raven'
" Enable italics for colorschemes that support them " Enable italics for colorschemes that support them
let g:gruvbox_italic=1 let g:gruvbox_italic=1
@ -437,7 +437,7 @@ colorscheme one
" disable automatically refreshing the mux statusbar since it breaks tmux " disable automatically refreshing the mux statusbar since it breaks tmux
" prefix highlighting. Instead, when changing vim statusbar just create " prefix highlighting. Instead, when changing vim statusbar just create
" snapshot with :TmuxlineSnapshot file and stick it into tmux config manually " snapshot with :TmuxlineSnapshot file and stick it into tmux config manually
let g:airline#extensions#tmuxline#enabled = 0 let g:airline#extensions#tmuxline#enabled = 1
" custom preset with left-justified window list " custom preset with left-justified window list
let g:tmuxline_preset = { let g:tmuxline_preset = {
\'a' : '#S', \'a' : '#S',
@ -445,7 +445,7 @@ let g:tmuxline_preset = {
\'c' : '#I:#P', \'c' : '#I:#P',
\'win' : '#I #W', \'win' : '#I #W',
\'cwin' : [' ', '#I #W'], \'cwin' : [' ', '#I #W'],
\'x' : '#{prefix_highlight} %H:%M:%S', \'x' : '#{?client_prefix,#[fg=colour232]#[bg=brightblue],} %H:%M:%S',
\'y' : '%d-%b-%y', \'y' : '%d-%b-%y',
\'z' : '#H', \'z' : '#H',
\'options' : {}} \'options' : {}}
@ -667,6 +667,11 @@ noremap <leader>N :NV!<cr>
" FZF git diff " FZF git diff
noremap <leader>gd :FzfGFiles?<cr> noremap <leader>gd :FzfGFiles?<cr>
" FZF colorschemes
nnoremap <leader><F8> :FzfColors<cr>
" Toggle background light/dark
call togglebg#map("<F8>")
" Mostly dealing with Prose writing from here on out " Mostly dealing with Prose writing from here on out
" Format current Paragraph (esp useful in prose writing) " Format current Paragraph (esp useful in prose writing)
nnoremap <silent> <leader>q gqap nnoremap <silent> <leader>q gqap

View file

@ -51,7 +51,6 @@ set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank' set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'Morantron/tmux-fingers' set -g @plugin 'Morantron/tmux-fingers'
set -g @plugin 'christoomey/vim-tmux-navigator' set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-resurrect' set -g @plugin 'tmux-plugins/tmux-resurrect'
@ -154,7 +153,7 @@ setw -g window-status-style fg="#c8c8c8",bg="#2e2e2e","none"
setw -g window-status-activity-style bg="#2e2e2e",fg="#c8c8c8","underscore" setw -g window-status-activity-style bg="#2e2e2e",fg="#c8c8c8","underscore"
setw -g window-status-separator "" setw -g window-status-separator ""
set -g status-left "#[fg=#c8c8c8,bg=#2e2e2e] #S #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #(whoami) #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #I:#P #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]" set -g status-left "#[fg=#c8c8c8,bg=#2e2e2e] #S #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #(whoami) #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #I:#P #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#{prefix_highlight} #[fg=#c8c8c8,bg=#2e2e2e] %H:%M:%S #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] %d-%b-%y #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #H " set -g status-right "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics] #[fg=#c8c8c8,bg=#2e2e2e] #{?client_prefix,#[fg=colour232]#[bg=brightblue],} %H:%M:%S #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] %d-%b-%y #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e] #H "
setw -g window-status-format "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[default] #I #W #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]" setw -g window-status-format "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[default] #I #W #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e]  #I #W #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]" setw -g window-status-current-format "#[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]#[fg=#c8c8c8,bg=#2e2e2e]  #I #W #[fg=#2e2e2e,bg=#2e2e2e,nobold,nounderscore,noitalics]"