From c5da5d4b9bc4a77a631a31e8b97792313c5e5918 Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Tue, 12 Jul 2022 21:17:55 +0200 Subject: [PATCH] refactor(fzf): open vim only if result is not empty --- zshrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zshrc b/zshrc index 98ba060..71b0b8f 100644 --- a/zshrc +++ b/zshrc @@ -186,7 +186,10 @@ fdr() { # Find in files with ripgrep and fzf frg() { file=$(rg . --line-number | fzf | cut -d: -f1 -f2) - nvim $file + if [ "$file" != "" ] + then + nvim $file + fi } # fkill - kill process