Compare commits

..

2 Commits

Author SHA1 Message Date
Noah Masur
12d0bccb42
integrate helix with fzf shortcuts 2025-03-19 14:16:01 -04:00
Noah Masur
cf7966d73d
tweaks for ghostty and zellij 2025-03-19 13:51:42 -04:00
7 changed files with 55 additions and 33 deletions

View File

@ -25,7 +25,13 @@ in
functions = { functions = {
edit = { edit = {
description = "Open a file in Vim"; description = "Open a file in Vim";
body = builtins.readFile ./fish/edit.fish; body = # fish
''
set vimfile (fzf)
and set vimfile (echo $vimfile | tr -d '\r')
and commandline -r "${builtins.baseNameOf config.home.sessionVariables.EDITOR} \"$vimfile\""
and commandline -f execute
'';
}; };
fcd = { fcd = {
description = "Jump to directory"; description = "Jump to directory";
@ -51,11 +57,40 @@ in
}; };
recent = { recent = {
description = "Open a recent file in Vim"; description = "Open a recent file in Vim";
body = builtins.readFile ./fish/recent.fish; body = # fish
''
set vimfile (fd -t f --exec /usr/bin/stat -f "%m%t%N" | sort -nr | cut -f2 | fzf)
and set vimfile (echo $vimfile | tr -d '\r')
and commandline -r "${builtins.baseNameOf config.home.sessionVariables.EDITOR} $vimfile"
and commandline -f execute
'';
}; };
search-and-edit = { search-and-edit = {
description = "Search and open the relevant file in Vim"; description = "Search and open the relevant file in Vim";
body = builtins.readFile ./fish/search-and-edit.fish; body = # fish
''
set vimfile ( \
rg \
--color=always \
--line-number \
--no-heading \
--smart-case \
--iglob "!/Library/**" \
--iglob "!/System/**" \
--iglob "!Users/$HOME/Library/*" \
".*" \
| fzf --ansi \
--height "80%" \
--color "hl:-1:underline,hl+:-1:underline:reverse" \
--delimiter : \
--preview 'bat --color=always {1} --highlight-line {2}' \
--preview-window 'up,60%,border-bottom,+{2}+3/3,~3'
)
and set line_number (echo $vimfile | tr -d '\r' | cut -d':' -f2)
and set vimfile (echo $vimfile | tr -d '\r' | cut -d':' -f1)
and commandline -r "${builtins.baseNameOf config.home.sessionVariables.EDITOR} +$line_number \"$vimfile\""
and commandline -f execute
'';
}; };
}; };
shellAbbrs = { shellAbbrs = {

View File

@ -1,4 +0,0 @@
set vimfile (fzf)
and set vimfile (echo $vimfile | tr -d '\r')
and commandline -r "vim \"$vimfile\""
and commandline -f execute

View File

@ -1,4 +0,0 @@
set vimfile (fd -t f --exec /usr/bin/stat -f "%m%t%N" | sort -nr | cut -f2 | fzf)
and set vimfile (echo $vimfile | tr -d '\r')
and commandline -r "vim $vimfile"
and commandline -f execute

View File

@ -1,21 +0,0 @@
set vimfile ( \
rg \
--color=always \
--line-number \
--no-heading \
--smart-case \
--iglob "!/Library/**" \
--iglob "!/System/**" \
--iglob "!Users/$HOME/Library/*" \
".*" \
| fzf --ansi \
--height "80%" \
--color "hl:-1:underline,hl+:-1:underline:reverse" \
--delimiter : \
--preview 'bat --color=always {1} --highlight-line {2}' \
--preview-window 'up,60%,border-bottom,+{2}+3/3,~3'
)
and set line_number (echo $vimfile | tr -d '\r' | cut -d':' -f2)
and set vimfile (echo $vimfile | tr -d '\r' | cut -d':' -f1)
and commandline -r "vim +$line_number \"$vimfile\""
and commandline -f execute

View File

@ -26,6 +26,10 @@ in
settings = { settings = {
theme = config.theme.name; theme = config.theme.name;
font-size = 16; font-size = 16;
macos-titlebar-style = "hidden";
window-decoration = false;
macos-non-native-fullscreen = true;
fullscreen = true;
}; };
themes."gruvbox" = { themes."gruvbox" = {
background = config.theme.colors.base00; background = config.theme.colors.base00;

View File

@ -15,6 +15,15 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
# Use Neovim as the editor for git commit messages
programs.git.extraConfig.core.editor = lib.mkForce "${lib.getExe pkgs.helix}";
programs.jujutsu.settings.ui.editor = lib.mkForce "${lib.getExe pkgs.helix}";
# Set Neovim as the default app for text editing and manual pages
home.sessionVariables = {
EDITOR = lib.mkForce "${lib.getExe pkgs.helix}";
};
programs.helix = { programs.helix = {
enable = true; enable = true;

View File

@ -30,9 +30,12 @@ in
# }; # };
unbind = { unbind = {
_args = [ _args = [
"Ctrl p" "Ctrl g"
"Ctrl h"
"Ctrl n" "Ctrl n"
"Ctrl o" "Ctrl o"
"Ctrl p"
"Ctrl q"
"Ctrl s" "Ctrl s"
]; ];
}; };