From 83eb32ac62d51ce639c84a09c9b0a8f31fa13c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20=C3=98rbekk?= Date: Thu, 22 Oct 2020 15:26:12 -0400 Subject: Change zshrc --- zsh/.zshrc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'zsh/.zshrc') diff --git a/zsh/.zshrc b/zsh/.zshrc index 81a006b..6e31142 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -65,6 +65,24 @@ if [[ ! -f ~/.zsh/fast-syntax-highlighting/current_theme.zsh ]]; then fast-theme clean fi +# allow editing of command line +autoload -U edit-command-line +zle -N edit-command-line +bindkey "^V" edit-command-line + +function get-parent-dir() { + words=(${(z)LBUFFER}) + if [[ "${words[${#words}]}" = /* ]]; then + # There is already a path thing here. + words[${#words}]="${words[${#words}]:h}/" # Parent directory. + else + words=($words $PWD) + fi + LBUFFER="${words[@]}" +} +zle -N get-parent-dir +bindkey "^[u" get-parent-dir + source ~/.zshrc.local # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. -- cgit v1.2.3