Improvements to kitty conf to support hyperlinks
This commit is contained in:
parent
6bc7ff5190
commit
d92d7b10f3
5 changed files with 44 additions and 20 deletions
20
home.nix
20
home.nix
|
@ -192,26 +192,6 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.kitty = {
|
|
||||||
enable = true;
|
|
||||||
keybindings = {
|
|
||||||
"kitty_mod+enter" = "new_window_with_cwd";
|
|
||||||
};
|
|
||||||
themeFile = "Tango_Dark";
|
|
||||||
font = {
|
|
||||||
name = "SF Mono";
|
|
||||||
size = 13;
|
|
||||||
};
|
|
||||||
settings = {
|
|
||||||
copy_on_select = true;
|
|
||||||
enabled_layouts = "*";
|
|
||||||
macos_quit_when_last_window_closed = true;
|
|
||||||
scrollback_lines = 100000;
|
|
||||||
kitty_mod = "cmd+option";
|
|
||||||
};
|
|
||||||
shellIntegration.enableFishIntegration = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.lazygit = {
|
programs.lazygit = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
./fish
|
./fish
|
||||||
./git
|
./git
|
||||||
./jujutsu
|
./jujutsu
|
||||||
|
./kitty
|
||||||
./vscode
|
./vscode
|
||||||
./zed
|
./zed
|
||||||
]
|
]
|
||||||
|
|
|
@ -81,6 +81,7 @@
|
||||||
giscala = "gitignore scala,vim,java,sbt > .gitignore";
|
giscala = "gitignore scala,vim,java,sbt > .gitignore";
|
||||||
gforksync = "git fetch upstream && git merge upstream/master && git push origin master";
|
gforksync = "git fetch upstream && git merge upstream/master && git push origin master";
|
||||||
grep = "grep --color=auto";
|
grep = "grep --color=auto";
|
||||||
|
hg = "kitten hyperlinked-grep";
|
||||||
lg = "lazygit";
|
lg = "lazygit";
|
||||||
new-sbt = "sbt new scala/scala-seed.g8";
|
new-sbt = "sbt new scala/scala-seed.g8";
|
||||||
nixc = "cd ~/.config/nixpkgs";
|
nixc = "cd ~/.config/nixpkgs";
|
||||||
|
|
32
programs/kitty/default.nix
Normal file
32
programs/kitty/default.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
actionsConfig = builtins.readFile ./open-actions.conf;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
programs.kitty = {
|
||||||
|
enable = true;
|
||||||
|
keybindings = {
|
||||||
|
"kitty_mod+enter" = "new_window_with_cwd";
|
||||||
|
"f1" = "create_marker";
|
||||||
|
"f2" = "remove_marker";
|
||||||
|
"ctrl+p" = "scroll_to_mark prev";
|
||||||
|
"ctrl+n" = "scroll_to_mark next";
|
||||||
|
};
|
||||||
|
themeFile = "Tango_Dark";
|
||||||
|
font = {
|
||||||
|
name = "SF Mono";
|
||||||
|
size = 13;
|
||||||
|
};
|
||||||
|
settings = {
|
||||||
|
copy_on_select = true;
|
||||||
|
enabled_layouts = "*";
|
||||||
|
kitty_mod = "cmd+option";
|
||||||
|
macos_quit_when_last_window_closed = true;
|
||||||
|
scrollback_lines = 100000;
|
||||||
|
};
|
||||||
|
shellIntegration.enableFishIntegration = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
home.file.".config/kitty/open-actions.conf".text = actionsConfig;
|
||||||
|
}
|
10
programs/kitty/open-actions.conf
Normal file
10
programs/kitty/open-actions.conf
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# Open any file with a fragment in vim, fragments are generated
|
||||||
|
# by the hyperlink-grep kitten and nothing else so far.
|
||||||
|
protocol file
|
||||||
|
fragment_matches [0-9]+
|
||||||
|
action launch --type=overlay --cwd=current vim +${FRAGMENT} -- ${FILE_PATH}
|
||||||
|
|
||||||
|
# Open text files without fragments in the editor
|
||||||
|
protocol file
|
||||||
|
mime text/*
|
||||||
|
action launch --type=overlay --cwd=current -- ${EDITOR} -- ${FILE_PATH}
|
Loading…
Add table
Reference in a new issue