truecolor setups for st, nvim

This commit is contained in:
Daniel Lundin 2017-06-13 07:45:56 +02:00
parent 3b10322ead
commit abb43bcb6e
4 changed files with 35 additions and 2 deletions

View file

@ -62,6 +62,8 @@ export RUST_SRC_PATH=$HOME/src/github.com/rust-lang/rust/src
## grep ## grep
export GREP_COLOR='38;5;232;48;5;214;1' export GREP_COLOR='38;5;232;48;5;214;1'
export TERM=st-256color
if [ "$TERM" != "dumb" ]; then if [ "$TERM" != "dumb" ]; then
if [ -x /usr/bin/pygmentize ]; then if [ -x /usr/bin/pygmentize ]; then
export LESSOPEN="|/usr/bin/pygmentize -f terminal256 -O style=tango %s" export LESSOPEN="|/usr/bin/pygmentize -f terminal256 -O style=tango %s"

View file

@ -57,7 +57,7 @@ fi
PS1_ROOT="\[\e[38;5;228;48;5;196m\] ### ROOT ### " PS1_ROOT="\[\e[38;5;228;48;5;196m\] ### ROOT ### "
case "$TERM" in case "$TERM" in
putty|putty*|xterm|xterm*|screen|screen.xterm|screen-bce|rxvt|rxvt-unicode) putty|putty*|xterm|xterm*|screen|screen.xterm|screen-bce|rxvt|rxvt-unicode|st|st-*)
PS1="\[\e[1${PS1_EXTRA}m\]\$(__git_ps1 2>/dev/null)\$([ "\$USER" = "root" ] && echo -e \"$PS1_ROOT\") ${PS1_PREFIX}\W\\$\[\e[0m\]${PS1_TITLE} " PS1="\[\e[1${PS1_EXTRA}m\]\$(__git_ps1 2>/dev/null)\$([ "\$USER" = "root" ] && echo -e \"$PS1_ROOT\") ${PS1_PREFIX}\W\\$\[\e[0m\]${PS1_TITLE} "
;; ;;
*) *)

View file

@ -20,10 +20,12 @@ Plugin 'Matt-Deacalion/vim-systemd-syntax'
Plugin 'nanotech/jellybeans.vim' Plugin 'nanotech/jellybeans.vim'
Plugin 'NLKNguyen/papercolor-theme' Plugin 'NLKNguyen/papercolor-theme'
Plugin 'plasticboy/vim-markdown' Plugin 'plasticboy/vim-markdown'
Plugin 'rakr/vim-one'
Plugin 'rust-lang/rust.vim' Plugin 'rust-lang/rust.vim'
Plugin 'scrooloose/syntastic' Plugin 'scrooloose/syntastic'
Plugin 'tomtom/tcomment_vim' Plugin 'tomtom/tcomment_vim'
Plugin 'tpope/vim-fugitive' Plugin 'tpope/vim-fugitive'
Plugin 'tyrannicaltoucan/vim-quantum'
Plugin 'Valloric/YouCompleteMe' Plugin 'Valloric/YouCompleteMe'
call vundle#end() call vundle#end()
@ -324,6 +326,7 @@ map ,h :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
\ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR> \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>
set background=dark set background=dark
let g:one_allow_italics=1
let g:PaperColor_Light_Override = { 'Background' : '#fefe00' } let g:PaperColor_Light_Override = { 'Background' : '#fefe00' }
let g:lightline = { let g:lightline = {
@ -407,6 +410,14 @@ set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()} set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%* set statusline+=%*
" Golang
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_interfaces = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
" Hugo " Hugo
let g:vim_markdown_frontmatter = 1 let g:vim_markdown_frontmatter = 1
let g:vim_markdown_toml_frontmatter = 1 let g:vim_markdown_toml_frontmatter = 1
@ -431,8 +442,26 @@ let g:jellybeans_overrides = {
\ 'Visual': { 'ctermbg': '220' }, \ 'Visual': { 'ctermbg': '220' },
\} \}
"Credit joshdick
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
if (empty($TMUX))
if (has("nvim"))
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
if (has("termguicolors"))
set termguicolors
endif
endif
" color dln-light " color dln-light
color jellybeans color jellybeans
" color one
highlight LineNr ctermfg=236 ctermbg=234 highlight LineNr ctermfg=236 ctermbg=234
highlight CursorLine ctermfg=159 ctermbg=24 highlight CursorLine ctermfg=159 ctermbg=24

View file

@ -7,7 +7,9 @@ set -s escape-time 50
set -g status-interval 60 set -g status-interval 60
set -g terminal-overrides "xterm*:XT:smcup@:rmcup@:kUP5=\eOA:kDN5=\eOB:kLFT5=\eOD:kRIT5=\eOC" set -g terminal-overrides "xterm*:XT:smcup@:rmcup@:kUP5=\eOA:kDN5=\eOB:kLFT5=\eOD:kRIT5=\eOC"
set -g terminal-overrides ",*:colors=256:smso=\e[3m:rmso=\e[23m:sitm=\e[3m:ritm=\e[23m" set -g terminal-overrides ",*:colors=256:smso=\e[3m:rmso=\e[23m:sitm=\e[3m:ritm=\e[23m"
set -g default-terminal "xterm-256color" set -g terminal-overrides ",xterm-256color:Tc"
set -g terminal-overrides ",st-256color:Tc"
set -g default-terminal "st-256color"
set-option -g mouse set-option -g mouse
#bind -n WheelUpPane copy-mode #bind -n WheelUpPane copy-mode