Pimped zsh config

This commit is contained in:
2020-05-23 10:10:24 +02:00
parent 401e2eac4c
commit e80d3cd1f4
6 changed files with 52 additions and 14 deletions

View File

@ -1,3 +1,16 @@
_exists() { (( $+commands[$1] )) }
_exists vim && export EDITOR=vim
_exists less && export PAGER=less
if _exists vim; then
alias vim="vim -p"
alias vi="vim"
fi
unfunction _exists
alias ls='ls --color=always -h'
alias ll='ls -la'
alias ...='cd ../..'

View File

@ -10,4 +10,11 @@ setopt hist_ignore_dups # ignore duplication command history list
setopt hist_ignore_space
setopt hist_verify
setopt inc_append_history
setopt share_history # share command history data
setopt share_history # share command history data
# Make up and down arrow take whats typed on the commandline in to account.
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search

View File

@ -9,8 +9,10 @@ bindkey "^[[5~" up-line-or-history
bindkey "^[[6~" down-line-or-history
# make search up and down work, so partially type and hit up/down to find relevant stuff
bindkey '^[[A' up-line-or-search
bindkey '^[[B' down-line-or-search
bindkey '^[[A' up-line-or-beginning-search # Arrow up
bindkey '^[OA' up-line-or-beginning-search
bindkey '^[[B' down-line-or-beginning-search # Arrow down
bindkey '^[OB' down-line-or-beginning-search
bindkey "^[[H" beginning-of-line
bindkey "^[[1~" beginning-of-line

View File

@ -9,10 +9,5 @@ bindkey "^[m" copy-prev-shell-word
setopt long_list_jobs
## pager
export PAGER=less
export LC_CTYPE=$LANG
export LC_ALL=de_DE.UTF-8
## editor
export EDITOR=vim

View File

@ -14,3 +14,12 @@ case `uname` in
hash -d www=/usr/local/www/ngineerx
;;
esac
insert_doas() { zle beginning-of-line; zle -U "doas " }
replace_rm() { zle beginning-of-line; zle delete-word; zle -U "rm " }
zle -N insert-doas insert_doas
zle -N replace-rm replace_rm
bindkey '^s' insert-doas
bindkey '^r' replace-rm