ssh-compat as a function in zshrc; also more compatible vimrc for linux tty
This commit is contained in:
parent
503f941810
commit
83b95408ba
2 changed files with 20 additions and 6 deletions
18
zshrc
18
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 "$@"
|
||||
}
|
||||
# }}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue