diff --git a/modules/global/shell.nix b/modules/global/shell.nix index b12e752..f80ace6 100644 --- a/modules/global/shell.nix +++ b/modules/global/shell.nix @@ -80,6 +80,8 @@ in mktmp = "cd $(mktemp -d)"; edit = "$EDITOR"; + e = "edit"; + ei = "editi"; lpath = "echo \"$PATH\" | tr \":\" \"\n\""; timestamp = "date +%s -d"; @@ -87,6 +89,16 @@ in neofetch = "neowofetch"; }; + universe.packages = [ + (pkgs.writeScriptBin "editi" '' + if [[ $# -eq 0 ]] then + $EDITOR "$(fd -H -t f | fzf)" + else + $EDITOR "$(fd -H -t f | fzf -1 -q "$*")" + fi + '') + ]; + universe.variables = { FZF_DEFAULT_OPTS = "--extended"; }; diff --git a/users/modules/global/shells/zsh.nix b/users/modules/global/shells/zsh.nix index 03a8eeb..d52fe58 100644 --- a/users/modules/global/shells/zsh.nix +++ b/users/modules/global/shells/zsh.nix @@ -48,14 +48,6 @@ alias "jh"="cd ~ && j" alias "gj"="gcd && j" - - editi() { - if [[ $# -eq 0 ]] then - edit "$(fd -H -t f | fzf)" - else - edit "$(fd -H -t f | fzf -1 -q "$*")" - fi - } ''; dotDir = ".config/zsh";