From e30c304663232fde473029d1cbcae50440174696 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 4 Sep 2023 10:23:32 +0100 Subject: Fixes zetrename and adds mdlinkopen script --- mdlinkopen | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 mdlinkopen (limited to 'mdlinkopen') diff --git a/mdlinkopen b/mdlinkopen new file mode 100755 index 0000000..5764fdc --- /dev/null +++ b/mdlinkopen @@ -0,0 +1,11 @@ +#!/bin/bash +# +# from https://facedragons.com/foss/build-a-foss-second-brain-in-vim/?utm_source=twitter&utm_medium=social&utm_campaign=ReviveOldPost +# The idea is that you call this script, type in a search term and dmenu presents a list of files in Notes that contain the +# term. Hitting enter puts it on the clip board and you can paste it into a vim file to get a link. + +SEARCHTERM=$(echo "" | dmenu) + +CHOSENFILE=$(grep -rnwli /home/lemon/Documents/Notes -e "$SEARCHTERM" | sed 's/\/home\/lemon\/Documents\/Notes\///' | dmenu -l 20) +echo $CHOSENFILE | xclip -selection c +st vim /home/lemon/Documents/Notes/"$CHOSENFILE" & -- cgit v1.2.3