aboutsummaryrefslogtreecommitdiff
path: root/bash/dot-config
diff options
context:
space:
mode:
Diffstat (limited to 'bash/dot-config')
-rw-r--r--bash/dot-config/bash/notes.bash44
-rw-r--r--bash/dot-config/shellcheckrc4
-rw-r--r--bash/dot-config/shellshort/bm-dirs2
-rw-r--r--bash/dot-config/shellshort/shortcutenvrc5
-rw-r--r--bash/dot-config/shellshort/shortcutrc4
-rw-r--r--bash/dot-config/shellshort/zshnameddirs4
6 files changed, 60 insertions, 3 deletions
diff --git a/bash/dot-config/bash/notes.bash b/bash/dot-config/bash/notes.bash
index 82ed521..182f28b 100644
--- a/bash/dot-config/bash/notes.bash
+++ b/bash/dot-config/bash/notes.bash
@@ -1,4 +1,4 @@
-note() {
+oldnote() {
if (($# == 0)); then
tmpfile=$(mktemp --tmpdir --suffix=.md note.XXXXXXXXXXX)
echo "- [ ] $(date +'%m-%d-%Y %H:%M') " >> "$tmpfile"
@@ -9,10 +9,50 @@ note() {
fi
}
-todos() {
+orgnote() {
+ local curdate="$(date +'%Y-%m-%d %a %H:%M')"
+ if (($# == 0)); then
+ local tmpfile=$(mktemp --tmpdir --suffix=.org note.XXXXXXXXXXX)
+ printf "* TODO :REVISIT:\n[%s]\n" "$curdate" >> "$tmpfile"
+ nvim -c 'norm ggf:h' -c 'startinsert!' "$tmpfile"
+ cat "$tmpfile" >> ~/org/refile.org
+ else
+ printf "* TODO %s :REVISIT:\n[%s]\n" "$*" "$curdate" >> ~/org/refile.org
+ fi
+}
+
+nb() {
+ local curdate="$(date +'%Y-%m-%d %a %H:%M')"
+ if (($# == 0)); then
+ local tmpfile=$(mktemp --tmpdir --suffix=.notes note.XXXXXXXXXXX)
+ printf "[%s] " "$curdate" >> "$tmpfile"
+ local mtime_before=$(stat -c %Y "$tmpfile")
+ nvim -c 'norm gg$' -c 'startinsert!' "$tmpfile"
+ local mtime_after=$(stat -c %Y "$tmpfile")
+ if [ "$mtime_after" -ne "$mtime_before" ]; then
+ cat "$tmpfile" >> ~/refile.notes
+ fi
+ else
+ printf "[%s] %s" "$curdate" "$*" >> ~/refile.notes
+ fi
+}
+
+oldtodos() {
printf $'\e[01;33mINBOX\e[0m\n'
bat -P -p ~/pkm/0_inbox.md
echo
printf $'\e[01;33mALL\e[0m\n'
rg --color=always --no-line-number --no-heading --smart-case --glob "!.git" --glob "!0_inbox.md" --hyperlink-format='file://{path}' -- "-\\s\\[\\s\\]" ~/pkm/
}
+
+orgtodos() {
+ printf $'\e[01;33mINBOX\e[0m\n'
+ bat -P -p ~/org/refile.org
+ echo
+ printf $'\e[01;33mALL\e[0m\n'
+ rg --color=always --no-line-number --no-heading --smart-case --glob "!.git" --glob "!refile.org" --hyperlink-format='file://{path}' -- "\\*\\sTODO" ~/org/
+}
+
+todos() {
+ bat -P -p ~/refile.notes
+}
diff --git a/bash/dot-config/shellcheckrc b/bash/dot-config/shellcheckrc
new file mode 100644
index 0000000..bc6fdad
--- /dev/null
+++ b/bash/dot-config/shellcheckrc
@@ -0,0 +1,4 @@
+external-sources=true
+
+source-path=SCRIPTDIR
+source-path=/home/moreka/.config/bash
diff --git a/bash/dot-config/shellshort/bm-dirs b/bash/dot-config/shellshort/bm-dirs
index e69de29..4ecd6c0 100644
--- a/bash/dot-config/shellshort/bm-dirs
+++ b/bash/dot-config/shellshort/bm-dirs
@@ -0,0 +1,2 @@
+mit $HOME/mit/18.650-spring-26/
+linatt $HOME/mit/linear-attention/
diff --git a/bash/dot-config/shellshort/shortcutenvrc b/bash/dot-config/shellshort/shortcutenvrc
new file mode 100644
index 0000000..8f0b3fb
--- /dev/null
+++ b/bash/dot-config/shellshort/shortcutenvrc
@@ -0,0 +1,5 @@
+# vim: filetype=sh
+[ -n "mit" ] && export mit="/home/moreka/mit/18.650-spring-26/"
+[ -n "linatt" ] && export linatt="/home/moreka/mit/linear-attention/"
+[ -n "cala" ] && export cala="/home/moreka/.config/alacritty/alacritty.toml"
+[ -n "cnir" ] && export cnir="/home/moreka/.config/niri/config.kdl"
diff --git a/bash/dot-config/shellshort/shortcutrc b/bash/dot-config/shellshort/shortcutrc
index e701151..e8571c1 100644
--- a/bash/dot-config/shellshort/shortcutrc
+++ b/bash/dot-config/shellshort/shortcutrc
@@ -1,3 +1,5 @@
# vim: filetype=sh
-alias cala="$EDITOR /home/moreka/.config/alacritty/alacritty.toml" \
+alias mit="cd /home/moreka/mit/18.650-spring-26/ && ls -A" \
+linatt="cd /home/moreka/mit/linear-attention/ && ls -A" \
+cala="$EDITOR /home/moreka/.config/alacritty/alacritty.toml" \
cnir="$EDITOR /home/moreka/.config/niri/config.kdl" \
diff --git a/bash/dot-config/shellshort/zshnameddirs b/bash/dot-config/shellshort/zshnameddirs
new file mode 100644
index 0000000..d7453ec
--- /dev/null
+++ b/bash/dot-config/shellshort/zshnameddirs
@@ -0,0 +1,4 @@
+hash -d mit=/home/moreka/mit/18.650-spring-26/
+hash -d linatt=/home/moreka/mit/linear-attention/
+hash -d cala=/home/moreka/.config/alacritty/alacritty.toml
+hash -d cnir=/home/moreka/.config/niri/config.kdl