Browse Source

Switch fasd distro #fishshell

Colin Powell 6 years ago
parent
commit
8f25c5e5ce

+ 1 - 1
config/fish/completions/a.fish

@@ -1 +1 @@
-complete -c a -a "(__fasd_print_completion -a)" -f -A
+complete -c a -a "(__fasd_print_completion -a)" -f

+ 1 - 1
config/fish/completions/d.fish

@@ -1 +1 @@
-complete -c d -a "(__fasd_print_completion -d)" -f -A
+complete -c d -a "(__fasd_print_completion -d)" -f

+ 1 - 1
config/fish/completions/f.fish

@@ -1 +1 @@
-complete -c f -a "(__fasd_print_completion -f)" -f -A
+complete -c f -a "(__fasd_print_completion -f)" -f

+ 18 - 1
config/fish/completions/fasd.fish

@@ -1 +1,18 @@
-complete -c fasd -a "(__fasd_print_completion)" -f -A
+# suggest paths
+complete -c fasd -a "(__fasd_print_completion)" -f
+
+# suggest args
+complete -c fasd -s s -d "List all paths and scores" -f
+complete -c fasd -s l -d "List paths without scores" -f
+complete -c fasd -s i -d "Interactive mode" -f
+complete -c fasd -s e -a (echo subl atom) -d "Set command to execute on the result file" -f
+complete -c fasd -s b -a (echo spotlight viminfo recently-used current) -d "Only use given backend" -f
+complete -c fasd -s B -a (echo spotlight viminfo recently-used current) -d "Add additional backend" -f
+complete -c fasd -s a -d "Match files and directories" -f
+complete -c fasd -s d -d "Match directories only" -f
+complete -c fasd -s f -d "Match files only" -f
+complete -c fasd -s r -d "Match by rank only" -f
+complete -c fasd -s t -d "Match by recent access only" -f
+complete -c fasd -s R -d "Reverse listing order" -f
+complete -c fasd -s h -d "Show a brief help message" -f
+# complete -c fasd -s [0-9] "Select the nth entry"

+ 0 - 1
config/fish/completions/fasd_cd.fish

@@ -1 +0,0 @@
-complete -c fasd_cd -a "(__fasd_print_completion -d)" -f -A

+ 1 - 1
config/fish/completions/s.fish

@@ -1 +1 @@
-complete -c s -a "(__fasd_print_completion)" -f -A
+complete -c s -a "(__fasd_print_completion)" -f

+ 1 - 1
config/fish/completions/sd.fish

@@ -1 +1 @@
-complete -c sd -a "(__fasd_print_completion -d)" -f -A
+complete -c sd -a "(__fasd_print_completion -d)" -f

+ 1 - 1
config/fish/completions/sf.fish

@@ -1 +1 @@
-complete -c sf -a "(__fasd_print_completion -f)" -f -A
+complete -c sf -a "(__fasd_print_completion -f)" -f

+ 1 - 1
config/fish/completions/z.fish

@@ -1 +1 @@
-complete -c z -a "(__fasd_print_completion -d)" -f -A
+complete -c z -a "(__fasd_print_completion -d)" -f

+ 1 - 1
config/fish/completions/zz.fish

@@ -1 +1 @@
-complete -c zz -a "(__fasd_print_completion -d)" -f -A
+complete -c zz -a "(__fasd_print_completion -d)" -f

+ 5 - 5
config/fish/conf.d/__fasd_run.fish

@@ -1,6 +1,6 @@
-function __fasd_run -e fish_preexec -d "fasd takes record of the directories changed into"
-    if test $argv[1] != "exit"
-        command fasd --proc (command fasd --sanitize "$argv") > "/dev/null" 2>&1 &
-    end
+function __fasd_run -e fish_postexec -d "fasd takes record of the directories changed into"
+  set -lx RETVAL $status
+  if test $RETVAL -eq 0 # if there was no error
+    command fasd --proc (command fasd --sanitize (eval echo "$argv") | tr -s " " \n) > "/dev/null" 2>&1 &
+  end
 end
-  

+ 0 - 1
config/fish/conf.d/fisher.fish

@@ -1 +0,0 @@
-fisher copy-user-key-bindings

+ 5 - 1
config/fish/conf.d/fzf.fish

@@ -5,5 +5,9 @@ set -q FZF_PREVIEW_FILE_CMD; or set -U FZF_PREVIEW_FILE_CMD "head -n 10"
 set -q FZF_PREVIEW_DIR_CMD; or set -U FZF_PREVIEW_DIR_CMD "ls"
 
 function fzf_uninstall -e fzf_uninstall
-  # Erase env vars and __fzf functions here.
+    set -l _vars (set | command grep -E "^FZF.*\$" | command awk '{print $1;}')
+    for var in $_vars
+        echo $var
+        eval (set -e $var)
+    end
 end

+ 4 - 1
config/fish/conf.d/fzf_key_bindings.fish

@@ -37,5 +37,8 @@ if set -q FZF_COMPLETE
 end
 
 function fzf_key_bindings_uninstall -e fzf_key_bindings_uninstall
-  # Erase key bindings here.
+    set -l _bindings (bind -a | sed -En "s/(')?__fzf.*\$//p" | sed 's/bind/bind -e/')
+    for binding in $_bindings
+        eval $binding
+    end
 end

