From 9d19d81a6fb10dacf15172d32c61d1f480ea760e Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Mon, 15 Jul 2024 11:26:00 +0200 Subject: [PATCH] zsh-autoquoter --- .gitmodules | 3 +++ .zsh/plugins/zsh-autoquoter | 1 + .zshrc | 10 +++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 160000 .zsh/plugins/zsh-autoquoter diff --git a/.gitmodules b/.gitmodules index 2865e56..a7568cf 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "nvchad-custom"] path = .custon/nvim/lua/custom url = https://git.cscherr.de/PlexSheep/nvchad-custom +[submodule ".zsh/plugins/zsh-autoquoter"] + path = .zsh/plugins/zsh-autoquoter + url = https://github.com/ianthehenry/zsh-autoquoter diff --git a/.zsh/plugins/zsh-autoquoter b/.zsh/plugins/zsh-autoquoter new file mode 160000 index 0000000..9e3b1b2 --- /dev/null +++ b/.zsh/plugins/zsh-autoquoter @@ -0,0 +1 @@ +Subproject commit 9e3b1b216bf7b61a9807a242bae730b5fc232a44 diff --git a/.zshrc b/.zshrc index 94cb140..a91551b 100644 --- a/.zshrc +++ b/.zshrc @@ -58,7 +58,10 @@ function condac() { conda activate $@ export HOST=$(hostname) } -# TODO: make neorg a function, take a workspace as arg +# calculate on shell with `c 1+1` +function c() { printf "%s\n" "$@" | bc -l; } +# call python in a print from args +function py() { python -c "from math import *; print($*)" } ### ---- zsh options ------------------------------------- setopt autocd @@ -177,10 +180,15 @@ fi ### ---- PLUGINS ----------------------------------- source $ZSH/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh source $ZSH/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh +source $ZSH/plugins/zsh-autoquoter/zsh-autoquoter.zsh +ZSH_HIGHLIGHT_HIGHLIGHTERS+=(zaq) source ~/.local/share/fzf/key-bindings.zsh source ~/.local/share/fzf/completion.zsh fpath=($ZSH/plugins/zsh-completions/src $fpath) +ZAQ_PREFIXES+=('git commit( [^ ]##)# -[^ -]#m') +ZAQ_PREFIXES_GREEDY+=('py #') + ### --- fzf Config ------------------------------------ export FZF_CTRL_T_OPTS="--preview '(highlight -O ansi -l {} 2> /dev/null || cat {} || tree -C {}) 2> /dev/null | head -200'" export FZF_CTRL_R_OPTS='--no-sort --exact'