From 4238273951773eb7ed9a064a186344cf6f74151e Mon Sep 17 00:00:00 2001 From: Michael Campagnaro Date: Tue, 29 Nov 2022 22:33:10 -0500 Subject: [PATCH] Add vim function to edit current color scheme --- vimrc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/vimrc b/vimrc index 1bd68ef..611e63d 100644 --- a/vimrc +++ b/vimrc @@ -25,7 +25,7 @@ filetype off " Store the current system name so that we can conditionally set configs for " different platforms let s:uname = system("echo -n \"$(uname)\"") -let s:vim_dir = $HOME . "/.vim" +let g:vim_dir = $HOME . "/.vim" let mapleader="," function! IsWindows() @@ -1041,6 +1041,18 @@ else endif +" Open the current color scheme for editing. +function! EditColorScheme() + let l:path = g:vim_dir . '/colors/' . s:theme . '.vim' + if filereadable(l:path) + execute 'vsplit ' . l:path + else + call PrintError("Failed to open " . l:path . " for editing.") + endif +endfunction + +command -nargs=0 EditColorScheme call EditColorScheme() + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " HIGHLIGHTS - TODO, NOTE, FIXME, etc """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""