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.
This commit is contained in:
2020-09-13 16:26:20 +02:00
parent 9151969cab
commit 93e6a3ee93
2 changed files with 9 additions and 1 deletions

View File

@@ -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

View File

@@ -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