From 93e6a3ee935179b956fb9af83c290c8cd418dd6e Mon Sep 17 00:00:00 2001 From: druckdev <63563978+druckdev@users.noreply.github.com> Date: Sun, 13 Sep 2020 16:26:20 +0200 Subject: [PATCH] Fix issues with vanilla vim When TERM is not xterm-256color (for example in st or tmux) t_8f and t_8b have to be set manually for colors to work. Add XDG_CONFIG_HOME/vim to packpath so that plugins work. --- .config/vim/vimrc | 8 +++++++- .config/vim/xdg.vim | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index b790c1d..e639090 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -58,8 +58,14 @@ set spell spelllang=en_us " Aesthetics ################################################################### " Use 24-bit (true-color) mode -if (has("termguicolors")) +if (has('termguicolors')) set termguicolors + " https://github.com/vim/vim/issues/993 + if (&term != 'xterm-256color') + " set Vim-specific sequences for RGB colors + let &t_8f = "\e[38;2;%lu;%lu;%lum" + let &t_8b = "\e[48;2;%lu;%lu;%lum" + endif endif " use onedark as theme for syntax highlighting syntax on diff --git a/.config/vim/xdg.vim b/.config/vim/xdg.vim index 6630c0d..ae8c132 100644 --- a/.config/vim/xdg.vim +++ b/.config/vim/xdg.vim @@ -42,4 +42,6 @@ set runtimepath-=~/.vim set runtimepath^=$XDG_CONFIG_HOME/vim set runtimepath-=~/.vim/after set runtimepath+=$XDG_CONFIG_HOME/vim/after +set packpath-=~/.vim +set packpath^=$XDG_CONFIG_HOME/vim source $XDG_CONFIG_HOME/vim/vimrc