aboutsummaryrefslogtreecommitdiffstats
path: root/mdlink
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2023-09-03 14:27:52 +0100
committerMatthew Lemon <y@yulqen.org>2023-09-03 14:27:52 +0100
commitcfe503b2b54b1eba25c32b3b4887f51b387c21a5 (patch)
tree7d258e8c758016e2120968dda7a1855e0a29760c /mdlink
parent4778ad16c39eae7371c1e4dfebfd596b362fac4a (diff)
Adds mdlink to search for files and help with creating markdown links
Diffstat (limited to 'mdlink')
-rwxr-xr-xmdlink10
1 files changed, 10 insertions, 0 deletions
diff --git a/mdlink b/mdlink
new file mode 100755
index 0000000..047b9ec
--- /dev/null
+++ b/mdlink
@@ -0,0 +1,10 @@
+#!/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