From 2986dfcd4cfcd024d24426c73c0de97b0a3189bb Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 20 Aug 2019 01:00:25 +0200 Subject: add edit command "mark edit" or "mark e" will open the mark store file in an editor or using xdg-open. --- mark.fish | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mark.fish') 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) -- cgit v1.2.3