aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2019-08-20 01:00:25 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2019-08-20 01:00:25 +0200
commit2986dfcd4cfcd024d24426c73c0de97b0a3189bb (patch)
tree91608c0cff254ab776f8d7a852e6e6bb559b0840
parentfdae89fac1e5491d5902c48dbf7c14e0bd4435cc (diff)
downloadmark-2986dfcd4cfcd024d24426c73c0de97b0a3189bb.tar.gz
mark-2986dfcd4cfcd024d24426c73c0de97b0a3189bb.zip
add edit command
"mark edit" or "mark e" will open the mark store file in an editor or using xdg-open.
-rw-r--r--mark.fish12
1 files changed, 12 insertions, 0 deletions
diff --git a/mark.fish b/mark.fish
index fcfdbe8..5bce3b1 100644
--- a/mark.fish
+++ b/mark.fish
@@ -133,6 +133,18 @@ function mark --argument cmd date
switch "$cmd"
case "print"
mark_print_dates $date $argv[3] $argv[4]
+ case "edit" "e"
+ set store (mark_find_store)
+ if test ! -z "$VISUAL"
+ eval $VISUAL $store
+ else if test ! -z "EDITOR"
+ eval $EDITOR $store
+ else if type -q "xdg-open"
+ xdg-open $store
+ else
+ echo "Don't know how to open marks."
+ echo "Please set VISUAL or EDITOR in your environment."
+ end
case "*"
set store (mark_find_store)