commit 495f83a358e2ae3183eabbde2ddce9ac43d96fbd
parent d1a68f66f9fa01260ddbf565860c23a01e76e96f
Author: regexghost <dev@regexghost.com>
Date: Fri, 7 Aug 2026 18:05:08 +0100
fzf cd function (qcd)
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/dotfiles/.kshrc b/dotfiles/.kshrc
@@ -143,13 +143,20 @@ alias pip='~/.local/share/regexghost/.venv/bin/pip'
alias as='echo "Use \\\as to run as command, disabled as too easy to type accidentally, creating unnecessary a.out file in home directory"'
+# fzf -> cd
+qcd () {
+ dir="$(find "$HOME/Documents" "$HOME/Downloads" "$HOME/Music" "$HOME/Pictures" "$HOME/Programs" "$HOME/Videos" "$HOME/Work" "$HOME/.local/share/regexghost" -type d | fzf)"
+ [ "dir" = "" ] && return
+ cd "$dir"
+}
+
## Functions to basic programs
# fzf -> editor
qfi () {
# Only look for file types you might actually want to manually edit
file="$(find ~/* | grep -E '.py$|.go$|.txt$|.md$|.java$|.js$|.html$|.css$|.c$|.cc$|.conf$|.lua$|.rs$|.sh$|.bash$|.csv$' | sed 's|'"$HOME"'|~|g' | fzf)"
- [[ "$file" == "" ]] && return
+ [ "$file" = "" ] && return
"${VISUAL:-${EDITOR:-vi}}" "$file"
}