summaryrefslogtreecommitdiff
path: root/zsh
diff options
context:
space:
mode:
authorKjetil Ørbekk <kj@orbekk.com>2020-10-22 15:26:12 -0400
committerKjetil Ørbekk <kj@orbekk.com>2020-10-22 15:26:12 -0400
commit83eb32ac62d51ce639c84a09c9b0a8f31fa13c11 (patch)
tree2cd9c8922f3f5031708c245618be31cd05cfaa7c /zsh
parentf824666f35ca05d15a174200f99678b047b729cb (diff)
Change zshrc
Diffstat (limited to 'zsh')
-rw-r--r--zsh/.zshrc18
1 files changed, 18 insertions, 0 deletions
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.