Rewrite kitty mappings

This commit is contained in:
rydesun 2022-10-24 15:52:17 +08:00
parent 4e6f9394b8
commit 3c4f230af4
2 changed files with 25 additions and 19 deletions

View file

@ -5,6 +5,8 @@ background_opacity 0.95
# 关闭响铃声音
enable_audio_bell no
# 不在系统窗口上报警
window_alert_on_bell no
# 优先使用Nerd font会覆盖其他字体的字形
# 包含私用空间、中日韩兼容表意文字、字母表现形式、阿拉伯表现形式A
@ -22,24 +24,23 @@ scrollback_pager nvim --cmd "let paging=1 | let ansi=1"
# }}}
# {{{ 按键
# Shift-Ctrl组:可连续击键
map shift+ctrl+f scroll_page_down
map shift+ctrl+b scroll_page_up
### ctrl+shift组:可连续击键
map ctrl+shift+f scroll_page_down
map ctrl+shift+b scroll_page_up
# Ctrl-g组hints
kitten_alias hints hints --alphabet [;ajfkdlshgqweruiopzxcvnmbyt12345
# 插入单词
### ctrl+g组hints
kitten_alias hints hints --alphabet ;ajfkdlshgqweruiopzxcvnmtby1230[
# 其他hints使用默认的ctrl+shift+p和ctrl+shift+e
# 插入
map ctrl+g>ctrl+g kitten hints --type=word --program -
# 复制单词
map ctrl+g>ctrl+l kitten hints --type=line --program -
map ctrl+g>ctrl+u kitten hints --type=url --program -
# 复制
map ctrl+g>g kitten hints --type=word --program @
# 编辑带行号的文件
map ctrl+g>ctrl+n kitten hints --type=linenum ${EDITOR} +{line} {path}
# 打开路径 (xdg-open)
map ctrl+g>ctrl+o kitten hints --type=path
# 打开URL (xdg-open)
map ctrl+g>ctrl+u kitten hints --type=url
map ctrl+g>l kitten hints --type=line --program @
map ctrl+g>u kitten hints --type=url --program @
# 打开hyperlink (受open-actions.conf控制)
map ctrl+g>ctrl+l kitten hints --type=hyperlink
map ctrl+g>ctrl+o kitten hints --type=hyperlink
# }}}
# vim: foldmethod=marker

View file

@ -1,14 +1,19 @@
# 直接编辑文本文件(带行号)
# 编辑带行号的文件
protocol file
fragment_matches [0-9]+
action launch --type=overlay $EDITOR +$FRAGMENT $FILE_PATH
action launch --type=overlay $EDITOR +$FRAGMENT "$FILE_PATH"
# 直接编辑文本文件
# 在浏览器中打开html
protocol file
mime text/html
action launch --type=background xdg-open "$FILE_PATH"
# 编辑文本文件
protocol file
mime text/*
action launch --type=overlay $EDITOR $FILE_PATH
action launch --type=overlay $EDITOR "$FILE_PATH"
# 在tab中查看图片
protocol file
mime image/*
action launch --type=tab kitty +kitten icat --hold $FILE_PATH
action launch --type=tab kitty +kitten icat --hold "$FILE_PATH"