Remove silly message on logout display non-success exit value for every command Add first version of modules and load them up Add more paths Allow the sharing of prezto files by differentiating ZDOTDIR and where temp cache files will go: _ZDOTDIR/HOME remove Vim swap files Allow for both a shared and personal overriding .zpreztorc In shared system, put .zcompdump in user's home Fix path of .zcompdump Fixed names of prompt Support callbacks to override user & host value & style Fix transpose* bindings for vi and ^Y for emacs Fixed ordering of pathspull/340/head
parent
036407ce8f
commit
3e5e108eaa
@ -1,3 +1,5 @@
|
|||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
*.zwc
|
*.zwc
|
||||||
*.zwc.old
|
*.zwc.old
|
||||||
modules/*/cache.zsh
|
modules/*/cache.zsh
|
||||||
|
@ -0,0 +1,112 @@
|
|||||||
|
# Huy's enhancement of Prezto's bindings
|
||||||
|
#
|
||||||
|
# In VI insert mode, these control-keys are still available.
|
||||||
|
# (Plus all the escape command such as \eM)
|
||||||
|
# ^Y
|
||||||
|
# ^N (not a useful binding right now)
|
||||||
|
|
||||||
|
# These bindings depend on and work in conjunction with prezto's 'editor' module.
|
||||||
|
pmodload 'editor'
|
||||||
|
|
||||||
|
#
|
||||||
|
# ZLE Widgets
|
||||||
|
#
|
||||||
|
|
||||||
|
#zle -N insert-nth-last-word
|
||||||
|
function insert-next-to-last-word() { zle insert-last-word -- -1 -2 }
|
||||||
|
zle -N insert-next-to-last-word
|
||||||
|
function insert-more-recent-last-word() { zle insert-last-word -- 1 -1 }
|
||||||
|
zle -N insert-more-recent-last-word
|
||||||
|
function insert-more-recent-next-to-last-word() { zle insert-last-word -- 1 -2 }
|
||||||
|
zle -N insert-more-recent-next-to-last-word
|
||||||
|
zle -C hist-complete complete-word _generic
|
||||||
|
zstyle ':completion:hist-complete:*' completer _history
|
||||||
|
|
||||||
|
#
|
||||||
|
# Reset prezto's annoying bindings
|
||||||
|
#
|
||||||
|
|
||||||
|
# Undo terrible bindings in 'completion' module
|
||||||
|
# https://github.com/sorin-ionescu/prezto/issues/338
|
||||||
|
bindkey -M viins -r "jk"
|
||||||
|
bindkey -M viins -r "kj"
|
||||||
|
|
||||||
|
# Undo prezto's zsh-history-substring-search bindings
|
||||||
|
bindkey -M vicmd 'k' up-line-or-history
|
||||||
|
bindkey -M vicmd 'j' down-line-or-history
|
||||||
|
|
||||||
|
#
|
||||||
|
# Some Emacs Key Bindings
|
||||||
|
# Copied from 'editor' module.
|
||||||
|
# NOTE: we can't take the ones that are ambiguous: ESC k could mean
|
||||||
|
# "go to cmd mode and go up" and this ambiguity slows down vi mode.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Edit command in an external editor.
|
||||||
|
bindkey -M viins "$key_info[Control]X$key_info[Control]E" edit-command-line
|
||||||
|
|
||||||
|
if (( $+widgets[history-incremental-pattern-search-backward] )); then
|
||||||
|
bindkey -M viins "$key_info[Control]R" \
|
||||||
|
history-incremental-pattern-search-backward
|
||||||
|
bindkey -M viins "$key_info[Control]S" \
|
||||||
|
history-incremental-pattern-search-forward
|
||||||
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# Some Emacs and Vi Key Bindings (but for Vi command mode)
|
||||||
|
# Copied from 'editor' module.
|
||||||
|
#
|
||||||
|
|
||||||
|
for keymap in 'vicmd'; do
|
||||||
|
# Complete in the middle of word.
|
||||||
|
bindkey -M "$keymap" "$key_info[Control]I" expand-or-complete
|
||||||
|
|
||||||
|
# Use a more flexible push-line.
|
||||||
|
for key in "$key_info[Control]Q"
|
||||||
|
bindkey -M "$keymap" "$key" push-line-or-edit
|
||||||
|
done
|
||||||
|
|
||||||
|
#
|
||||||
|
# Custom bindings
|
||||||
|
#
|
||||||
|
|
||||||
|
# Just as with emacs
|
||||||
|
bindkey -M viins "$key_info[Control]T" transpose-chars
|
||||||
|
bindkey -M viins "$key_info[Escape]t" transpose-words
|
||||||
|
|
||||||
|
# Cancel the current completion (undo the <TAB> completion)
|
||||||
|
bindkey -M viins "$key_info[Control]Y" undo
|
||||||
|
|
||||||
|
# To be more like vim
|
||||||
|
bindkey -M vicmd 'J' vi-join
|
||||||
|
bindkey -M vicmd ':' execute-named-cmd
|
||||||
|
bindkey -M vicmd '_' execute-last-named-cmd
|
||||||
|
|
||||||
|
# Expand things
|
||||||
|
bindkey -M viins "$key_info[Control]P" hist-complete
|
||||||
|
|
||||||
|
# Pick out arguments from previous lines (in both directions)
|
||||||
|
bindkey -M viins "$key_info[Control]O" insert-last-word
|
||||||
|
bindkey -M viins "$key_info[Control]K" insert-more-recent-last-word
|
||||||
|
bindkey -M viins "$key_info[Control]E" insert-next-to-last-word
|
||||||
|
bindkey -M viins "$key_info[Control]A" insert-more-recent-next-to-last-word
|
||||||
|
|
||||||
|
# Complete on line-wise prefixes
|
||||||
|
bindkey -M viins "$key_info[Control]B" history-beginning-search-backward
|
||||||
|
bindkey -M vicmd "$key_info[Control]B" history-beginning-search-backward
|
||||||
|
bindkey -M viins "$key_info[Control]F" history-beginning-search-forward
|
||||||
|
bindkey -M vicmd "$key_info[Control]F" history-beginning-search-forward
|
||||||
|
|
||||||
|
# This allows you to edit your $PWD with the zle
|
||||||
|
for keymap in viins emacs
|
||||||
|
bindkey -M "$keymap" -s '^Z' $'cd $PWD\t'
|
||||||
|
|
||||||
|
#
|
||||||
|
# Marginally-useful bindigns
|
||||||
|
#
|
||||||
|
|
||||||
|
# Search in the history list for a line matching the current one and fetch
|
||||||
|
# the event following
|
||||||
|
bindkey '^N' infer-next-history # not very useful
|
||||||
|
|
||||||
|
unset key{map,}
|
@ -0,0 +1,10 @@
|
|||||||
|
# This file is to undo or reset some of the bad defaults in Prezto
|
||||||
|
|
||||||
|
# Undo terrible bindings in 'completion' module
|
||||||
|
# https://github.com/sorin-ionescu/prezto/issues/338
|
||||||
|
bindkey -M viins -r "jk"
|
||||||
|
bindkey -M viins -r "kj"
|
||||||
|
|
||||||
|
# People will do -h if they want to
|
||||||
|
alias df='df -k'
|
||||||
|
alias du='du -k'
|
@ -0,0 +1,66 @@
|
|||||||
|
# General utilities that should be useful for all of us
|
||||||
|
|
||||||
|
# Useful
|
||||||
|
setopt interactivecomments
|
||||||
|
setopt numericglobsort
|
||||||
|
setopt cshnullglob
|
||||||
|
# Report CPU usage stats if user+system > 5 seconds
|
||||||
|
REPORTTIME=5
|
||||||
|
|
||||||
|
# Minor
|
||||||
|
setopt histnostore
|
||||||
|
setopt kshoptionprint
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
### Global alias
|
||||||
|
|
||||||
|
alias -g ...='../..'
|
||||||
|
alias -g ....='../../..'
|
||||||
|
alias -g .....='../../../..'
|
||||||
|
|
||||||
|
# Use at the end of the line to quickly redirect
|
||||||
|
alias -g 1NUL=">/dev/null"
|
||||||
|
alias -g 2NUL="2>/dev/null"
|
||||||
|
alias -g NUL=">/dev/null 2>&1"
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
### Common commands
|
||||||
|
|
||||||
|
# Command line
|
||||||
|
function h {
|
||||||
|
history -d "${argv[1]:--$[ ${LINES:-24} - 3 ]}" "${(@)argv[2,-1]}" | $PAGER
|
||||||
|
}
|
||||||
|
|
||||||
|
### ls (which works on Linux, OS X, and OS X with GNU coreutils installed by Homebrew)
|
||||||
|
|
||||||
|
zstyle -s ':prezto:module:gnu-utility' prefix '_gnu_utility_p' || _gnu_utility_p='g'
|
||||||
|
|
||||||
|
if is-callable 'dircolors'; then
|
||||||
|
# GNU Core Utilities
|
||||||
|
_ls_color_flag=--color=always
|
||||||
|
else
|
||||||
|
# BSD Core Utilities
|
||||||
|
_ls_color_flag=-G
|
||||||
|
fi
|
||||||
|
|
||||||
|
# NOTE: The $_ls_color_flag goes after "$@" because prezto defines an alias which has
|
||||||
|
# --color=auto that we want to override
|
||||||
|
_gnu_utility_pcmd="${_gnu_utility_p}ls"
|
||||||
|
if (( ${+commands[${_gnu_utility_pcmd}]} )); then
|
||||||
|
_gnu_utility_ls="'${commands[${_gnu_utility_pcmd}]}'"
|
||||||
|
else
|
||||||
|
_gnu_utility_ls="command ls"
|
||||||
|
fi
|
||||||
|
eval "
|
||||||
|
function ls {
|
||||||
|
$_gnu_utility_ls -ACF \"\$@\" $_ls_color_flag | \$PAGER -e
|
||||||
|
}
|
||||||
|
"
|
||||||
|
alias ll="$aliases[ll] -a"
|
||||||
|
|
||||||
|
unset _gnu_utility_{p,cmds,cmd,pcmd,ls} _ls_color_flag
|
||||||
|
|
||||||
|
### Network commands
|
||||||
|
|
||||||
|
# Occasional commands
|
||||||
|
alias mtr='mtr --curses'
|
Loading…
Reference in new issue