close #1115
This commit is contained in:
parent
58b06ee021
commit
fc6dc7b761
1 changed files with 9 additions and 6 deletions
|
@ -10,7 +10,7 @@ setopt interactive_comments
|
||||||
# History in cache directory:
|
# History in cache directory:
|
||||||
HISTSIZE=10000000
|
HISTSIZE=10000000
|
||||||
SAVEHIST=10000000
|
SAVEHIST=10000000
|
||||||
HISTFILE=~/.cache/zsh/history
|
HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/history"
|
||||||
|
|
||||||
# Load aliases and shortcuts if existent.
|
# Load aliases and shortcuts if existent.
|
||||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
|
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
|
||||||
|
@ -53,25 +53,28 @@ preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
|
||||||
|
|
||||||
# Use lf to switch directories and bind it to ctrl-o
|
# Use lf to switch directories and bind it to ctrl-o
|
||||||
lfcd () {
|
lfcd () {
|
||||||
tmp="$(mktemp)"
|
tmp="$(mktemp -uq)"
|
||||||
|
trap 'rm -f $tmp >/dev/null 2>&1' HUP INT QUIT TERM PWR EXIT
|
||||||
lf -last-dir-path="$tmp" "$@"
|
lf -last-dir-path="$tmp" "$@"
|
||||||
if [ -f "$tmp" ]; then
|
if [ -f "$tmp" ]; then
|
||||||
dir="$(cat "$tmp")"
|
dir="$(cat "$tmp")"
|
||||||
rm -f "$tmp" >/dev/null
|
|
||||||
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
|
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
bindkey -s '^o' 'lfcd\n'
|
bindkey -s '^o' '^ulfcd\n'
|
||||||
|
|
||||||
bindkey -s '^a' 'bc -lq\n'
|
bindkey -s '^a' '^ubc -lq\n'
|
||||||
|
|
||||||
bindkey -s '^f' 'cd "$(dirname "$(fzf)")"\n'
|
bindkey -s '^f' '^ucd "$(dirname "$(fzf)")"\n'
|
||||||
|
|
||||||
bindkey '^[[P' delete-char
|
bindkey '^[[P' delete-char
|
||||||
|
|
||||||
# Edit line in vim with ctrl-e:
|
# Edit line in vim with ctrl-e:
|
||||||
autoload edit-command-line; zle -N edit-command-line
|
autoload edit-command-line; zle -N edit-command-line
|
||||||
bindkey '^e' edit-command-line
|
bindkey '^e' edit-command-line
|
||||||
|
bindkey -M vicmd '^[[P' vi-delete-char
|
||||||
|
bindkey -M vicmd '^e' edit-command-line
|
||||||
|
bindkey -M visual '^[[P' vi-delete
|
||||||
|
|
||||||
# Load syntax highlighting; should be last.
|
# Load syntax highlighting; should be last.
|
||||||
source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null
|
source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null
|
||||||
|
|
Loading…
Reference in a new issue