Expand Linux command library

This commit is contained in:
2026-10-03 17:34:05 -06:00
parent 0a284d08bc
commit fa1f20f97f
2 changed files with 139 additions and 26 deletions
+7 -3
View File
@@ -1,10 +1,14 @@
# Command picker using fzf
commands() {
local cmd
cmd=$(grep -vE '^[[:space:]]*#|^[[:space:]]*$' ~/.config/commands/linux.txt |
local selection cmd
selection=$(grep -vE '^[[:space:]]*#|^[[:space:]]*$' ~/.config/commands/linux.txt |
fzf --height 50% --layout=reverse --border --prompt='Command: ')
if [[ -n "$cmd" ]]; then
if [[ -n "$selection" ]]; then
cmd=$(printf '%s\n' "$selection" | sed 's/[[:space:]]*#.*$//')
cmd="${cmd%"${cmd##*[![:space:]]}"}"
READLINE_LINE="$cmd"
READLINE_POINT=${#READLINE_LINE}
fi