dotfiles-zsh/.zshrc
finga 2c71349304 fzf: Look also in other path for the key bindings
In order to also work on Arch Linux also look in `/usr/share/fzf/` for
`key-bindings.zsh`.
2023-06-24 03:11:22 +02:00

76 lines
2 KiB
Bash

# The following lines were added by compinstall
zstyle ':completion:*' completer _complete _ignored
zstyle :compinstall filename '~/.zshrc'
# Completion
autoload -Uz compinit
compinit
HISTFILE=~/.zsh_history
HISTSIZE=5000000
SAVEHIST=5000000
setopt incappendhistory sharehistory beep nomatch notify autocd histignoredups correct autopushd pushdsilent pushdtohome pushdignoredups pushdminus
# emacs keybindings
bindkey -e
# do not put commands prefixed with space into history
setopt hist_ignore_space
# Prevent need to reset terminal
ttyctl -f
# Arrows in the Completition menu
zstyle ':completion:*' menu select
# colors
autoload -U colors && colors
# Load with prompt
autoload -U promptinit
promptinit
PROMPT="%{$fg_no_bold[blue]%}%n%{$reset_color%}%{$fg_no_bold[red]%}%#%{$reset_color%}%{$fg_no_bold[blue]%}%m%{$reset_color%}%{$fg_no_bold[green]%}%~:%{$fg_no_bold[yellow]%}%?%{$fg_no_bold[green]%}$ %{$reset_color%}"
RPROMPT="%{$fg_no_bold[green]%}%~%{$reset_color%} [%{$fg_no_bold[yellow]%}%*%{$reset_color%}]"
# Bashish navigation
autoload -U select-word-style
select-word-style bash
# Show cwd in titlebar
precmd() {
tab_label=${PWD/${HOME}/\~}
echo -ne "\e]2;${HOST}:${tab_label}\a"
}
# source banner
. ~/.banner
# Report CPU usage for commands running longer than 1 second
REPORTTIME=0
# Report Memory usage for commands running longer than 1 second
REPORTMEMORY=0
# Format reports
TIMEFMT="%J %U user %S system %P cpu %*E total, %X kB text space %D kB data/stack memory %M kB max. %K kB total, %O iops %I oops, %w waits %c ctx switches"
# Dirstack
DIRSTACKSIZE=20
# configure gpg agent
GPG_TTY=$(tty)
export GPG_TTY
# source fzf
if [ -e "/usr/share/doc/fzf/examples/key-bindings.zsh" ] ; then
. /usr/share/doc/fzf/examples/key-bindings.zsh
elif [ -e "/usr/share/fzf/key-bindings.zsh" ] ; then
. /usr/share/fzf/key-bindings.zsh
fi
# source virtualenvwrapper
if [ -e "/usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh" ] ; then
. /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh
fi