refactored some stuff

This commit is contained in:
Nikolas Weger 2020-09-06 13:52:58 +02:00
parent b7f1b05b8e
commit d31941c80c
4 changed files with 51 additions and 5 deletions

View file

@ -1,5 +1,7 @@
zmodload -i zsh/complist
WORDCHARS=''
unsetopt menu_complete
unsetopt flowcontrol
setopt auto_menu
@ -18,8 +20,13 @@ zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
zstyle ':completion::complete:*' use-cache 1
zstyle ':completion::complete:*' cache-path "$HOME/.cache/zsh/compcache/"
zstyle ':completion:*:*:*:users' ignored-patterns adm amanda apache at avahi avahi-autoipd backup beaglidx bin bitcoin bitwarden_rs cacti canna clamav ceph colord consul couchdb cups daemon dbus dhcp dhcpcd distcache dnsdist dnsmasq dovecot eeleater elasticsearch fax flatpak flaskdemo ftp games gdm geoclue git gitea gkrellmd gluster gopher gophernicus gnats hacluster haldaemon halt hsqldb http ident irc junkbust kdm kibana landscape ldap lightdm list lldpd logstash lp lxd mail mailman mailnull man mattermost messagebus mldonkey mongodb mxisd mysql nagios named netdata netdump news nfsnobody nm-openvpn nobody nscd ntp nut nvidia-persistenced nweger nx obsrun openvpn operator pcap pcp polkitd pollinate postfix postgres powerdns privoxy proxy pulse prosody puppet pvm quagga radiusd radvd redis rpc rpcuser rpm rtkit root scard sddm shutdown smmsp squid sshd statd stunnel svn synapse sync sys syslog systemd-coredump systemd-journal-remote systemd-network systemd-resolve systemd-timesync tcpdump teamspeak tftp tinyproxy tor transmission tss turnserver usbmux unbound uucp uuidd vault vcsa webvirtmgr wildfly wwwrun www-data xfs youtrack zabbix-agent zabbix-server zabbix zerotier-one zerotier '_*'
zstyle '*' single-ignored show
zstyle -e ':completion:*:(ssh|scp|sftp|rsh|rsync):hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })'
zstyle ':completion:*:(scp|rsync):*' tag-order 'hosts:-host:host hosts:-domain:domain hosts:-ipaddr:ip\ address *'
zstyle ':completion:*:(scp|rsync):*' group-order users files all-files hosts-domain hosts-host hosts-ipaddr

View file

@ -1,3 +1,20 @@
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init() {
echoti smkx
}
function zle-line-finish() {
echoti rmkx
}
zle -N zle-line-init
zle -N zle-line-finish
fi
bindkey -e
bindkey '\ew' kill-region
bindkey -s '\el' 'ls\n'
bindkey '^r' history-incremental-search-backward
if [[ "${terminfo[kpp]}" != "" ]]; then
bindkey "${terminfo[kpp]}" up-line-or-history
fi
@ -26,6 +43,17 @@ if [[ "${terminfo[kend]}" != "" ]]; then
bindkey "${terminfo[kend]}" end-of-line
fi
bindkey ' ' magic-space
bindkey '^[[1;5C' forward-word
bindkey '^[[1;5D' backward-word
if [[ "${terminfo[kcbt]}" != "" ]]; then
bindkey "${terminfo[kcbt]}" reverse-menu-complete
fi
bindkey '^?' backward-delete-char
if [[ "${terminfo[kdch1]}" != "" ]]; then
bindkey "${terminfo[kdch1]}" delete-char
else
@ -33,3 +61,9 @@ else
bindkey "^[3;5~" delete-char
bindkey "\e[3~" delete-char
fi
autoload -U edit-command-line
zle -N edit-command-line
bindkey '\C-x\C-e' edit-command-line
bindkey "^[m" copy-prev-shell-word

View file

@ -1,20 +1,25 @@
export path=($path $HOME/.config/dotfiles/bin)
export fpath=($fpath $ZDOTDIR/local/fpath)
source "$ZDOTDIR/dircolor.zsh"
source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
mkdir -p $HOME/.cache/zsh
autoload -Uz compinit bashcompinit
compinit -d $HOME/.cache/zsh/compdump
bashcompinit
for file in $ZDOTDIR/files/*.zsh; do source "$file"; done
source $ZDOTDIR/files/dircolor.zsh
source $ZDOTDIR/files/aliases.zsh
source $ZDOTDIR/files/completion.zsh
source $ZDOTDIR/files/history.zsh
source $ZDOTDIR/files/keybindings.zsh
source $ZDOTDIR/files/termsupport.zsh
source $ZDOTDIR/files/cnf.zsh
source $ZDOTDIR/files/fzf.zsh
[[ -f "$ZDOTDIR/local/rc.zsh" ]] && source "$ZDOTDIR/local/rc.zsh"
source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
export STARSHIP_CONFIG=$ZDOTDIR/starship.toml
eval "$(starship init zsh)"
eval "$(direnv hook zsh)"