dotfiles

Cross platform dotfiles for linux, mac and windows

commit 21bd38da481b46ea63056813e19e7651d2589523
parent 4907c517e759ab64894f3cd3b184b96325da8cd5
Author: bharatvaj.ph <bharatvaj@yahoo.com>
Date: Wed, 25 Aug 2021 03:50:53 +0530

Add plugin 'shorthand'

Add plugin 'nb'
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/.config/bash/plugin/nb b/.config/bash/plugin/nb
@@ -0,0 +1,9 @@
+# nb - notebook
+NB_PATH="${XDG_DATA_HOME}/notes"
+
+nb() {
+    cd "${NB_PATH}"
+    file="$(fzf --preview='cat {}')"
+    [ "${file}" != "" ] && vim "${file}"
+}
+
diff --git a/.config/bash/plugin/shorthand b/.config/bash/plugin/shorthand
@@ -0,0 +1,7 @@
+# One letter bindings for important commands
+
+[ ! -z "${EDITOR}" ] && alias e=${EDITOR}
+
+which git >&/dev/null && alias g=git
+
+which pass >&/dev/null & alias p=pass