add function to switch between light and dark cs
This commit is contained in:
parent
6d68e88e5d
commit
6338bab01f
29
init.vim
29
init.vim
@ -84,6 +84,7 @@ nnoremap <Leader>vl :setlocal cursorline!<CR>
|
||||
nnoremap <Leader>vc :setlocal cursorcolumn!<CR>
|
||||
nnoremap <Leader>ve :setlocal colorcolumn=80<CR>
|
||||
nnoremap <Leader>vn :setlocal colorcolumn=0<CR>
|
||||
nnoremap <Leader>tcs :call ToggleColorscheme()<CR>
|
||||
nnoremap Y y$
|
||||
nnoremap j gj
|
||||
nnoremap k gk
|
||||
@ -144,8 +145,28 @@ call plug#end()
|
||||
"""""""""""""""
|
||||
" Colorscheme "
|
||||
"""""""""""""""
|
||||
"colorscheme seoul256
|
||||
"colorscheme molokai
|
||||
colorscheme PaperColor
|
||||
"colorscheme Tomorrow-Night
|
||||
function! ToggleColorscheme()
|
||||
if g:colors_name == 'PaperColor'
|
||||
call ToggleBackground()
|
||||
elseif g:colors_name =~ 'seoul256'
|
||||
call ToggleSeoul256()
|
||||
elseif g:colors_name =~ 'Tomorrow'
|
||||
call ToggleTomorrow()
|
||||
endif
|
||||
|
||||
AirlineRefresh
|
||||
endfunction
|
||||
|
||||
function! ToggleBackground()
|
||||
if &background == 'dark'
|
||||
set background=light
|
||||
else
|
||||
set background=dark
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"colorscheme molokai
|
||||
"colorscheme seoul256
|
||||
"colorscheme PaperColor
|
||||
colorscheme Tomorrow-Night
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
Plug 'tomasr/molokai'
|
||||
|
||||
set background=dark
|
||||
|
||||
"let g:molokai_original = 1
|
||||
let g:rehash256 = 1
|
||||
|
@ -17,7 +17,7 @@ Plug 'junegunn/seoul256.vim'
|
||||
let g:seoul256_background = 237
|
||||
let g:seoul256_light_background = 254
|
||||
|
||||
function! ToggleColorscheme()
|
||||
function! ToggleSeoul256()
|
||||
if g:colors_name == 'seoul256'
|
||||
colorscheme seoul256-light
|
||||
else
|
||||
@ -25,14 +25,3 @@ function! ToggleColorscheme()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! SetColorschemeDark(value)
|
||||
let g:seoul256_background = a:value
|
||||
colorscheme seoul256
|
||||
endfunction
|
||||
|
||||
function! SetColorschemeLight(value)
|
||||
let g:seoul256_light_background = a:value
|
||||
colorscheme seoul256-light
|
||||
endfunction
|
||||
|
||||
noremap <leader>st :call ToggleColorscheme()<CR>
|
||||
|
@ -1 +1,10 @@
|
||||
Plug 'chriskempson/tomorrow-theme'
|
||||
|
||||
function! ToggleTomorrow()
|
||||
if g:colors_name == 'Tomorrow-Night'
|
||||
colorscheme Tomorrow
|
||||
else
|
||||
colorscheme Tomorrow-Night
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user