From ad9a516eb8e938124fcd0d7ba6c560582c88b04f Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Tue, 31 Aug 2021 11:04:46 +0100 Subject: [PATCH] ZSH: make find file only give 1 result --- shells/zsh/includes/keybindings.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shells/zsh/includes/keybindings.zsh b/shells/zsh/includes/keybindings.zsh index bb3e48ee..bee2ee7d 100644 --- a/shells/zsh/includes/keybindings.zsh +++ b/shells/zsh/includes/keybindings.zsh @@ -164,7 +164,7 @@ find_current_file(){ return 0 fi # Next try locate with an exact filename match - filepath="$(locate "*/$lastWord")" + filepath="$(locate "*/$lastWord" | sed -n 1p)" if [ "$?" -eq 0 ]; then tokens[-1]="$filepath" LBUFFER="${tokens[@]}"