diff options
author | ache <ache@ache.one> | 2024-08-09 04:26:38 +0200 |
---|---|---|
committer | ache <ache@ache.one> | 2024-08-09 04:26:38 +0200 |
commit | 4ade92e9a4f8ded6a1dd1cd87b3fca9d495ac14b (patch) | |
tree | dee5a20c35c0960dcfc49a24ce36090bd015b6b5 /functions | |
parent | Improve timestamp function (diff) |
Create edit command e
Diffstat (limited to 'functions')
-rw-r--r-- | functions/e.fish | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/functions/e.fish b/functions/e.fish new file mode 100644 index 0000000..8a14051 --- /dev/null +++ b/functions/e.fish @@ -0,0 +1,9 @@ +function e --wraps "$EDITOR" --description "Edit the file and set the working dir to the best usefull location" + set -l gitRoot (git rev-parse --show-toplevel) + if test -n "$gitRoot" + cd $gitRoot + else + cd (dirname "$argv[1]") + end + $EDITOR "argv[1]" +end |