aboutsummaryrefslogtreecommitdiffstats
path: root/.zshrc
diff options
context:
space:
mode:
authorshmibs <shmibs@gmail.com>2014-06-04 22:32:48 -0700
committershmibs <shmibs@gmail.com>2014-06-04 22:32:48 -0700
commitfbee7cc9046bcb30b97b4e97bfc6f0cf0a21a637 (patch)
tree03aa73bfae35741d90db9b265a9eda535487075c /.zshrc
parent333b873ee6d27c6b42c2426f14591177bed08146 (diff)
downloaddotfiles-fbee7cc9046bcb30b97b4e97bfc6f0cf0a21a637.tar.gz
zsh keybindings
Diffstat (limited to '.zshrc')
-rw-r--r--.zshrc51
1 files changed, 47 insertions, 4 deletions
diff --git a/.zshrc b/.zshrc
index 6ecfdc6..63bc11d 100644
--- a/.zshrc
+++ b/.zshrc
@@ -11,8 +11,6 @@ HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt HIST_IGNORE_DUPS
-[[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" history-beginning-search-backward
-[[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" history-beginning-search-forward
# urxvt does visual mode just fine, and i don't compose
# any large strings in a shell, so treating it as always
@@ -20,9 +18,54 @@ setopt HIST_IGNORE_DUPS
bindkey -e
setopt notify
unsetopt beep
-#%(?..%{$fg[red]%}[e]%{$fg[white]%})
-PROMPT="%{%B$fg[white]%}[%{%(!.$fg[red].$fg[magenta])%}%n@%M %{$fg[blue]%}%~%{$fg[white]%}]: %{%b$reset_color%}"
+PROMPT="%{%B$fg[white]%}[%{%(!.$fg[red].$fg[magenta])%}%n@%M %{$fg[blue]%}%c%{$fg[white]%}]: %{%b$reset_color%}"
+
+################# KEYBINDINGS #################
+typeset -g -A key
+
+key[F1]='^[[11~'
+key[F2]='^[[12~'
+key[F3]='^[[13~'
+key[F4]='^[[14~'
+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]='^[[7~'
+key[PageUp]='^[[5~'
+key[Delete]='^[[3~'
+key[End]='^[[8~'
+key[PageDown]='^[[6~'
+key[Up]='^[[A'
+key[Left]='^[[D'
+key[Down]='^[[B'
+key[Right]='^[[C'
+
+bindkey ${key[Backspace]} backward-delete-char
+bindkey ${key[Insert]} overwrite-mode
+bindkey ${key[Home]} beginning-of-line
+bindkey ${key[Delete]} delete-char
+bindkey ${key[End]} end-of-line
+bindkey ${key[Up]} up-line-or-search
+bindkey ${key[Left]} backward-char
+bindkey ${key[Down]} down-line-or-search
+bindkey ${key[Right]} forward-char
+bindkey ${key[PageUp]} history-beginning-search-backward
+bindkey ${key[PageDown]} history-beginning-search-forward
+bindkey '^W' backward-kill-word
+bindkey '^U' backward-kill-line
+bindkey '^P' up-history
+bindkey '^N' down-history
+
+
+################### ALIASES ##################
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias diff='colordiff'