From 894bbca4fbc62377e7017f9f090e9627a68e4f2b Mon Sep 17 00:00:00 2001 From: Donaldttt Date: Sat, 18 Jun 2022 03:41:05 -0400 Subject: [PATCH] add Usage --- bash_tools/fzf_file_seletor.sh | 44 ++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/bash_tools/fzf_file_seletor.sh b/bash_tools/fzf_file_seletor.sh index b1b9ca8..192cf90 100755 --- a/bash_tools/fzf_file_seletor.sh +++ b/bash_tools/fzf_file_seletor.sh @@ -2,6 +2,30 @@ # For any command require a file path, this function # helps to select the correct file with key words +# Usage: +# Add the command to desired list + +# fzf match everything +fzf_command_list_file=(\ +vim \ +set_wallpaper \ +) + +# fzf only match folder +fzf_command_list_dir=(\ +ls \ +cd \ +) + +# in case above functions are broken +no_fzf(){ + for c in "${fzf_command_list_file[@]}"; do + unalias $c + done + for c in "${fzf_command_list_dir[@]}"; do + unalias $c + done +} dp(){ local debug=0 @@ -87,17 +111,6 @@ fzf_command_execute() { $args "$ret" } - -fzf_command_list_file=(\ -vim \ -set_wallpaper \ -) - -fzf_command_list_dir=(\ -ls \ -cd \ -) - for c in "${fzf_command_list_file[@]}"; do alias $c="fzf_command_execute $c 0" done @@ -105,12 +118,3 @@ for c in "${fzf_command_list_dir[@]}"; do alias $c="fzf_command_execute $c 1" done -# in case above functions are broken -no_fzf(){ - for c in "${fzf_command_list_file[@]}"; do - unalias $c - done - for c in "${fzf_command_list_dir[@]}"; do - unalias $c - done -}