Rewrite kitty config

This commit is contained in:
rydesun 2022-10-24 03:00:37 +08:00
parent c1f8cd5750
commit f186e25a19
2 changed files with 42 additions and 29 deletions

View file

@ -1,31 +1,45 @@
# 主题
# {{{ 主题
include themes/everforest.conf
font_size 10
background_opacity 0.95
scrollback_lines 10000
# 使用nvim查看缓冲区
scrollback_pager nvim --cmd "let paging=1 | let ansi=1"
# 关闭响铃
# 关闭响铃声音
enable_audio_bell no
window_alert_on_bell no
# 按键映射
map shift+ctrl+f scroll_page_down
map shift+ctrl+b scroll_page_up
kitten_alias hints hints --alphabet [;ajfkdlshgqweruiopzxcvnmbyt12345
map ctrl+g>ctrl+g kitten hints --type=word --program -
map ctrl+g>shift+g kitten hints --type=word --program @
map ctrl+g>ctrl+l kitten hints --type=line --program -
map ctrl+g>shift+l kitten hints --type=line --program @
map ctrl+g>ctrl+u kitten hints --type=url --program -
map ctrl+g>shift+u kitten hints --type=url --program @
map ctrl+g>ctrl+i kitten hints --type=ip --program -
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
# 优先使用Nerd font会覆盖其他字体的字形
# 包含私用空间、中日韩兼容表意文字、字母表现形式、阿拉伯表现形式A
symbol_map U+E000-U+FDFF Symbols Nerd Font
# }}}
# {{{ Scrollback
# 可回滚的行数原始值为2000
scrollback_lines 20000
# 使用nvim作为pager
# 需要搭配我的neovim配置
# https://github.com/rydesun/neovim-config/blob/master/init.lua#L3
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-g组hints
kitten_alias hints hints --alphabet [;ajfkdlshgqweruiopzxcvnmbyt12345
# 插入单词
map ctrl+g>ctrl+g kitten hints --type=word --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
# 打开hyperlink (受open-actions.conf控制)
map ctrl+g>ctrl+l kitten hints --type=hyperlink
# }}}
# vim: foldmethod=marker

View file

@ -1,15 +1,14 @@
# 直接编辑文本文件(带行号)
protocol file
fragment_matches [0-9]+
action launch --type=overlay ${EDITOR} +${FRAGMENT} ${FILE_PATH}
protocol file
mime text/html
action launch firefox ${FILE_PATH}
action launch --type=overlay $EDITOR +$FRAGMENT $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=overlay kitty +kitten icat --hold ${FILE_PATH}
action launch --type=tab kitty +kitten icat --hold $FILE_PATH