From 6b4fe587cd4a16646db019ad6ae12f44ee9bb948 Mon Sep 17 00:00:00 2001 From: Von Random Date: Fri, 6 Jul 2018 00:33:07 +0300 Subject: [PATCH] tvim support, cleanup and better s() func --- tmux.conf | 2 +- vimrc | 18 +++++++++--------- zshrc | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tmux.conf b/tmux.conf index eb5b625..b7b67a7 100644 --- a/tmux.conf +++ b/tmux.conf @@ -9,7 +9,7 @@ bind > resize-pane -R 5 bind - resize-pane -D 5 bind + resize-pane -U 5 bind e choose-session -bind p command-prompt -p "ssh:" "new-session -As 'ssh'; new-window -n '%1' 'TERM=screen ssh %%'" +bind p command-prompt -p "ssh:" "new-session -As 'ssh'; new-window -n '%1' 'TERM=screen-256color ssh %%'" bind t command-prompt -p "attach pane to:" "join-pane -t :'%%'" bind y command-prompt break-pane bind -n M-w next-window diff --git a/vimrc b/vimrc index 0dfe88c..8bfb8f3 100644 --- a/vimrc +++ b/vimrc @@ -16,11 +16,13 @@ set t_Co=256 t_ut= termencoding=utf-8 encoding=utf-8 set wildmenu showcmd ruler laststatus=2 set statusline=[%F]\ %R%H%W%M\ %=[%{&fenc}/%{&ff}]\ %y\ [%4l/%L:%3v] " update window title -if $TERM =~ '^screen' - set t_ts=k - set t_fs=\ +if !exists('g:tvim') + if $TERM =~ '^screen' + set t_ts=k + set t_fs=\ + endif + set title titlestring=[%{hostname()}]\ %t\ -\ vim endif -set title titlestring=[%{hostname()}]\ %t\ -\ vim " enable case indentation let g:sh_indent_case_labels=1 " version specific settings @@ -34,11 +36,7 @@ map let mapleader="\" "no more F1 noremap -xnoremap -snoremap -inoremap lnoremap -cnoremap "some toggles nnoremap l :setlocal list! nnoremap c :setlocal cursorline! @@ -70,7 +68,9 @@ if v:version >= 800 autocmd FileType python packadd ale | packadd jedi-vim autocmd FileType sh packadd ale - if $TERM != 'linux' + if exists('g:tvim') || has('gui_running') + colorscheme jellybeans + elseif $TERM != 'linux' let g:solarized_extra_hi_groups = 1 let g:solarized_use16 = 1 colorscheme solarized8 diff --git a/zshrc b/zshrc index 0c40983..cd1885d 100644 --- a/zshrc +++ b/zshrc @@ -236,10 +236,10 @@ s() { local -A terms tempterm ssh ssh=$(whence ssh) terms=( - 'st' 'xterm' - 'tmux' 'screen' + 'rxvt-unicode-256color' 'rxvt-unicode' + 'st-256color' 'xterm-256color' + 'tmux-256color' 'screen-256color' ) - tempterm=${TERM%%-256color} - TERM=${TERMS[$tempterm]-$tempterm} $ssh "$@" + TERM=${terms[$TERM]-$TERM} $ssh "$@" } # }}}