More stow refactoring; now actually including bashrc

This commit is contained in:
2025-06-18 14:36:56 +02:00
parent 4a425ec8f1
commit 45b952f37a
12 changed files with 2259 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
# IMPORTANT
The two `prev.{bash, zsh}` functions need to go into `.bashrc` or `.zshrc` respectively.
The `pet-slect.*` need to be put in the rc EXACTLY AS IS!!!. Else the keys aren't rebound.
Those files are taken from [this](https://github.com/knqyf263/pet) Readme. As such,
that repos license might apply!

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,6 @@
function pet-select() {
BUFFER=$(pet search --query "$READLINE_LINE")
READLINE_LINE=$BUFFER
READLINE_POINT=${#BUFFER}
}
bind -x '"\C-x\C-r": pet-select'

View File

@@ -0,0 +1,8 @@
function pet-select() {
BUFFER=$(pet search --query "$LBUFFER")
CURSOR=$#BUFFER
zle redisplay
}
zle -N pet-select
stty -ixon
bindkey '^s' pet-select

View File

@@ -0,0 +1,4 @@
function prev() {
PREV=$(echo `history | tail -n2 | head -n1` | sed 's/[0-9]* //')
sh -c "pet new `printf %q "$PREV"`"
}

View File

@@ -0,0 +1,4 @@
function prev() {
PREV=$(fc -lrn | head -n 1)
sh -c "pet new `printf %q "$PREV"`"
}