diff options
Diffstat (limited to 'zsh')
-rw-r--r-- | zsh/.zkbd/linux-unknown-linux-gnu | 26 | ||||
-rw-r--r-- | zsh/.zkbd/screen-256color-:0 | 26 | ||||
-rw-r--r-- | zsh/.zkbd/screen-:0 | 26 | ||||
-rw-r--r-- | zsh/.zkbd/xterm-termite-:0 | 26 | ||||
-rw-r--r-- | zsh/.zprofile | 42 | ||||
-rw-r--r-- | zsh/.zshenv | 8 | ||||
-rw-r--r-- | zsh/.zshrc | 118 |
7 files changed, 272 insertions, 0 deletions
diff --git a/zsh/.zkbd/linux-unknown-linux-gnu b/zsh/.zkbd/linux-unknown-linux-gnu new file mode 100644 index 0000000..d121321 --- /dev/null +++ b/zsh/.zkbd/linux-unknown-linux-gnu @@ -0,0 +1,26 @@ +typeset -g -A key + +key[F1]='^[[[A' +key[F2]='^[[[B' +key[F3]='^[[[C' +key[F4]='^[[[D' +key[F5]='^[[[E' +key[F6]='^[[17~' +key[F7]='^[[18~' +key[F8]='^[[19~' +key[F9]='^[[20~' +key[F10]='^[[21~' +key[F11]='^[[23~' +key[F12]='^[[24~' +key[Backspace]='^?' +key[Insert]='^[[2~' +key[Home]='^[[1~' +key[PageUp]='^[[5~' +key[Delete]='^[[3~' +key[End]='^[[4~' +key[PageDown]='^[[6~' +key[Up]='^[[A' +key[Left]='^[[D' +key[Down]='^[[B' +key[Right]='^[[C' +key[Menu]='''' diff --git a/zsh/.zkbd/screen-256color-:0 b/zsh/.zkbd/screen-256color-:0 new file mode 100644 index 0000000..65cc3a9 --- /dev/null +++ b/zsh/.zkbd/screen-256color-:0 @@ -0,0 +1,26 @@ +typeset -g -A key + +key[F1]='^[OP' +key[F2]='^[OQ' +key[F3]='^[OR' +key[F4]='^[OS' +key[F5]='^[[15~' +key[F6]='^[[17~' +key[F7]='^[[18~' +key[F8]='^[[19~' +key[F9]='^[[20~' +key[F10]='^[[21~' +key[F11]='^[[23~' +key[F12]='^[[24~' +key[Backspace]='^?' +key[Insert]='^[[2~' +key[Home]='^[[1~' +key[PageUp]='^[[5~' +key[Delete]='^[[3~' +key[End]='^[[4~' +key[PageDown]='^[[6~' +key[Up]='^[[A' +key[Left]='^[[D' +key[Down]='^[[B' +key[Right]='^[[C' +key[Menu]='''' diff --git a/zsh/.zkbd/screen-:0 b/zsh/.zkbd/screen-:0 new file mode 100644 index 0000000..65cc3a9 --- /dev/null +++ b/zsh/.zkbd/screen-:0 @@ -0,0 +1,26 @@ +typeset -g -A key + +key[F1]='^[OP' +key[F2]='^[OQ' +key[F3]='^[OR' +key[F4]='^[OS' +key[F5]='^[[15~' +key[F6]='^[[17~' +key[F7]='^[[18~' +key[F8]='^[[19~' +key[F9]='^[[20~' +key[F10]='^[[21~' +key[F11]='^[[23~' +key[F12]='^[[24~' +key[Backspace]='^?' +key[Insert]='^[[2~' +key[Home]='^[[1~' +key[PageUp]='^[[5~' +key[Delete]='^[[3~' +key[End]='^[[4~' +key[PageDown]='^[[6~' +key[Up]='^[[A' +key[Left]='^[[D' +key[Down]='^[[B' +key[Right]='^[[C' +key[Menu]='''' diff --git a/zsh/.zkbd/xterm-termite-:0 b/zsh/.zkbd/xterm-termite-:0 new file mode 100644 index 0000000..01f4e31 --- /dev/null +++ b/zsh/.zkbd/xterm-termite-:0 @@ -0,0 +1,26 @@ +typeset -g -A key + +key[F1]='^[OP' +key[F2]='^[OQ' +key[F3]='^[OR' +key[F4]='^[OS' +key[F5]='^[[15~' +key[F6]='^[[17~' +key[F7]='^[[18~' +key[F8]='^[[19~' +key[F9]='^[[20~' +key[F10]='^[[21~' +key[F11]='^[[23~' +key[F12]='^[[24~' +key[Backspace]='^?' +key[Insert]='^[[2~' +key[Home]='^[OH' +key[PageUp]='^[[5~' +key[Delete]='^[[3~' +key[End]='^[OF' +key[PageDown]='^[[6~' +key[Up]='^[[A' +key[Left]='^[[D' +key[Down]='^[[B' +key[Right]='^[[C' +key[Menu]='''' diff --git a/zsh/.zprofile b/zsh/.zprofile new file mode 100644 index 0000000..a8fd7d2 --- /dev/null +++ b/zsh/.zprofile @@ -0,0 +1,42 @@ +export PATH="$HOME"/.local/bin:"$PATH":"$HOME"/.gem/ruby/2.0.0/bin:$PLAN9/bin +export PLAN9=/usr/local/plan9 + +export XDG_CACHE_HOME="$HOME"/.cache +export XDG_CONFIG_HOME="$HOME"/.config +export XDG_DATA_HOME="$HOME"/.local/share + +export MPV_HOME="$XDG_CONFIG_HOME"/mpv +export GNUPGHOME="$XDG_CONFIG_HOME"/gnupg +export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc-2.0 +export XCOMPOSEFILE="$XDG_CONFIG_HOME"/X11/XCompose + +export ABSROOT="$HOME/build/abs" + +export EDITOR=vim +# Set vimrc's location and source it on vim startup +export VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | source $MYVIMRC' + +export PAGER=less +export LESSHISTFILE=- + +export LESSOPEN="|lesspipe.sh %s" +export LESSCOLORIZER=pygmentize + +export GREP_OPTIONS=--color=auto +export LESS=-R + +export BROWSER=firefox +export TERMINAL=termite + +export SDL_AUDIODRIVER=pulse + +export GTK_IM_MODULE=xim + +export SUDO_PROMPT=$'\e[31mSUDO\e[m password for \e[34m%p\e[m: ' + +export GOPATH=$HOME/code/go +export PATH=$PATH:$GOPATH/bin + +[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx "$HOME"/.config/X11/xinitrc +envoy -t gpg-agent +source <(envoy -p) diff --git a/zsh/.zshenv b/zsh/.zshenv new file mode 100644 index 0000000..2bfb3d1 --- /dev/null +++ b/zsh/.zshenv @@ -0,0 +1,8 @@ + +export XDG_CACHE_HOME=$HOME/.cache +export XDG_DATA_HOME=$HOME/.local/share + +export BROWSER=firefox + +export LESSHISTFILE="-" # ugh, stupid less. Disable ridiculous history file + diff --git a/zsh/.zshrc b/zsh/.zshrc new file mode 100644 index 0000000..01d6100 --- /dev/null +++ b/zsh/.zshrc @@ -0,0 +1,118 @@ +HISTFILE=~/.config/zsh/.zsh_history +HISTSIZE=500 +SAVEHIST=500 +setopt notify + +zstyle :compinstall filename "$HOME/.config/zsh/.zshrc" + +al=(colors + compinit + promptinit + vcs_info +) +autoload -Uz $al +compinit +promptinit +colors + +shellopts=(PROMPT_SUBST + completealiases + auto_cd +) +setopt $shellopts + +zmodload zsh/mapfile + +# Menu completion +zstyle ':completion:*' menu select + +if [[ $TERM == xterm-termite && $DISPLAY == ":0" ]]; then + . /etc/profile.d/vte.sh + __vte_osc7 +fi + +# Load all configs +#for f in ~/.config/zsh/zsh.d/*.zsh +# source $f + +source /usr/share/doc/pkgfile/command-not-found.zsh + +#zstyle ':vcs_info:*' check-for-changes true + +zstyle ':vcs_info:git*' stagedstr "✚ " +zstyle ':vcs_info:git*' unstagedstr "● " + +zstyle ':vcs_info:git*' formats "「%b %u%c%m」" + +zstyle ':vcs_info:*' enable git +precmd() { + vcs_info +} + +PS1=$'%{${fg[blue]}%}%B%~%b%{${fg[blue]}%} %B%#%b %{${fg[default]}%}' +#PS1=$'┌─[${fg[cyan]}%B%n%b ${fg[blue]}%B%~%b$fg[default]]\n└─╼ ' +RPS1='%{${fg[blue]}%}${vcs_info_msg_0_}%{${fg[default]}%}' + +# Vi keybindings +bindkey -v + +# Bind "<command mode> H" to run-help (man pages) +bindkey -M vicmd 'H' run-help +bindkey "^R" history-incremental-search-backward + +autoload -U edit-command-line +zle -N edit-command-line +bindkey -M vicmd 'e' edit-command-line + +########################### +## Aliasing and keybinding +## +alias wefree='weechat -a -r "/connect Freenode"' +ls_options='-F --color=auto --group-directories-first' +alias ls="ls $ls_options" +alias lsa="ls $ls_options -hAX" +alias lla="ls $ls_options -lhA" +alias df='df -h' +alias nano='nano -w' # No linewrap +alias ncmpcpp='ncmpcpp -c ~/.config/ncmpcpp/config' +alias 'cd..'='cd ..' +alias ',,'='..' +alias '...'='../..' +alias mkdir='mkdir -vp' +alias 'please?'='sudo $(history | tail -n1 | cut -c 8-)' +alias acp='acp -g' +alias amv='amv -g' + +# Use 'git's completions with 'hub' +if type compdef >/dev/null; then + compdef hub=git +fi + +# Colored man +man() { + env LESS_TERMCAP_mb=$(printf "\e[1;31m") \ + LESS_TERMCAP_md=$(printf "\e[1;31m") \ + LESS_TERMCAP_me=$(printf "\e[0m") \ + LESS_TERMCAP_se=$(printf "\e[0m") \ + LESS_TERMCAP_so=$(printf "\e[1;44;33m") \ + LESS_TERMCAP_ue=$(printf "\e[0m") \ + LESS_TERMCAP_us=$(printf "\e[1;32m") \ + man "$@" +} + +source ~/.config/zsh/.zkbd/$TERM-${${DISPLAY:t}:-$VENDOR-$OSTYPE} +[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line +[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line +[[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode +[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char +[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history +[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history +[[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char +[[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char +[[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" beginning-of-buffer-or-history +[[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" end-of-buffer-or-history + +alias sprin='curl -F "sprunge=<-" http://sprunge.us' +sprfile() { + curl -F "sprunge=<$1" http://sprunge.us +} |