From b7c3e8d5518d68a237a2c38abb49b10ae38d302d 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[@]}"