From 1758e210f3e04e8b15874d403fea16fef8473b7b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 27 Dec 2015 02:31:25 -0500 Subject: [PATCH] zsh: clean up --- zsh/aliases | 4 +++- zsh/config | 41 ++++++++++++----------------------------- zsh/keybinds | 19 +++++-------------- zshrc | 1 - 4 files changed, 20 insertions(+), 45 deletions(-) diff --git a/zsh/aliases b/zsh/aliases index 2dae1029..155ca7ae 100644 --- a/zsh/aliases +++ b/zsh/aliases @@ -2,6 +2,8 @@ load aliases +autoload -U zmv + alias ?='since @$last' # Fast directory navigation @@ -12,7 +14,7 @@ if is-callable 'fasd' && is-callable 'fzf'; then fi # see functions/commacd alias ,,,='cd ${$(find ~/Dropbox/work -maxdepth 2 -type d | fzf):-.}' -alias ,/='fzf_project_root' +# alias ,/='fzf_project_root' zman() { PAGER="less -g -s '+/^ "$1"'" man zshall; } diff --git a/zsh/config b/zsh/config index 9c5f5197..26674c2f 100644 --- a/zsh/config +++ b/zsh/config @@ -1,27 +1,21 @@ #!/usr/bin/env zsh -autoload -U zmv - -# -# General -# +export GIT_MERGE_AUTOEDIT=no +## General # Treat these characters as part of a word. WORDCHARS='_-*?[]~&.;!#$%^(){}<>' -DIRSTACKSIZE=9 setopt BRACE_CCL # Allow brace character class list expansion. -setopt COMBINING_CHARS # Combine zero-length punctuation characters (accents) - # with the base character. -setopt RC_QUOTES # Allow 'Henry''s Garage' instead of 'Henry'\''s Garage'. +setopt COMBINING_CHARS # Combine zero-length punc chars (accents) with base char +setopt RC_QUOTES # Allow 'Henry''s Garage' instead of 'Henry'\''s Garage' +setopt HASH_LIST_ALL +unsetopt CORRECT_ALL +unsetopt NOMATCH unsetopt MAIL_WARNING # Don't print a warning message if a mail file has been accessed. - unsetopt BEEP # Hush now, quiet now. -# -# Jobs -# - +## Jobs setopt LONG_LIST_JOBS # List jobs in the long format by default. setopt AUTO_RESUME # Attempt to resume existing job before creating a new process. setopt NOTIFY # Report status of background jobs immediately. @@ -29,23 +23,14 @@ unsetopt BG_NICE # Don't run all background jobs at a lower priority. unsetopt HUP # Don't kill jobs on shell exit. unsetopt CHECK_JOBS # Don't report on jobs when shell exit. -export GIT_MERGE_AUTOEDIT=no -unsetopt CORRECT_ALL - -unsetopt NOMATCH -setopt HASH_LIST_ALL - -# -# History -# - +## History HISTFILE="${CACHE_DIR}/zhistory" HISTSIZE=10000 # Max events to store in internal history. SAVEHIST=10000 # Max events to store in history file. setopt BANG_HIST # Don't treat '!' specially during expansion. setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format. -setopt APPEND_HISTORY +setopt APPEND_HISTORY # Appends history to history file on exit setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits. setopt SHARE_HISTORY # Share history between all sessions. setopt HIST_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history. @@ -57,10 +42,8 @@ setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history setopt HIST_VERIFY # Do not execute immediately upon history expansion. setopt HIST_BEEP # Beep when accessing non-existent history. -# -# Directories -# - +## Directories +DIRSTACKSIZE=9 setopt AUTO_CD # Auto changes to a directory without typing cd. setopt AUTO_PUSHD # Push the old directory onto the stack on cd. setopt PUSHD_IGNORE_DUPS # Do not store duplicates in the stack. diff --git a/zsh/keybinds b/zsh/keybinds index 7954d4cd..7c39389b 100644 --- a/zsh/keybinds +++ b/zsh/keybinds @@ -16,10 +16,10 @@ zle -N change-surround surround bindkey -a cs change-surround bindkey -a ds delete-surround bindkey -a ys add-surround +bindkey -M visual S add-surround # text-objects if is-at-least 5.0.8; then - bindkey -M visual S add-surround autoload -U select-quoted; zle -N select-quoted for m in visual viopp; do for c in {a,i}{\',\",\`}; do @@ -48,22 +48,13 @@ bindkey -M viins '^g' push-line-or-edit bindkey -M viins '^a' beginning-of-line bindkey -M viins '^e' end-of-line +bindkey -M viins ' ' magic-space +bindkey -M vicmd '^k' kill-line +bindkey -M vicmd 'H' run-help + # Shift + Tab bindkey -M viins '^[[Z' reverse-menu-complete -bindkey -M viins ' ' magic-space - -# Vim keymaps -bindkey -M vicmd 'ga' what-cursor-position -bindkey -M vicmd '^k' kill-line -bindkey -M vicmd '?' history-incremental-pattern-search-forward -bindkey -M vicmd '/' history-incremental-pattern-search-backward -bindkey -M vicmd ':' execute-named-cmd -# Page up / Page down -bindkey -M vicmd 'H' run-help - -bindkey -s -M vicmd ',o' "tmux resize-pane -Z\n" - # bind UP and DOWN arrow keys bindkey '^[[A' history-substring-search-up bindkey '^[[B' history-substring-search-down diff --git a/zshrc b/zshrc index e040193e..22d31552 100644 --- a/zshrc +++ b/zshrc @@ -13,7 +13,6 @@ if ! zgen saved; then zgen load StackExchange/blackbox zgen load thewtex/tmux-mem-cpu-load zgen load joepvd/zsh-hints - zgen load unixorn/git-extra-commands zgen load hlissner/zsh-autopair "autopair.zsh" zgen load zsh-users/zsh-history-substring-search