commit 7cdf6801f115d93e2a7acfb317ee0f2d2fdf1a92
parent 949ce536baf8cc50462f155a2f4a9e7ab358b840
Author: Anton Konyahin <me@konyahin.xyz>
Date: Mon, 29 May 2023 22:31:10 +0300
sh: j function for jump to special folders
Diffstat:
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/sh/.config/ksh/kshrc b/sh/.config/ksh/kshrc
@@ -1,3 +1,5 @@
+# -*- mode: sh -*-
+
export PATH=$PATH:~/.bin:~/.local/bin
export LC_ALL=ru_RU.UTF-8
export LANG=ru_RU.UTF-8
@@ -50,6 +52,17 @@ alias cvsupdate='cvs -q up -Pd -A'
alias cvsdiff='cvs diff -uNp'
alias cvsrestore='cvs update -C'
+j () {
+ cd $(cat <<EOF |
+project /home/anton/project
+dotfiles /home/anton/dotfiles
+ports /usr/ports
+sources /usr/src
+notes /home/anton/data/notes
+EOF
+fzf --with-nth=1 --preview='ls {2}' | awk '{print $2}')
+}
+
me () {
$EDITOR $(make 2>&1 | grep '^.*\.[ch]:' | fzf | awk -F: '{printf "-c %s %s\n", $2, $1}')
}
@@ -64,4 +77,4 @@ set -A complete_sttemp -- $(ls ~/project/templates)
set -A complete_pkg_delete -- $(pkg_info | awk "{print \$1}")
# agenda
-calendar
-\ No newline at end of file
+calendar