From da75cf4f714759b6543e16a6c72a4214dccfe295 Mon Sep 17 00:00:00 2001 From: rydesun Date: Sun, 1 Aug 2021 22:37:27 +0800 Subject: [PATCH] add kitty hyperlinks and shortcuts --- .config/kitty/kitty.conf | 8 ++++++++ .config/kitty/open-actions.conf | 11 +++++++++++ .config/zsh/zshrc | 3 ++- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .config/kitty/open-actions.conf diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index 73405fd..f9dca8e 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -1,3 +1,11 @@ +kitten_alias hints hints --alphabet [;ajfkdlshgqweruiopzxcvnmbyt12345 +map ctrl+g>ctrl+g kitten hints --type=hyperlink +map ctrl+g>ctrl+n kitten hints --type=linenum nvim +{line} {path} +map ctrl+g>ctrl+l kitten hints --type=line --program - +map ctrl+g>ctrl+w kitten hints --type=word --program - +map ctrl+g>ctrl+u kitten hints --type=url --program - +map ctrl+g>ctrl+i kitten hints --type=ip --program - + font_size 15.0 symbol_map U+3400-U+4DBF,U+4E00-U+9FFC Noto Sans Mono CJK SC diff --git a/.config/kitty/open-actions.conf b/.config/kitty/open-actions.conf new file mode 100644 index 0000000..d287d42 --- /dev/null +++ b/.config/kitty/open-actions.conf @@ -0,0 +1,11 @@ +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/.config/zsh/zshrc b/.config/zsh/zshrc index 3dc9bad..609c375 100644 --- a/.config/zsh/zshrc +++ b/.config/zsh/zshrc @@ -193,7 +193,7 @@ GIT_PS1_DESCRIBE_STYLE="default" # sudo后面的命令可以是别名 alias sudo='sudo ' # 设置命令默认行为 -alias ls='ls --color=auto --time-style=iso --human-readable' +alias ls='ls --color=auto --time-style=iso --human-readable --hyperlink=auto' alias grep='grep --color=auto' alias diff='diff --color=auto' alias mv='mv -i' @@ -217,6 +217,7 @@ alias py='python' && compdef py=python alias config='/usr/bin/git --git-dir=$HOME/.myconf/ --work-tree=$HOME' && compdef config=git alias config.edit='GIT_DIR=$HOME/.myconf GIT_WORK_TREE=$HOME nvim' && compdef config.edit=nvim alias ssh='kitty +kitten ssh' +alias rg='kitty +kitten hyperlinked_grep' alias mountdisk="mount | grep -E '^(/dev/sd|/dev/nvme|/dev/mmcblk|gvfsd-fuse)' | awk '{print \$1 \"\t\" \$5 \"\t\" \$3 \"\n\t\t\" \$6}'" # >>>-----------------------------------