diff options
Diffstat (limited to '.zshrc')
-rw-r--r-- | .zshrc | 53 |
1 files changed, 53 insertions, 0 deletions
@@ -0,0 +1,53 @@ +autoload -U colors && colors +PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b " + +#History in cache directory +HISTSIZE=10000 +SAVEHIST=10000 +HISTFILE=~/.cache/zsh/history + +# Basic auto/tab complete: +autoload -U compinit +zstyle ':completion:*' menu select +zmodload zsh/complist +compinit +_comp_options+=(globdots) # Include hidden files + +#bindkey -v +#export KEYTIMEOUT=1 +source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh + +# Use vim keys in tab complete menu: +bindkey -M menuselect 'h' vi-backward-char +bindkey -M menuselect 'k' vi-up-line-or-history +bindkey -M menuselect 'l' vi-forward-char +bindkey -M menuselect 'j' vi-down-line-or-history +bindkey -M menuselect '^?' backward-delete-char + +# Use lf to switch directories and bind it to ctrl-o + +lfcd () { + tmp="$(mktemp)" + lf -last-dir-path="$tmp" "$@" + if [ -f "$tmp" ]; then + dir="$(cat "$tmp")" + rm -f "$tmp" + [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" + fi +} +bindkey -s '^o' 'lfcd\n' + +bindkey '^P' up-line-or-history +bindkey '^N' down-line-or-history +bindkey '^ ' autosuggest-accept +bindkey '^E' end-of-line +setopt NO_BEEP + +alias dict='dict_func' +dict_func() { command dict "$1" | colorit; } + +alias in='nvim' +alias ls='ls --color=auto' + +eval "$(zoxide init zsh)" |