zsh: clean up

This commit is contained in:
Henrik Lissner 2015-12-27 02:31:25 -05:00
parent 14f76e61f7
commit 1758e210f3
4 changed files with 20 additions and 45 deletions

View file

@ -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; }

View file

@ -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.

View file

@ -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

1
zshrc
View file

@ -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