mirror of
https://github.com/nmasur/dotfiles
synced 2025-04-23 14:32:24 +00:00
Compare commits
2 Commits
fa1482dcfc
...
12d0bccb42
Author | SHA1 | Date | |
---|---|---|---|
|
12d0bccb42 | ||
|
cf7966d73d |
@ -25,7 +25,13 @@ in
|
||||
functions = {
|
||||
edit = {
|
||||
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 = {
|
||||
description = "Jump to directory";
|
||||
@ -51,11 +57,40 @@ in
|
||||
};
|
||||
recent = {
|
||||
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 = {
|
||||
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 = {
|
||||
|
@ -1,4 +0,0 @@
|
||||
set vimfile (fzf)
|
||||
and set vimfile (echo $vimfile | tr -d '\r')
|
||||
and commandline -r "vim \"$vimfile\""
|
||||
and commandline -f execute
|
@ -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
|
@ -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
|
@ -26,6 +26,10 @@ in
|
||||
settings = {
|
||||
theme = config.theme.name;
|
||||
font-size = 16;
|
||||
macos-titlebar-style = "hidden";
|
||||
window-decoration = false;
|
||||
macos-non-native-fullscreen = true;
|
||||
fullscreen = true;
|
||||
};
|
||||
themes."gruvbox" = {
|
||||
background = config.theme.colors.base00;
|
||||
|
@ -15,6 +15,15 @@ in
|
||||
|
||||
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 = {
|
||||
|
||||
enable = true;
|
||||
|
@ -30,9 +30,12 @@ in
|
||||
# };
|
||||
unbind = {
|
||||
_args = [
|
||||
"Ctrl p"
|
||||
"Ctrl g"
|
||||
"Ctrl h"
|
||||
"Ctrl n"
|
||||
"Ctrl o"
|
||||
"Ctrl p"
|
||||
"Ctrl q"
|
||||
"Ctrl s"
|
||||
];
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user