Added work changes
This commit is contained in:
68
.zshrc
68
.zshrc
@@ -106,6 +106,74 @@ setopt share_history
|
||||
# alias zshconfig="mate ~/.zshrc"
|
||||
# alias ohmyzsh="mate ~/.oh-my-zsh"
|
||||
|
||||
#------------------------------------------------history start
|
||||
## HISTORY - ideas from https://github.com/mrnugget/dotfiles/blob/master/zshrc
|
||||
###########
|
||||
|
||||
HISTFILE=$HOME/.zsh_history
|
||||
HISTSIZE=50000
|
||||
SAVEHIST=50000
|
||||
|
||||
setopt EXTENDED_HISTORY
|
||||
setopt HIST_VERIFY
|
||||
setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history.
|
||||
setopt HIST_IGNORE_DUPS # Dont record an entry that was just recorded again.
|
||||
setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate.
|
||||
setopt HIST_FIND_NO_DUPS # Do not display a line previously found.
|
||||
setopt HIST_IGNORE_SPACE # Dont record an entry starting with a space.
|
||||
setopt HIST_SAVE_NO_DUPS # Dont write duplicate entries in the history file.
|
||||
|
||||
setopt inc_append_history
|
||||
setopt share_history
|
||||
#-----------------------------------------------history end
|
||||
|
||||
#------------------------------------------------keybindings start
|
||||
# KEY BINDINGS - also from https://github.com/mrnugget/dotfiles/blob/master/zshrc
|
||||
|
||||
# Vim Keybindings
|
||||
bindkey -v
|
||||
|
||||
# Open line in Vim by pressing 'v' in Command-Mode
|
||||
autoload -U edit-command-line
|
||||
zle -N edit-command-line
|
||||
bindkey -M vicmd v edit-command-line
|
||||
|
||||
# Push current line to buffer stack, return to PS1
|
||||
bindkey "^Q" push-input
|
||||
|
||||
# Make up/down arrow put the cursor at the end of the line
|
||||
# instead of using the vi-mode mappings for these keys
|
||||
bindkey "\eOA" up-line-or-history
|
||||
bindkey "\eOB" down-line-or-history
|
||||
bindkey "\eOC" forward-char
|
||||
bindkey "\eOD" backward-char
|
||||
|
||||
# CTRL-R to search through history
|
||||
bindkey '^R' history-incremental-search-backward
|
||||
# CTRL-S to search forward in history
|
||||
bindkey '^S' history-incremental-search-forward
|
||||
# Accept the presented search result
|
||||
bindkey '^Y' accept-search
|
||||
|
||||
# Use the arrow keys to search forward/backward through the history,
|
||||
# using the first word of what's typed in as search word
|
||||
bindkey '^[[A' history-search-backward
|
||||
bindkey '^[[B' history-search-forward
|
||||
|
||||
# Use the same keys as bash for history forward/backward: Ctrl+N/Ctrl+P
|
||||
bindkey '^P' history-search-backward
|
||||
bindkey '^N' history-search-forward
|
||||
|
||||
# Backspace working the way it should
|
||||
bindkey '^?' backward-delete-char
|
||||
bindkey '^[[3~' delete-char
|
||||
|
||||
# Some emacs keybindings won't hurt nobody
|
||||
bindkey '^A' beginning-of-line
|
||||
bindkey '^E' end-of-line
|
||||
|
||||
#------------------------------------------------keybindings end
|
||||
|
||||
# Source zsh aliases
|
||||
#
|
||||
source $HOME/.zsh_aliases
|
||||
|
||||
Reference in New Issue
Block a user