From 1e334ac9cb063d69354df229cc0b57dd42a80d7d Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Tue, 7 Nov 2017 11:28:31 +0100 Subject: [PATCH] Set up gvimrc to be more portable * gvimrc can now work with locally installed color schemes * This requires extending the g:colors list after sourcing it * Also removed old commented block that would never be used again anyway --- gvimrc | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/gvimrc b/gvimrc index 3661c93..3095a31 100644 --- a/gvimrc +++ b/gvimrc @@ -1,33 +1,29 @@ set guioptions-=T set guioptions-=m -augroup filecolors -autocmd! -" au BufLeave * :colorscheme slate -" au BufEnter *.rb :colorscheme desert -" au BufEnter *.txt :colorscheme morning -" au BufEnter *.vim,.vimrc,_vimrc :colorscheme morning -augroup end - -let s:colors=['slate', 'desert', 'blue', 'ron', 'elflord', 'murphy', 'torte'] +let g:colors=['slate', 'desert', 'blue', 'ron', 'elflord', 'murphy', 'torte'] function! Randomcolor() - let random = localtime() % len(s:colors) - execute "colorscheme ".s:colors[random] + let random = localtime() % len(g:colors) + execute "colorscheme ".g:colors[random] endfunction +" Color list can be extended after including (sourcing) this file with +" :let g:colors = extend(['list', 'of', 'color', 'schemes'], g:colors) + " Color Stuff -nnoremap :colorscheme slate -nnoremap :colorscheme desert -nnoremap :colorscheme blue -nnoremap :colorscheme ron +nnoremap :exe "colorscheme ".g:colors[0 % len(g:colors)] +nnoremap :exe "colorscheme ".g:colors[1 % len(g:colors)] +nnoremap :exe "colorscheme ".g:colors[2 % len(g:colors)] +nnoremap :exe "colorscheme ".g:colors[3 % len(g:colors)] -nnoremap :colorscheme peachpuff -nnoremap :colorscheme morning -nnoremap :colorscheme delek -nnoremap :colorscheme shine +nnoremap :exe "colorscheme ".g:colors[4 % len(g:colors)] +nnoremap :exe "colorscheme ".g:colors[5 % len(g:colors)] +nnoremap :exe "colorscheme ".g:colors[6 % len(g:colors)] +nnoremap :exe "colorscheme ".g:colors[7 % len(g:colors)] -nnoremap :colorscheme elflord -nnoremap :colorscheme murphy -nnoremap :colorscheme torte +nnoremap :exe "colorscheme ".g:colors[8 % len(g:colors)] +nnoremap :exe "colorscheme ".g:colors[9 % len(g:colors)] +nnoremap :exe "colorscheme ".g:colors[10 % len(g:colors)] nnoremap :call Randomcolor() + call Randomcolor()