Files
dotfiles/dotfiles/zsh/zshrc
2020-06-15 13:42:11 +02:00

99 lines
2.0 KiB
Bash

export ZSH="/home/$USER/.ohmyzsh"
ZSH_THEME="the-one"
DISABLE_AUTO_UPDATE="true"
COMPLETION_WAITING_DOTS="true"
DISABLE_UNTRACKED_FILES_DIRTY="true"
plugins=(
git
compleat
common-aliases
ssh-agent
vi-mode
)
# https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins
# git: git shortcuts
# compleat: complete flags
# common-aliases: the name says it
# ssh-agent: preload ssh-keys
# vi-mode: use vim-bindings in zsh
zstyle :omz:plugins:ssh-agent identities
source $ZSH/oh-my-zsh.sh
# Exports
export TERM="xterm-256color"
export EDITOR="vim"
export LANG="en_US.UTF-8"
export PATH=$PATH:$HOME/.local/bin
# More Aliases
alias vimrc="vim ~/.vimrc"
alias dotf="cd ~/dotfiles/dotfiles"
alias dotdrop="~/dotfiles/dotdrop.sh" --cfg="~/dotfiles/config.yaml"
alias fonts="/home/$USER/.local/share/fonts"
alias listfonts="fc-list :scalable=true:spacing=mono: family"
alias cachefonts="fc-cache -f -v"
alias w="vim ~/vimwiki/index.md"
# Delay for vi-mode
KEYTIMEOUT=1
# Cursor thickness for vi-mode
function zle-keymap-select {
if [[ ${KEYMAP} == vicmd ]] ||
[[ $1 = 'block' ]]; then
echo -ne '\e[2 q'
elif [[ ${KEYMAP} == main ]] ||
[[ ${KEYMAP} == viins ]] ||
[[ ${KEYMAP} = '' ]] ||
[[ $1 = 'beam' ]]; then
echo -ne '\e[6 q'
fi
}
zle -N zle-keymap-select
_fix_cursor() {
echo -ne '\e[6 q'
}
precmd_functions+=(_fix_cursor)
# fzf
export FZF_DEFAULT_OPTS='--preview="head {}" --layout=reverse --bind=tab:down --bind=btab:up'
# fzf Bindings in zsh (C-r and C-t)
if [[ -x $(which fzf) ]]
then
source ~/.vim/bundle/fzf/shell/key-bindings.zsh
fi
# Local Aliases
if [ -f ~/.zshrc_local ]; then
source ~/.zshrc_local
fi
# Use C-z for 'fg'
fancy-ctrl-z () {
if [[ $#BUFFER -eq 0 ]]; then
BUFFER="fg"
zle accept-line
else
zle push-input
zle clear-screen
fi
}
zle -N fancy-ctrl-z
bindkey '^Z' fancy-ctrl-z
# Nord dir colors
test -r "~/.dir_colors" && eval $(dircolors ~/.dir_colors)