dotfiles

My configuration files
git clone git://git.finwo.net/misc/dotfiles
Log | Files | Refs

commit bac43c06e9ebeb99e7f6a65a686d9efc433bd808
parent ca648c9461eb64c94f6cd108d44c7282773a1a11
Author: finwo <finwo@pm.me>
Date:   Mon, 13 May 2019 17:59:49 +0200

zshrc now contains most-used features

Diffstat:
Mzsh/home/.zshrc | 77++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 74 insertions(+), 3 deletions(-)

diff --git a/zsh/home/.zshrc b/zsh/home/.zshrc @@ -1,18 +1,89 @@ +# vim:fdm=marker:fdl=0 -# History +# History {{{ + +# Track HISTFILE=~/.histfile HISTSIZE=1000000000 SAVEHIST=1000000000 setopt HIST_IGNORE_DUPS bindkey -v -# History search +# Search [[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" history-beginning-search-backward [[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" history-beginning-search-forward -# Aliases +# }}} +# Aliases {{{ + +# VI command -v "nvim" &>/dev/null && alias vim="nvim" command -v "vim" &>/dev/null && alias vi="vim" +# LS +alias ls="ls --color=always" +alias ll="ls -lsa" + +# $EDITOR +command -v ed &>/dev/null && export EDITOR=ed +command -v vi &>/dev/null && export EDITOR=vi +command -v vim &>/dev/null && export EDITOR=vim +command -v nvim &>/dev/null && export EDITOR=nvim + +# }}} +# Auto-correct {{{ + +# Correction +setopt correct +setopt correctall + +# Command not found +if [[ -s '/etc/zsh_command_not_found' ]]; then + source '/etc/zsh_command_not_found' +fi + +# }}} +# Tab-completion {{{ + +# Command & folder completion +autoload -Uz compinit promptinit && compinit && promptinit +zstyle ':completion:*' menu select +setopt completealiases + +# Known_hosts +if [ -f "~/.ssh/known_hosts" ]; then + local knownhosts + knownhosts=( ${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*} ) + zstyle ':completion:*:(ping|dig|ssh|scp|sftp|mosh|nc|ncat):*' hosts $knownhosts +fi + +# }}} +# Fixes {{{ + +# TERM +if [[ $TERM == screen* ]]; then + export TERM=${TERM#screen.} + export SCREEN=yes +fi + +# Auto-cd +setopt autocd + +# GPG +export GPG_TTY=$(tty) + +# npm-gyp performance +export npm_config_jobs=$(( $(nproc) + 1 )) + +# }}} +# Prompt {{{ + +autoload -U colors && colors +autoload -U promptinit && promptinit +prompt="%(?..[%{$fg[red]%}%?%{$reset_color%}] )%{$fg[yellow]%}%n%{$reset_color%}:%{$fg[green]%}%c%{$reset_color%}%# " +PROMPT_COMMAND= + +# }}} + # Load fzf [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh