From 83b95408ba334c66d37ec221664c39c99c087cb5 Mon Sep 17 00:00:00 2001 From: Von Random Date: Tue, 3 Jul 2018 18:11:23 +0300 Subject: [PATCH] ssh-compat as a function in zshrc; also more compatible vimrc for linux tty --- vimrc | 8 +++++--- zshrc | 18 +++++++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/vimrc b/vimrc index 175e777..b8f16cb 100644 --- a/vimrc +++ b/vimrc @@ -70,9 +70,11 @@ if v:version >= 800 autocmd FileType python packadd ale autocmd FileType sh packadd ale - let g:solarized_extra_hi_groups = 1 - let g:solarized_use16 = 1 - colorscheme solarized8 + if $TERM != 'linux' + let g:solarized_extra_hi_groups = 1 + let g:solarized_use16 = 1 + colorscheme solarized8 + endif endif syntax on diff --git a/zshrc b/zshrc index 0fe825e..08635fe 100644 --- a/zshrc +++ b/zshrc @@ -228,9 +228,21 @@ greset() { /usr/bin/git clean -fd /usr/bin/git reset --hard } +# ssh-compat, when terminfo is missing +s() { + local -A terms tempterm ssh + ssh=$(whence ssh) + terms=( + 'st' 'xterm' + 'tmux' 'screen' + ) + tempterm=${TERM%%-256color} + TERM=${TERMS[$tempterm]-$tempterm} $ssh "$@" +} +# prefer neovim over vim vim() { - local vimbin - vimbin=$(whence nvim) || vimbin=$(whence vim) - $vimbin "$@" + local vim + vim=$(whence nvim) || vimbin=$(whence vim) + $vim "$@" } # }}}