+ Added zsh completion (from O-M-Z)
This commit is contained in:
parent
5465d1f7b5
commit
10bf2e49c0
6 changed files with 104 additions and 16 deletions
|
@ -10,6 +10,15 @@ rateUSD
|
|||
#python ~/Currency/USD2IDR/rate.py #PYTHON IS JUST TOO SLOW FOR TERMINAL
|
||||
#sh ~/.scripts/motd.sh
|
||||
|
||||
setopt auto_cd # auto cd if directory
|
||||
# highlight on tab (completion)
|
||||
[ -f ~/.config/zsh/completion ] && source ~/.config/zsh/completion
|
||||
# zstyle ':completion:*:*:git:*' script /usr/local/etc/bash_completion.d/git-completion.bash
|
||||
# fpath=(/usr/local/share/zsh-completions $fpath)
|
||||
# autoload -U compinit && compinit
|
||||
# zmodload -i zsh/complist
|
||||
# zstyle ':completion:*' menu select
|
||||
|
||||
# Alias
|
||||
[ -f ~/.config/zsh/aliases ] && source ~/.config/zsh/aliases
|
||||
|
||||
|
|
|
@ -48,12 +48,16 @@ alias storagelist='lsblk -f'
|
|||
alias ..='cd ..'
|
||||
alias ...='cd ../..'
|
||||
alias q='exit'
|
||||
|
||||
alias l='exa --color=always --group-directories-first' # my preferred listing
|
||||
alias ls='exa --color=always --group-directories-first' # my preferred listing
|
||||
alias la='exa -a --color=always --group-directories-first' # all files and dirs
|
||||
alias ll='exa -l --color=always --group-directories-first' # long format
|
||||
alias lla='exa -al --color=always --group-directories-first' # long format
|
||||
alias lt='exa -aT --color=always --group-directories-first' # tree listing
|
||||
alias md='mkdir -p'
|
||||
alias rd='rmdir'
|
||||
|
||||
alias reUSD='rm -rf /tmp/rate.html /tmp/rateUSD.txt'
|
||||
alias upElearn='sh $HOME/.scripts/elearning-isitup.sh'
|
||||
# alias old-ranger='ranger'
|
||||
|
@ -76,6 +80,7 @@ alias cfxprofile='vim $XDG_CONFIG_HOME/xprofile'
|
|||
alias cfcompt='vim $XDG_CONFIG_HOME/picom/picom.conf'
|
||||
alias cfenv='vim $XDG_CONFIG_HOME/zsh/.zshenv'
|
||||
alias cfmutt='vim $XDG_CONFIG_HOME/mutt/muttrc'
|
||||
alias cfnews='vim $XDG_CONFIG_HOME/newsboat/urls'
|
||||
|
||||
#more shortcuts
|
||||
alias htop='htop -t'
|
||||
|
@ -93,6 +98,10 @@ alias cdwine='cd "$HOME/.local/share/wineprefixes/"'
|
|||
|
||||
#Git Aliases
|
||||
alias gca='git commit --all'
|
||||
alias gr='git rm'
|
||||
alias gR='git restore'
|
||||
alias gs='git status'
|
||||
alias gp='git push'
|
||||
alias gP='git pull'
|
||||
alias gcl='git clone'
|
||||
alias config='/usr/bin/git --git-dir=$HOME/dotfiles/ --work-tree=$HOME'
|
||||
|
|
66
.config/zsh/completion
Normal file
66
.config/zsh/completion
Normal file
|
@ -0,0 +1,66 @@
|
|||
# vim: filetype=zsh
|
||||
zstyle ':completion:*:*:git:*' script /usr/local/etc/bash_completion.d/git-completion.bash
|
||||
fpath=(/usr/local/share/zsh-completions $fpath)
|
||||
autoload -U compinit && compinit
|
||||
zmodload -i zsh/complist
|
||||
zstyle ':completion:*' menu select
|
||||
|
||||
# case insensitive (all), partial-word and substring completion
|
||||
if [[ "$CASE_SENSITIVE" = true ]]; then
|
||||
zstyle ':completion:*' matcher-list 'r:|=*' 'l:|=* r:|=*'
|
||||
else
|
||||
if [[ "$HYPHEN_INSENSITIVE" = true ]]; then
|
||||
zstyle ':completion:*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' 'r:|=*' 'l:|=* r:|=*'
|
||||
else
|
||||
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'
|
||||
fi
|
||||
fi
|
||||
unset CASE_SENSITIVE HYPHEN_INSENSITIVE
|
||||
|
||||
# Complete . and .. special directories
|
||||
zstyle ':completion:*' special-dirs true
|
||||
|
||||
zstyle ':completion:*' list-colors ''
|
||||
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
|
||||
|
||||
if [[ "$OSTYPE" = solaris* ]]; then
|
||||
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm"
|
||||
else
|
||||
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w"
|
||||
fi
|
||||
|
||||
# disable named-directories autocompletion
|
||||
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
|
||||
|
||||
# Use caching so that commands like apt and dpkg complete are useable
|
||||
zstyle ':completion:*' use-cache yes
|
||||
zstyle ':completion:*' cache-path $ZSH_CACHE_DIR
|
||||
|
||||
# Don't complete uninteresting users
|
||||
zstyle ':completion:*:*:*:users' ignored-patterns \
|
||||
adm amanda apache at avahi avahi-autoipd beaglidx bin cacti canna \
|
||||
clamav daemon dbus distcache dnsmasq dovecot fax ftp games gdm \
|
||||
gkrellmd gopher hacluster haldaemon halt hsqldb ident junkbust kdm \
|
||||
ldap lp mail mailman mailnull man messagebus mldonkey mysql nagios \
|
||||
named netdump news nfsnobody nobody nscd ntp nut nx obsrun openvpn \
|
||||
operator pcap polkitd postfix postgres privoxy pulse pvm quagga radvd \
|
||||
rpc rpcuser rpm rtkit scard shutdown squid sshd statd svn sync tftp \
|
||||
usbmux uucp vcsa wwwrun xfs '_*'
|
||||
|
||||
# ... unless we really want to.
|
||||
zstyle '*' single-ignored show
|
||||
|
||||
if [[ $COMPLETION_WAITING_DOTS = true ]]; then
|
||||
expand-or-complete-with-dots() {
|
||||
# toggle line-wrapping off and back on again
|
||||
[[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti rmam
|
||||
print -Pn "%{%F{red}......%f%}"
|
||||
[[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti smam
|
||||
|
||||
zle expand-or-complete
|
||||
zle redisplay
|
||||
}
|
||||
zle -N expand-or-complete-with-dots
|
||||
bindkey "^I" expand-or-complete-with-dots
|
||||
fi
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue