From a7a62695f935ccc43804af2a0ff99b6209eb6825 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Fri, 29 Oct 2021 15:07:29 +0200 Subject: [PATCH] add a `Colour` command to load GUI colorschemes nicely --- home/vimrc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/home/vimrc b/home/vimrc index 228cfd1..0f76687 100644 --- a/home/vimrc +++ b/home/vimrc @@ -122,6 +122,20 @@ let $PATH .= ':'.$HOME.'/sh' " allow direct invocation of shell funcs " fun {{{1 +fu! Colour(name) " go nuts. go wild. + hi clear | syntax clear | syntax on " reset everything for sure (#4405) + if has('termguicolors') + if &term =~ "^tmux-256color" + let &t_8f = "\[38;2;%lu;%lu;%lum" + let &t_8b = "\[48;2;%lu;%lu;%lum" + set termguicolors + endif + endif + exe "colo " . a:name +endf + +command! -nargs=* Colour call Colour() + " lifted from BurntSushi: fu! GlobalReplace() normal! gv"ry