diff --git a/.config/pet/snippet.toml b/.config/pet/snippet.toml new file mode 100644 index 00000000..7ee0e28b --- /dev/null +++ b/.config/pet/snippet.toml @@ -0,0 +1,6 @@ + +[[Snippets]] + Description = "print the classic message" + Output = "" + Tag = [] + command = "echo Hello world!" diff --git a/.config/yadm/tracked b/.config/yadm/tracked index b1e0f762..dfbb02fc 100644 --- a/.config/yadm/tracked +++ b/.config/yadm/tracked @@ -56,3 +56,4 @@ .mbsyncrc .config/mail .zsh +.config/pet/snippet.toml diff --git a/.config/zsh/fzf.zsh b/.config/zsh/fzf.zsh index f059f3fb..c62cf1fb 100644 --- a/.config/zsh/fzf.zsh +++ b/.config/zsh/fzf.zsh @@ -26,6 +26,15 @@ export FZF_DEFAULT_OPTS=" --color=query:#d5d5d5 --color=gutter:#121212" +export FZF_CTRL_R_OPTS=" + --reverse + --cycle + --info=right + --color header:italic + --header 'alt+s (pet new)' + --preview 'echo {}' --preview-window down:3:hidden:wrap + --bind '?:toggle-preview' + --bind 'alt-s:execute(pet new --tag {2..})+abort'" export FZF_TMUX_OPTS=" -p90%,70% " diff --git a/.zshrc b/.zshrc index d1439d24..31f1a11f 100644 --- a/.zshrc +++ b/.zshrc @@ -45,6 +45,16 @@ bindkey "^b" backward-word bindkey "^d" backward-kill-word bindkey "^w" forward-word +function pet-select() { + BUFFER=$(pet search --query "$LBUFFER") + CURSOR=$#BUFFER + zle redisplay +} +zle -N pet-select +stty -ixon +bindkey '^s' pet-select + + # autoload -Uz compinit # compinit @@ -78,15 +88,15 @@ alias mktdir='cd $(mktemp -d)' alias lg=lazygit alias ylg="yadm enter lazygit" # tmux aliases -alias tmuxclean="tmux -L test -f /dev/null" -alias tm="tmux" -alias ta="tmux attach-session" -alias tat="tmux attach-session -t" -alias tka="tmux kill-session -a" -alias tkt="tmux kill-session -t" -alias tl="tmux list-sessions" -alias tn="tmux new-session" -alias tnt="tmux new-session -t" +# alias tmuxclean="tmux -L test -f /dev/null" +# alias tm="tmux" +# alias ta="tmux attach-session" +# alias tat="tmux attach-session -t" +# alias tka="tmux kill-session -a" +# alias tkt="tmux kill-session -t" +# alias tl="tmux list-sessions" +# alias tn="tmux new-session" +# alias tnt="tmux new-session -t" # alias zj=zellij # alias yeet="yay -Rns" @@ -201,7 +211,7 @@ eval $(thefuck --alias) eval "$(starship init zsh)" eval "$(zoxide init zsh)" eval "$(rip completions zsh)" -export DIRENV_LOG_FORMAT="" +# export DIRENV_LOG_FORMAT="" export GPG_TTY=$(tty) gpg-connect-agent updatestartuptty /bye >/dev/null # gpg-connect-agent updatestartuptty /bye >/dev/null @@ -210,4 +220,6 @@ gpg-connect-agent updatestartuptty /bye >/dev/null eval "$(direnv hook zsh)" # colorscript -e 36 # source ~/scripts/obsidian-bridge.sh +PET_GITHUB_ACCESS_TOKEN=$(pass show github/gist) +export PET_GITHUB_ACCESS_TOKEN source <(cdhist -i)