Skip to content

Commit

Permalink
fix colorscheme toggling
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow committed Jan 6, 2024
1 parent 4c7b3ca commit a77d2a2
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions plugins.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,35 @@ call pathogen#helptags()
catch
endtry

nmap <Leader>== :Tabularize /=<CR>
vmap <Leader>== :Tabularize /=<CR>
nmap <Leader>;; :Tabularize /:\zs<CR>
vmap <Leader>;; :Tabularize /:\zs<CR>

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" colorscheme
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let s:monochrome_color = "quiet"
let s:colorful_color = "PaperColor"

call SetColorScheme(s:monochrome_color)

" toggle monochrome/colorful
nmap <Leader>h :call ToggleColorful()<CR>
let s:colorful_color = "PaperColor"
let s:monochrome_color = "quiet"
let s:lastcolor = s:colorful_color

function ToggleColorful()
if exists("g:colors_name")
if g:colors_name == s:colorful_color
let s:lastcolor = g:colors_name
call SetColorScheme(s:monochrome_color)
else
call SetColorScheme(s:lastcolor)
call SetColorScheme(s:colorful_color)
endif
else
call SetColorScheme(s:monochrome_color)
call SetColorScheme(s:colorful_color)
endif
endfunction


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" tabular
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nmap <Leader>== :Tabularize /=<CR>
vmap <Leader>== :Tabularize /=<CR>
nmap <Leader>;; :Tabularize /:\zs<CR>
vmap <Leader>;; :Tabularize /:\zs<CR>

0 comments on commit a77d2a2

Please sign in to comment.