From c1f8cd5750a2ae3e0e46e69965f92da4d50a422e Mon Sep 17 00:00:00 2001 From: rydesun Date: Mon, 24 Oct 2022 01:06:48 +0800 Subject: [PATCH] Fix kitty integration config --- .config/kitty/kitty.conf | 3 --- .config/kitty/open-actions.conf | 8 ++++---- .zshrc | 29 ++++++++++------------------- 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index 860cb79..8cda25f 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -26,9 +26,6 @@ map ctrl+g>shift+i kitten hints --type=ip --program @ map ctrl+g>ctrl+n kitten hints --type=linenum nvim +{line} {path} map ctrl+g>ctrl+y kitten hints --type=hyperlink -# 在zsh中手动集成 -shell_integration disabled - # 优先使用Nerd font,会覆盖其他字体的字形 # 包含私用空间、中日韩兼容表意文字、字母表现形式、阿拉伯表现形式A symbol_map U+E000-U+FDFF Symbols Nerd Font diff --git a/.config/kitty/open-actions.conf b/.config/kitty/open-actions.conf index 6a8632e..dce5485 100644 --- a/.config/kitty/open-actions.conf +++ b/.config/kitty/open-actions.conf @@ -1,3 +1,7 @@ +protocol file +fragment_matches [0-9]+ +action launch --type=overlay ${EDITOR} +${FRAGMENT} ${FILE_PATH} + protocol file mime text/html action launch firefox ${FILE_PATH} @@ -6,10 +10,6 @@ protocol file mime text/* action launch --type=overlay ${EDITOR} ${FILE_PATH} -protocol file -fragment_matches [0-9]+ -action launch --type=overlay ${EDITOR} +${FRAGMENT} ${FILE_PATH} - protocol file mime image/* action launch --type=overlay kitty +kitten icat --hold ${FILE_PATH} diff --git a/.zshrc b/.zshrc index c94c66c..7cbd494 100644 --- a/.zshrc +++ b/.zshrc @@ -260,7 +260,7 @@ WORDCHARS='*?_-.[]~&;!#$%^(){}<>' # sudo后面的命令可以是alias alias sudo='sudo ' -# 命令的默认行为 +### 命令的默认行为 alias ls='ls --color=auto --time-style=iso --human-readable --hyperlink=auto -F' alias grep='grep --color=auto' alias diff='diff --color=auto' @@ -271,12 +271,19 @@ alias mitmproxy="mitmproxy --set confdir=$XDG_CONFIG_HOME/mitmproxy" alias mitmweb="mitmweb --set confdir=$XDG_CONFIG_HOME/mitmproxy" alias rsync="rsync -avhHP" +### 与kitty集成 +if ((Z_ENV_KITTY)); then + alias ssh='kitty +kitten ssh' + alias rg='kitty +kitten hyperlinked_grep' + alias icat='kitty +kitten icat' +fi + +### 命令缩写 alias sl='ls' alias l='ls -l' alias la='ls -A' alias ll='ls -Al' - -# 命令缩写 +alias g='git' alias x='xdg-open' # 需要搭配我的neovim配置 @@ -291,7 +298,6 @@ if (($Z_ENV_NVIM)); then else alias e='nvim' fi -alias g='git' alias cfg='GIT_DIR=$HOME/.myconf GIT_WORK_TREE=$HOME git' alias cfg.e='GIT_DIR=$HOME/.myconf GIT_WORK_TREE=$HOME nvim' @@ -311,19 +317,4 @@ pmb() { pml $1 | awk -F/ '/\/usr\/bin\/.+[^/]$/{print $NF}' } pmd() { pml $1 | grep -e '\.service$' -e '\.socket$' -e '\.timer$' -e '\.desktop$' } # }}} -# {{{ kitty集成 -if [[ -n "$KITTY_INSTALLATION_DIR" ]]; then - export KITTY_SHELL_INTEGRATION=enabled - autoload -Uz "$KITTY_INSTALLATION_DIR"/shell-integration/zsh/kitty-integration - kitty-integration - unfunction kitty-integration -fi - -if ((Z_ENV_KITTY)); then - alias ssh='kitty +kitten ssh' - alias rg='kitty +kitten hyperlinked_grep' - alias icat='kitty +kitten icat' -fi -# }}} - # vim: foldmethod=marker:foldlevel=0