setopt no_case_glob
unsetopt glob_complete
+
+ # Fragment completions
+ zstyle ':completion:*' list-suffixes
zstyle ':completion:*' expand prefix suffix
+
+ # Menu completions
+ zstyle ':completion:*' menu select
+ zmodload zsh/complist
+ bindkey -M menuselect '^n' expand-or-complete
+ bindkey -M menuselect '^p' reverse-menu-complete
+
#+end_src
**** Vim bindings
#+begin_src shell :tangle ~/.config/zsh/zshrc
#+end_src
*** Plugins
I manage plugins using my own plugin manager, ZPE. https://git.sr.ht/~armaan/zpe
+
+Right now, I'm only using fast-syntax-highlighting. It's a really nice visual addition.
**** ZPE
#+begin_src conf :tangle ~/.config/zpe/repositories
- https://github.com/Aloxaf/fzf-tab
- https://github.com/zdharma/fast-syntax-highlighting
- https://github.com/rupa/z
+ https://github.com/zdharma/fast-syntax-highlighting
#+end_src
**** Zshrc
#+begin_src shell :tangle ~/.config/zsh/zshrc
source ~/Code/admone/admone.zsh
source ~/.config/zsh/fzf-bindings.zsh
- zpe-source fzf-tab/fzf-tab.zsh
- zstyle ':completion:*:descriptions' format '[%d]'
- zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1 --color=always $realpath'
- zstyle ':completion:*' completer _complete
- zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' \
- 'm:{a-zA-Z}={A-Za-z} l:|=* r:|=*'
- enable-fzf-tab
zpe-source fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
- export _Z_DATA="/home/armaa/.local/share/z"
- zpe-source z/z.sh
#+end_src
*** Functions
-**** Alert after long command
-#+begin_src shell :tangle ~/.config/zsh/zshrc
- alert() {
- notify-send --urgency=low -i ${(%):-%(?.terminal.error)} \
- ${history[$HISTCMD]%[;&|][[:space:]]##alert}
- }
-#+end_src
**** Time Zsh startup
#+begin_src shell :tangle ~/.config/zsh/zshrc
timezsh() {
echo "${color}All orphans cleaned!${reset}"
}
#+end_src
-**** ls every cd
-#+begin_src shell :tangle ~/.config/zsh/zshrc
- chpwd() {
- emulate -L zsh
- exa -lh --icons --git --group-directories-first
- }
-#+end_src
-**** Change default enter behavior
-If no command given, =ls=, if in a Git repo, =git status= as well.
-#+begin_src shell :tangle ~/.config/zsh/zshrc
- acheam-accept-line () {
- zle accept-line
- if [ ${#${(z)BUFFER}} -eq 0 ]; then
- echo
- exa -lh --icons --git --group-directories-first
- [ -d ".git" ] && git status
- fi
- }
- zle -N acheam-accept-line
- bindkey '^M' acheam-accept-line
-#+end_src
**** Setup anaconda
#+begin_src shell :tangle ~/.config/zsh/zshrc
zconda() {
0short() { curl -F"shorten=$1" "$zxz" ; }
0clip() { xclip -out | curl -F"file=@-;" "$zxz" ; }
#+end_src
-**** Swap two files
-#+begin_src shell :tangle ~/.config/zsh/zshrc
- sw() {
- mv $1 $1.tmp
- mv $2 $1
- mv $1.tmp $2
- }
-#+end_src
**** Finger
#+begin_src shell :tangle ~/.config/zsh/zshrc
finger() {