+ 1 - 0
config/fish/fish_variables

@@ -14,6 +14,7 @@ SETUVAR Z_DATA_DIR:/Users/colinpowell/\x2elocal/share/z
 SETUVAR Z_EXCLUDE:/Users/colinpowell
 SETUVAR __fish_init_2_39_8:\x1d
 SETUVAR __fish_init_2_3_0:\x1d
+SETUVAR __fish_init_3_x:\x1d
 SETUVAR __tf_func:function\x20__tf_alias\x20\x2dd\x20\x22Correct\x20your\x20previous\x20console\x20command\x22\x3b\x20\x20set\x20\x2dl\x20fucked_up_command\x20\x24history\x5b1\x5d\x3b\x20\x20env\x20TF_SHELL\x3dfish\x20TF_ALIAS\x3d__tf_alias\x20PYTHONIOENCODING\x3dutf\x2d8\x20thefuck\x20\x24fucked_up_command\x20\x7c\x20read\x20\x2dl\x20unfucked_command\x3b\x20\x20if\x20\x5b\x20\x22\x24unfucked_command\x22\x20\x21\x3d\x20\x22\x22\x20\x5d\x3b\x20\x20\x20\x20eval\x20\x24unfucked_command\x3b\x20\x20\x20\x20builtin\x20history\x20delete\x20\x2d\x2dexact\x20\x2d\x2dcase\x2dsensitive\x20\x2d\x2d\x20\x24fucked_up_command\x3b\x20\x20\x20\x20builtin\x20history\x20merge\x20\x5e\x20/dev/null\x3b\x20\x20end\x3bend\x3b
 SETUVAR __tf_vers:The\x20Fuck\x203\x2e28\x20using\x20Python\x203\x2e7\x2e1\x20and\x20Fish\x20Shell\x202\x2e7\x2e1
 SETUVAR budspencer_colors:000000\x1e083743\x1e445659\x1efdf6e3\x1eb58900\x1ecb4b16\x1edc121f\x1eaf005f\x1e6c71c4\x1e268bd2\x1e2aa198\x1e859900

+ 1 - 1
config/fish/fishfile

@@ -1,6 +1,6 @@
 jethrokuan/z
 jethrokuan/fzf
-fishgretel/fasd
+adityavm/fasd
 2m/fish-gpg-tty
 asdf-vm/asdf
 edc/bass

+ 1 - 1
config/fish/functions/__fasd_print_completion.fish

@@ -1,5 +1,5 @@
+# suggest paths for current args as completion
 function __fasd_print_completion
   set cmd (commandline -po)
   test (count $cmd) -ge 2; and fasd $argv $cmd[2..-1] -l
 end
- 

+ 2 - 2
config/fish/functions/a.fish

@@ -1,3 +1,3 @@
-function a -d "fasd match files and directories"
-  command fasd -a $argv
+function a -d "Match files and directories"
+  fasd -a $argv
 end

+ 2 - 2
config/fish/functions/asdf.fish

@@ -9,7 +9,7 @@ set -l asdf_data_dir (
 set -l asdf_bin_dirs $asdf_dir/bin $asdf_dir/shims $asdf_data_dir/shims
 
 for x in $asdf_bin_dirs
-  if begin not contains $x $PATH; and test -d $x; end
-    set -gx PATH $x $PATH
+  if begin not contains $x $fish_user_paths; and test -d $x; end
+    set -gx fish_user_paths $fish_user_paths $x
   end
 end

+ 2 - 2
config/fish/functions/d.fish

@@ -1,3 +1,3 @@
-function d -d "fasd match directories only"
-  command fasd -d $argv
+function d -d "Match directories only"
+  fasd -d $argv
 end

+ 2 - 2
config/fish/functions/f.fish

@@ -1,3 +1,3 @@
-function f -d "fasd match files only"
-  command fasd -f $argv
+function f -d "Match files only"
+  fasd -f $argv
 end

+ 2 - 2
config/fish/functions/s.fish

@@ -1,3 +1,3 @@
-function s -d "fasd show, search, select"
-  command fasd -si $argv
+function s -d "Interactively select from all"
+  fasd -is $argv
 end

+ 2 - 2
config/fish/functions/sd.fish

@@ -1,3 +1,3 @@
-function sd -d "fasd interactive directory selection"
-  command fasd -sid $argv
+function sd -d "Interactively select directory"
+  fasd -isd $argv
 end

+ 2 - 2
config/fish/functions/sf.fish

@@ -1,3 +1,3 @@
-function sf -d "fasd interactive file selection"
-  command fasd -sif $argv
+function sf -d "Interactively select file"
+  fasd -isf $argv
 end

+ 1 - 1
config/fish/functions/z.fish

@@ -1,3 +1,3 @@
-function z -d "fasd cd, same functionality as j in autojump"
+function z -d "Change directory to first match"
   fasd_cd -d $argv
 end

+ 2 - 2
config/fish/functions/zz.fish

@@ -1,3 +1,3 @@
-function zz -d "fasd cd with interactive selection"
-  fasd_cd -di $argv
+function zz -d "Change directory with interactive selection"
+  fasd_cd -id $argv
 end