Команды для настройки kitty и mc

This commit is contained in:
Andrei Astafev 2021-12-12 15:17:40 +03:00
parent ab498eb5a9
commit e6e01d8917
4 changed files with 47 additions and 11 deletions

View File

@ -1,12 +1 @@
# Автоматическая установка описания терминала xterm-kitty
if [[ "x${TERM}" = "xxterm-kitty" ]]; then
if ! infocmp "xterm-kitty" > /dev/null 2>&1 ; then
if ! sudo apt-get install kitty-terminfo > /dev/null 2>&1 ; then
mkdir -p "${HOME}/.terminfo/x"
cp -ap "${ZDOTDIR}/terminfo/xterm-kitty" "${HOME}/.terminfo/x"
fi
echo "Terminal description for xterm-kitty was installed."
echo "Close terminal and start again."
fi
fi

View File

@ -84,3 +84,31 @@ getip() {
ifconfig | awk '/inet /{print $2}' | command grep -v 127.0.0.1
fi
}
# Автоматическая установка описания терминала xterm-kitty
kitty-install-terminfo() {
if [[ "x${TERM}" = "xxterm-kitty" ]]; then
if ! infocmp "xterm-kitty" > /dev/null 2>&1 ; then
if ! sudo apt-get install kitty-terminfo > /dev/null 2>&1 ; then
mkdir -p "${HOME}/.terminfo/x"
cp -ap "${ZDOTDIR}/terminfo/xterm-kitty" "${HOME}/.terminfo/x"
fi
echo "Terminal description for xterm-kitty was installed."
echo "Close terminal and start again."
fi
fi
}
# Настройка mc для работы в kitty (mc не должен быть запущен)
mc-kitty-add() {
local mc_cfg="${HOME}/.config/mc/ini.test"
local mc_term="${ZDOTDIR}/terminfo/mc-kitty.ini"
[[ "x$1" == "x-f" ]] && sed -i '/\[terminal:xterm-kitty\]/,/^$/{d}' "${mc_cfg}"
if [ -w "${mc_cfg}" -a -r "${mc_term}" ]; then
if ! grep -qF "[terminal:xterm-kitty]" "${mc_cfg}" ; then
cat "${mc_term}" >> "${mc_cfg}"
fi
fi
}

View File

@ -1,2 +1,5 @@
zcomet compinit
mc-kitty-add
kitty-install-terminfo

16
terminfo/mc-kitty.ini Normal file
View File

@ -0,0 +1,16 @@
[terminal:xterm-kitty]
f11=\\e[1\;2P
f12=\\e[1\;2Q
f13=\\e[1\;2R
f14=\\e[1\;2S
f15=\\e[15\;2~
f16=\\e[17\;2~
f17=\\e[18\;2~
f18=\\e[19\;2~
f19=\\e[20\;2~
f20=\\e[21\;2~
complete=\\e^i
backtab=\\e[Z
backspace=