From 5c784dae83490a5388f07f4da829c9974ae79ae4 Mon Sep 17 00:00:00 2001 From: druckdev <63563978+druckdev@users.noreply.github.com> Date: Tue, 6 Oct 2020 02:11:42 +0200 Subject: [PATCH] zsh:keys: Refactor and add comment --- .config/zsh/plugins/keys.zsh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.config/zsh/plugins/keys.zsh b/.config/zsh/plugins/keys.zsh index 80761f4..0cd2c18 100644 --- a/.config/zsh/plugins/keys.zsh +++ b/.config/zsh/plugins/keys.zsh @@ -85,12 +85,10 @@ zle -N _expandDots bindkey . _expandDots function ls-on-enter { - if [[ -z "$BUFFER" ]]; then - BUFFER=ls - zle accept-line - else - zle accept-line - fi + # Execute `ls` when enter is pressed without a command entered. + [[ -n "$BUFFER" ]] || BUFFER=ls + zle accept-line + # See fzf-hist below FZF_HIST_WENT_UP= }