Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for .fish files outside a functions directory #651

Closed
3 tasks done
jorgebucaran opened this issue Jan 18, 2021 · 7 comments
Closed
3 tasks done

Remove support for .fish files outside a functions directory #651

jorgebucaran opened this issue Jan 18, 2021 · 7 comments
Labels
enhancement New feature or bug fix

Comments

@jorgebucaran
Copy link
Owner

jorgebucaran commented Jan 18, 2021

Functions to functions/. Completions to completions/. Shell startup snippets to conf.d/. That leaves top-level .fish files out of place. Very much in line with Python's "there should be one—and preferably only one—obvious way to do it", and Fish's law of orthogonality, I want to drop support for top-level .fish files on principle.

I'm thinking of doing this in the following steps:

  • Move Fisher's top-level fisher.fish to functions/fisher.fish.
  • Update 4.x upgrade guide (How do I upgrade to Fisher 4.x? #652). Because we'll break old Fisher installations.
  • Remove support in 4.2.0 with a warning.

If a plugin suddenly stops working, nicely ask the maintainers to modernize it, or even better, send them a PR moving all top-level .fish files into the functions directory.

@jorgebucaran jorgebucaran added the enhancement New feature or bug fix label Jan 18, 2021
@jorgebucaran jorgebucaran pinned this issue Jan 18, 2021
dangh added a commit to dangh/withd.fish that referenced this issue Jan 18, 2021
dangh added a commit to dangh/fontface.fish that referenced this issue Jan 18, 2021
dangh added a commit to dangh/workspace.fish that referenced this issue Jan 18, 2021
@domoritz
Copy link

Hi @jorgebucaran. I got a warning about https://github.com/oh-my-fish/plugin-pyenv and https://github.com/oh-my-fish/plugin-cd not being supported anymore. I guess it's because of the init.fish files, right? Is it enough to just move them to conf.d/ or somewhere else? What about uninstall.fish in plugin-cd?

@jorgebucaran
Copy link
Owner Author

To modernize an Oh My Fish! plugin:

  1. Move init.fish to conf.d/plugin_name.fish
  2. Copy top-level functions ./*.fish to functions.
  3. Erase uninstall.fish. Use event system instead.

@domoritz
Copy link

dynamotn added a commit to dynamotn/fish-config that referenced this issue Feb 1, 2021
tsub added a commit to tsub/fish-fzf-ghq that referenced this issue Feb 6, 2021
tsub added a commit to tsub/fish-fzf-ghq that referenced this issue Feb 6, 2021
tsub added a commit to tsub/fish-fzf-git-recent-branch that referenced this issue Feb 6, 2021
rodrigobdz added a commit to rodrigobdz/mooji that referenced this issue Feb 17, 2021
Fix deprecation:
> Support for .fish files outside a functions directory is deprecated jorgebucaran/fisher#651
rodrigobdz added a commit to rodrigobdz/fish-apple-touchbar that referenced this issue Mar 1, 2021
rodrigobdz added a commit to rodrigobdz/fish-apple-touchbar that referenced this issue Mar 1, 2021
rodrigobdz added a commit to rodrigobdz/fish-apple-touchbar that referenced this issue Mar 2, 2021
* Uninstall: Rename file to conf.d/fish_apple_touchbar.fish

Follow fisher's recommended filename for file https://github.com/jorgebucaran/fisher/tree/56c629a3a9086f33eeae801598b2046cab9bea6b#event-system.

* Move init.fish to conf.d/plugin_name.fish

Follow fisher's recommendation jorgebucaran/fisher#651 (comment).

* Use long-format options in conf.d/fish_apple_touchbar.fish

Docs:
https://fishshell.com/docs/current/cmds/status.html
https://fishshell.com/docs/current/cmds/set.html
https://fishshell.com/docs/current/cmds/functions.html

* Move top-level fish functions to functions/

Follow fisher's recommendation jorgebucaran/fisher#651 (comment).

* Move functions/keybindings.fish to conf.d/fish_apple_touchbar.fish

Quote variables to fix fish linter error about missing argument for --on-event.
Follow fisher's recommended filename for file https://github.com/jorgebucaran/fisher/tree/56c629a3a9086f33eeae801598b2046cab9bea6b#event-system.

* Changelog: Document changes

* Conf.d: Fix install and uninstall events

Fixed typo in install function name.
Removed curly braces from variables, their values were including these—e.g. fish_apple_touchbar{_install}.

* Changelog: Document fixes

Disable markdownlint MD036 warning for specific line (exception).
kawamataryo added a commit to kawamataryo/dotfiles that referenced this issue Mar 3, 2021
diff --git a/private_dot_config/nvim/init.vim b/private_dot_config/nvim/init.vim
index 432a58f..81863f4 100644
--- a/private_dot_config/nvim/init.vim
+++ b/private_dot_config/nvim/init.vim
@@ -13,6 +13,7 @@ set hls                "検索した文字をハイライトする
 set smartindent        "改行入力行の末尾にあわせてインデントを増減する
 set ignorecase         "検索時に大文字小文字無視
 set pumheight=10       "補完メニューの高さ
+set mouse=a            "mouseスクロールONに

 " 空白文字を可視化
 augroup HighlightTrailingSpaces
@@ -70,10 +71,7 @@ Plug 'vim-airline/vim-airline'
 Plug 'neoclide/coc.nvim', {'branch': 'release'}

 " fzf
-Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } "coc-fzfに必要
-Plug 'yuki-yano/fzf-preview.vim', { 'branch': 'release/rpc' }
-Plug 'antoinemadec/coc-fzf'
-
+Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }

 " マルチカーソル
 Plug 'mg979/vim-visual-multi', {'branch': 'master'}
@@ -105,7 +103,14 @@ let  g:gruvbox_contrast_dark = 'hard'
 nmap <leader>e :CocCommand explorer<CR>

 "coc-fzfの起動
-nmap <C-o> :CocCommand fzf-preview.ProjectFiles<CR>
+nmap <Leader>f [fzf-p]
+xmap <Leader>f [fzf-p]
+nnoremap <silent> [fzf-p]p     :<C-u>CocCommand fzf-preview.FromResources project_mru git<CR>
+nnoremap <silent> [fzf-p]b     :<C-u>CocCommand fzf-preview.Buffers<CR>
+nnoremap <silent> [fzf-p]B     :<C-u>CocCommand fzf-preview.AllBuffers<CR>
+nnoremap <silent> [fzf-p]o     :<C-u>CocCommand fzf-preview.FromResources buffer project_mru<CR>
+nnoremap          [fzf-p]gr    :<C-u>CocCommand fzf-preview.ProjectGrep<Space><CR>
+nnoremap <silent> [fzf-p]l     :<C-u>CocCommand fzf-preview.LocationList<CR>

 "animate.vimのキーバインド windownsサイズの変更
 nnoremap <silent> <Up>    :call animate#window_delta_height(10)<CR>
diff --git a/private_dot_config/private_fish/private_functions/.keep b/private_dot_config/private_fish/private_functions/.keep
deleted file mode 100644
index e69de29..0000000
diff --git a/private_dot_config/private_fish/private_functions/__complete_ssh_host.fish b/private_dot_config/private_fish/private_functions/__complete_ssh_host.fish
deleted file mode 100644
index 7a28d6a..0000000
--- a/private_dot_config/private_fish/private_functions/__complete_ssh_host.fish
+++ /dev/null
@@ -1,27 +0,0 @@
-function __complete_ssh_host
-    type fzf >/dev/null || return 1
-
-    set -l ssh_config_files /etc/ssh/ssh_config ~/.ssh/config
-    for config_file_path in $ssh_config_files
-        for include_path in (command grep -ri Include $config_file_path | command grep -v '#' | string replace -ri -- '.*\s*Include\s+(.*)' '$1')
-            if string match -qri -- '^~/' $include_path
-                or string match -qri -- '^\$HOME/' $include_path
-                for file_path in (string split ' ' (eval echo $include_path))
-                    test -f $file_path
-                    and set ssh_config_files $ssh_config_files $file_path
-                end
-            else
-                for file_path in (string split ' ' (eval echo (dirname $config_file_path)/$include_path))
-                    test -f $file_path
-                    and set ssh_config_files $ssh_config_files $file_path
-                end
-            end
-        end
-    end
-    command egrep -i '^Host\s+.+' $ssh_config_files | string replace -ri '[^\s]+\s+(.*)' '$1' | string replace -ra '\s' ' ' | string split ' ' | command egrep -v '[*?]' | sort -u | fzf | tr '\n' ' ' | read -l host
-
-    if test -n "$host"
-        commandline -a "$host"
-    end
-    commandline -f repaint
-end
diff --git a/private_dot_config/private_fish/private_functions/__fzf_cd.fish b/private_dot_config/private_fish/private_functions/__fzf_cd.fish
deleted file mode 100644
index c79a725..0000000
--- a/private_dot_config/private_fish/private_functions/__fzf_cd.fish
+++ /dev/null
@@ -1,49 +0,0 @@
-function __fzf_cd -d "Change directory"
-    set -l commandline (__fzf_parse_commandline)
-    set -l dir $commandline[1]
-    set -l fzf_query $commandline[2]
-
-    if not type -q argparse
-        # Fallback for fish shell version < 2.7
-        function argparse
-            functions -e argparse # deletes itself
-        end
-        if contains -- --hidden $argv; or contains -- -h $argv
-            set _flag_hidden "yes"
-        end
-    end
-
-    # Fish shell version >= v2.7, use argparse
-    set -l options  "h/hidden"
-    argparse $options -- $argv
-
-    set -l COMMAND
-
-    set -q FZF_CD_COMMAND
-    or set -l FZF_CD_COMMAND "
-    command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \
-    -o -type d -print 2> /dev/null | sed 's@^\./@@'"
-
-    set -q FZF_CD_WITH_HIDDEN_COMMAND
-    or set -l FZF_CD_WITH_HIDDEN_COMMAND "
-    command find -L \$dir \
-    \\( -path '*/\\.git*' -o -fstype 'dev' -o -fstype 'proc' \\) -prune \
-    -o -type d -print 2> /dev/null | sed 1d | cut -b3-"
-
-    if set -q _flag_hidden
-        set COMMAND $FZF_CD_WITH_HIDDEN_COMMAND
-    else
-        set COMMAND $FZF_CD_COMMAND
-    end
-
-    eval "$COMMAND | "(__fzfcmd)" +m $FZF_DEFAULT_OPTS $FZF_CD_OPTS --query \"$fzf_query\"" | read -l select
-
-    if not test -z "$select"
-        builtin cd "$select"
-
-        # Remove last token from commandline.
-        commandline -t ""
-    end
-
-    commandline -f repaint
-end
diff --git a/private_dot_config/private_fish/private_functions/__fzf_complete.fish b/private_dot_config/private_fish/private_functions/__fzf_complete.fish
deleted file mode 100644
index e8848fa..0000000
--- a/private_dot_config/private_fish/private_functions/__fzf_complete.fish
+++ /dev/null
@@ -1,168 +0,0 @@
-##
-# Use fzf as fish completion widget.
-#
-#
-# When FZF_COMPLETE variable is set, fzf is used as completion
-# widget for the fish shell by binding the TAB key.
-#
-# FZF_COMPLETE can have some special numeric values:
-#
-#   `set FZF_COMPLETE 0` basic widget accepts with TAB key
-#   `set FZF_COMPLETE 1` extends 0 with candidate preview window
-#   `set FZF_COMPLETE 2` same as 1 but TAB walks on candidates
-#   `set FZF_COMPLETE 3` multi TAB selection, RETURN accepts selected ones.
-#
-# Any other value of FZF_COMPLETE is given directly as options to fzf.
-#
-# If you prefer to set more advanced options, take a look at the
-# `__fzf_complete_opts` function and override that in your environment.
-
-
-# modified from https://github.com/junegunn/fzf/wiki/Examples-(fish)#completion
-function __fzf_complete -d 'fzf completion and print selection back to commandline'
-    # As of 2.6, fish's "complete" function does not understand
-    # subcommands. Instead, we use the same hack as __fish_complete_subcommand and
-    # extract the subcommand manually.
-    set -l cmd (commandline -co) (commandline -ct)
-
-    switch $cmd[1]
-        case env sudo
-            for i in (seq 2 (count $cmd))
-                switch $cmd[$i]
-                    case '-*'
-                    case '*=*'
-                    case '*'
-                        set cmd $cmd[$i..-1]
-                        break
-                end
-            end
-    end
-
-    set -l cmd_lastw $cmd[-1]
-    set cmd (string join -- ' ' $cmd)
-
-    set -l initial_query ''
-    test -n "$cmd_lastw"; and set initial_query --query="$cmd_lastw"
-
-    set -l complist (complete -C$cmd)
-    set -l result
-
-    # do nothing if there is nothing to select from
-    test -z "$complist"; and return
-
-    set -l compwc (echo $complist | wc -w)
-    if test $compwc -eq 1
-        # if there is only one option dont open fzf
-        set result "$complist"
-    else
-
-        set -l query
-        string join -- \n $complist \
-        | eval (__fzfcmd) (string escape --no-quoted -- $initial_query) --print-query (__fzf_complete_opts) \
-        | cut -f1 \
-        | while read -l r
-            # first line is the user entered query
-            if test -z "$query"
-                set query $r
-            # rest of lines are selected candidates
-            else
-                set result $result $r
-            end
-          end
-
-        # exit if user canceled
-        if test -z "$query" ;and test -z "$result"
-            commandline -f repaint
-            return
-        end
-
-        # if user accepted but no candidate matches, use the input as result
-        if test -z "$result"
-            set result $query
-        end
-    end
-
-    set prefix (string sub -s 1 -l 1 -- (commandline -t))
-    for i in (seq (count $result))
-        set -l r $result[$i]
-        switch $prefix
-            case "'"
-                commandline -t -- (string escape -- $r)
-            case '"'
-                if string match '*"*' -- $r >/dev/null
-                    commandline -t --  (string escape -- $r)
-                else
-                    commandline -t -- '"'$r'"'
-                end
-            case '~'
-                commandline -t -- (string sub -s 2 (string escape -n -- $r))
-            case '*'
-                commandline -t -- $r
-        end
-        [ $i -lt (count $result) ]; and commandline -i ' '
-    end
-
-    commandline -f repaint
-end
-
-function __fzf_complete_opts_common
-    if set -q FZF_DEFAULT_OPTS
-        echo $FZF_DEFAULT_OPTS
-    end
-    echo --cycle --reverse --inline-info
-end
-
-function __fzf_complete_opts_tab_accepts
-    echo --bind tab:accept,btab:cancel
-end
-
-function __fzf_complete_opts_tab_walks
-    echo --bind tab:down,btab:up
-end
-
-function __fzf_complete_opts_preview
-    set -l file (status -f)
-    echo --with-nth=1 --preview-window=right:wrap --preview="fish\ '$file'\ __fzf_complete_preview\ '{1}'\ '{2..}'"
-end
-
-test "$argv[1]" = "__fzf_complete_preview"; and __fzf_complete_preview $argv[2..3]
-
-function __fzf_complete_opts_0 -d 'basic single selection with tab accept'
-    __fzf_complete_opts_common
-    echo --no-multi
-    __fzf_complete_opts_tab_accepts
-end
-
-function __fzf_complete_opts_1 -d 'single selection with preview and tab accept'
-    __fzf_complete_opts_0
-    __fzf_complete_opts_preview
-end
-
-function __fzf_complete_opts_2 -d 'single selection with preview and tab walks'
-    __fzf_complete_opts_1
-    __fzf_complete_opts_tab_walks
-end
-
-function __fzf_complete_opts_3 -d 'multi selection with preview'
-    __fzf_complete_opts_common
-    echo --multi
-    __fzf_complete_opts_preview
-end
-
-function __fzf_complete_opts -d 'fzf options for fish tab completion'
-    switch $FZF_COMPLETE
-        case 0
-            __fzf_complete_opts_0
-        case 1
-            __fzf_complete_opts_1
-        case 2
-            __fzf_complete_opts_2
-        case 3
-            __fzf_complete_opts_3
-        case '*'
-            echo $FZF_COMPLETE
-    end
-    if set -q FZF_COMPLETE_OPTS
-        echo $FZF_COMPLETE_OPTS
-    end
-end
diff --git a/private_dot_config/private_fish/private_functions/__fzf_complete_preview.fish b/private_dot_config/private_fish/private_functions/__fzf_complete_preview.fish
deleted file mode 100644
index 585ab92..0000000
--- a/private_dot_config/private_fish/private_functions/__fzf_complete_preview.fish
+++ /dev/null
@@ -1,31 +0,0 @@
-function __fzf_complete_preview -d 'generate preview for completion widget.
-    argv[1] is the currently selected candidate in fzf
-    argv[2] is a string containing the rest of the output produced by `complete -Ccmd`
-    '
-
-    if test "$argv[2]" = "Redefine variable"
-        # show environment variables current value
-        set -l evar (echo $argv[1] | cut -d= -f1)
-        echo $argv[1]$$evar
-    else
-        echo $argv[1]
-    end
-
-    set -l path (string replace "~" $HOME -- $argv[1])
-
-    # list directories on preview
-    if test -d "$path"
-        eval $FZF_PREVIEW_DIR_CMD (string escape $path)
-    end
-
-    # show ten lines of non-binary files preview
-    if test -f "$path"; and grep -qI . "$path"
-        eval $FZF_PREVIEW_FILE_CMD (string escape $path)
-    end
-
-    # if fish knows about it, let it show info
-    type -q "$path" 2>/dev/null; and type -a "$path"
-
-    # show aditional data
-    echo $argv[2]
-end
diff --git a/private_dot_config/private_fish/private_functions/__fzf_find_file.fish b/private_dot_config/private_fish/private_functions/__fzf_find_file.fish
deleted file mode 100644
index 1900006..0000000
--- a/private_dot_config/private_fish/private_functions/__fzf_find_file.fish
+++ /dev/null
@@ -1,29 +0,0 @@
-function __fzf_find_file -d "List files and folders"
-    set -l commandline (__fzf_parse_commandline)
-    set -l dir $commandline[1]
-    set -l fzf_query $commandline[2]
-
-    set -q FZF_FIND_FILE_COMMAND
-    or set -l FZF_FIND_FILE_COMMAND "
-    command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \
-    -o -type f -print \
-    -o -type d -print \
-    -o -type l -print 2> /dev/null | sed 's@^\./@@'"
-
-    begin
-        eval "$FZF_FIND_FILE_COMMAND | "(__fzfcmd) "-m $FZF_DEFAULT_OPTS $FZF_FIND_FILE_OPTS --query \"$fzf_query\"" | while read -l s; set results $results $s; end
-    end
-
-    if test -z "$results"
-        commandline -f repaint
-        return
-    else
-        commandline -t ""
-    end
-
-    for result in $results
-        commandline -it -- (string escape $result)
-        commandline -it -- " "
-    end
-    commandline -f repaint
-end
diff --git a/private_dot_config/private_fish/private_functions/__fzf_get_dir.fish b/private_dot_config/private_fish/private_functions/__fzf_get_dir.fish
deleted file mode 100644
index 77c873c..0000000
--- a/private_dot_config/private_fish/private_functions/__fzf_get_dir.fish
+++ /dev/null
@@ -1,17 +0,0 @@
-function __fzf_get_dir -d 'Find the longest existing filepath from input string'
-    set dir $argv
-
-    # Strip all trailing slashes. Ignore if $dir is root dir (/)
-    if test (string length $dir) -gt 1
-        set dir (string replace -r '/*$' '' $dir)
-    end
-
-    # Iteratively check if dir exists and strip tail end of path
-    while test ! -d "$dir"
-        # If path is absolute, this can keep going until ends up at /
-        # If path is relative, this can keep going until entire input is consumed, dirname returns "."
-        set dir (dirname "$dir")
-    end
-
-    echo $dir
-end
diff --git a/private_dot_config/private_fish/private_functions/__fzf_open.fish b/private_dot_config/private_fish/private_functions/__fzf_open.fish
deleted file mode 100644
index aa5ca61..0000000
--- a/private_dot_config/private_fish/private_functions/__fzf_open.fish
+++ /dev/null
@@ -1,63 +0,0 @@
-function __fzf_open -d "Open files and directories."
-    function __fzf_open_get_open_cmd -d "Find appropriate open command."
-        if type -q xdg-open
-            echo "xdg-open"
-        else if type -q open
-            echo "open"
-        end
-    end
-
-    set -l commandline (__fzf_parse_commandline)
-    set -l dir $commandline[1]
-    set -l fzf_query $commandline[2]
-
-    if not type -q argparse
-        set created_argparse
-        function argparse
-            functions -e argparse # deletes itself
-        end
-        if contains -- --editor $argv; or contains -- -e $argv
-            set _flag_editor "yes"
-        end
-        if contains -- --preview $argv; or contains -- -p $argv
-            set _flag_preview "yes"
-        end
-    end
-
-    set -l options "e/editor" "p/preview=?"
-    argparse $options -- $argv
-
-    set -l preview_cmd
-    if set -q FZF_ENABLE_OPEN_PREVIEW
-        set preview_cmd "--preview-window=right:wrap --preview='fish -c \"__fzf_complete_preview {}\"'"
-    end
-
-    set -q FZF_OPEN_COMMAND
-    or set -l FZF_OPEN_COMMAND "
-    command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \
-    -o -type f -print \
-    -o -type d -print \
-    -o -type l -print 2> /dev/null | sed 's@^\./@@'"
-
-    set -l select (eval "$FZF_OPEN_COMMAND | "(__fzfcmd) $preview_cmd "-m $FZF_DEFAULT_OPTS $FZF_OPEN_OPTS --query \"$fzf_query\"" | string escape)
-
-    # set how to open
-    set -l open_cmd
-    if set -q _flag_editor
-        set open_cmd "$EDITOR"
-    else
-        set open_cmd (__fzf_open_get_open_cmd)
-        if test -z "$open_cmd"
-            echo "Couldn't find appropriate open command to use. Do you have 'xdg-open' or 'open' installed?"; and return 1
-        end
-    end
-
-    set -l open_status 0
-    if not test -z "$select"
-        commandline "$open_cmd $select"; and commandline -f execute
-        set open_status $status
-    end
-
-    commandline -f repaint
-    return $open_status
-end
diff --git a/private_dot_config/private_fish/private_functions/__fzf_parse_commandline.fish b/private_dot_config/private_fish/private_functions/__fzf_parse_commandline.fish
deleted file mode 100644
index 2cc9dfb..0000000
--- a/private_dot_config/private_fish/private_functions/__fzf_parse_commandline.fish
+++ /dev/null
@@ -1,23 +0,0 @@
-function __fzf_parse_commandline -d 'Parse the current command line token and return split of existing filepath and rest of token'
-    # eval is used to do shell expansion on paths
-    set -l commandline (eval "printf '%s' "(commandline -t))
-
-    if test -z $commandline
-        # Default to current directory with no --query
-        set dir '.'
-        set fzf_query ''
-    else
-        set dir (__fzf_get_dir $commandline)
-
-        if test "$dir" = "." -a (string sub -l 1 $commandline) != '.'
-            # if $dir is "." but commandline is not a relative path, this means no file path found
-            set fzf_query $commandline
-        else
-            # Also remove trailing slash after dir, to "split" input properly
-            set fzf_query (string replace -r "^$dir/?" '' "$commandline")
-        end
-    end
-
-    echo $dir
-    echo $fzf_query
-end
diff --git a/private_dot_config/private_fish/private_functions/__fzf_reverse_isearch.fish b/private_dot_config/private_fish/private_functions/__fzf_reverse_isearch.fish
deleted file mode 100644
index 2ebbe20..0000000
--- a/private_dot_config/private_fish/private_functions/__fzf_reverse_isearch.fish
+++ /dev/null
@@ -1,6 +0,0 @@
-function __fzf_reverse_isearch
-    history merge
-    history -z | eval (__fzfcmd) --read0 --print0 --tiebreak=index --toggle-sort=ctrl-r $FZF_DEFAULT_OPTS $FZF_REVERSE_ISEARCH_OPTS -q '(commandline)' | read -lz result
-    and commandline -- $result
-    commandline -f repaint
-end
diff --git a/private_dot_config/private_fish/private_functions/__fzfcmd.fish b/private_dot_config/private_fish/private_functions/__fzfcmd.fish
deleted file mode 100644
index 821c650..0000000
--- a/private_dot_config/private_fish/private_functions/__fzfcmd.fish
+++ /dev/null
@@ -1,9 +0,0 @@
-function __fzfcmd
-    set -q FZF_TMUX; or set FZF_TMUX 0
-    set -q FZF_TMUX_HEIGHT; or set FZF_TMUX_HEIGHT 40%
-    if test $FZF_TMUX -eq 1
-        echo "fzf-tmux -d$FZF_TMUX_HEIGHT"
-    else
-        echo "fzf"
-    end
-end
diff --git a/private_dot_config/private_fish/private_functions/__ghq_repository_search.fish b/private_dot_config/private_fish/private_functions/__ghq_repository_search.fish
deleted file mode 100644
index fa19d16..0000000
--- a/private_dot_config/private_fish/private_functions/__ghq_repository_search.fish
+++ /dev/null
@@ -1,22 +0,0 @@
-function __ghq_repository_search -d 'Repository search'
-    set -l selector
-    [ -n "$GHQ_SELECTOR" ]; and set selector $GHQ_SELECTOR; or set selector fzf
-    set -l selector_options
-    [ -n "$GHQ_SELECTOR_OPTS" ]; and set selector_options $GHQ_SELECTOR_OPTS
-
-    if not type -qf $selector
-        printf "\nERROR: '$selector' not found.\n"
-        return 1
-    end
-
-    set -l query (commandline -b)
-    [ -n "$query" ]; and set flags --query="$query"; or set flags
-    switch "$selector"
-        case fzf fzf-tmux peco percol fzy sk
-            ghq list --full-path | "$selector" $selector_options $flags | read select
-        case \*
-            printf "\nERROR: plugin-ghq is not support '$selector'.\n"
-    end
-    [ -n "$select" ]; and cd "$select"
-    commandline -f repaint
-end
diff --git a/private_dot_config/private_fish/private_functions/__git.branch_has_wip.fish b/private_dot_config/private_fish/private_functions/__git.branch_has_wip.fish
deleted file mode 100644
index 60dc37f..0000000
--- a/private_dot_config/private_fish/private_functions/__git.branch_has_wip.fish
+++ /dev/null
@@ -1,3 +0,0 @@
-function __git.branch_has_wip -d "Returns 0 if branch has --wip--, otherwise 1"
-  git log -n 1 2>/dev/null | grep -qc "\-\-wip\-\-"
-end
diff --git a/private_dot_config/private_fish/private_functions/__git.current_branch.fish b/private_dot_config/private_fish/private_functions/__git.current_branch.fish
deleted file mode 100644
index 34f5324..0000000
--- a/private_dot_config/private_fish/private_functions/__git.current_branch.fish
+++ /dev/null
@@ -1,6 +0,0 @@
-function __git.current_branch -d "Output git's current branch name"
-  begin
-    git symbolic-ref HEAD; or \
-    git rev-parse --short HEAD; or return
-  end 2>/dev/null | sed -e 's|^refs/heads/||'
-end
diff --git a/private_dot_config/private_fish/private_functions/__git.destroy.fish b/private_dot_config/private_fish/private_functions/__git.destroy.fish
deleted file mode 100644
index 8b50e80..0000000
--- a/private_dot_config/private_fish/private_functions/__git.destroy.fish
+++ /dev/null
@@ -1,7 +0,0 @@
-function __git.destroy
-  for ab in $__git_plugin_abbreviations
-      abbr -e $ab
-  end
-  set -Ue __git_plugin_abbreviations
-  set -Ue __git_plugin_initialized
-end
diff --git a/private_dot_config/private_fish/private_functions/__git.init.fish b/private_dot_config/private_fish/private_functions/__git.init.fish
deleted file mode 100644
index 7f732bd..0000000
--- a/private_dot_config/private_fish/private_functions/__git.init.fish
+++ /dev/null
@@ -1,161 +0,0 @@
-function __git.init
-  function __git.create_abbr -d "Create Git plugin abbreviation"
-    set -l name $argv[1]
-    set -l body $argv[2..-1]
-    abbr -a $name $body
-    set -a __git_plugin_abbreviations $name
-  end
-
-  set -q __git_plugin_initialized; and exit 0
-
-  set -U __git_plugin_abbreviations
-
-  # git abbreviations
-  __git.create_abbr g          git
-  __git.create_abbr ga         git add
-  __git.create_abbr gaa        git add --all
-  __git.create_abbr gapa       git add --patch
-  __git.create_abbr gap        git apply
-  __git.create_abbr gb         git branch -vv
-  __git.create_abbr gba        git branch -a -v
-  __git.create_abbr gban       git branch -a -v --no-merged
-  __git.create_abbr gbd        git branch -d
-  __git.create_abbr gbD        git branch -D
-  __git.create_abbr gbl        git blame -b -w
-  __git.create_abbr gbs        git bisect
-  __git.create_abbr gbsb       git bisect bad
-  __git.create_abbr gbsg       git bisect good
-  __git.create_abbr gbsr       git bisect reset
-  __git.create_abbr gbss       git bisect start
-  __git.create_abbr gc         git commit -v
-  __git.create_abbr gc!        git commit -v --amend
-  __git.create_abbr gcn!       git commit -v --no-edit --amend
-  __git.create_abbr gca        git commit -v -a
-  __git.create_abbr gca!       git commit -v -a --amend
-  __git.create_abbr gcan!      git commit -v -a --no-edit --amend
-  __git.create_abbr gcv        git commit -v --no-verify
-  __git.create_abbr gcav       git commit -a -v --no-verify
-  __git.create_abbr gcav!      git commit -a -v --no-verify --amend
-  __git.create_abbr gcm        git commit -m
-  __git.create_abbr gcam       git commit -a -m
-  __git.create_abbr gscam      git commit -S -a -m
-  __git.create_abbr gcfx       git commit --fixup
-  __git.create_abbr gcf        git config --list
-  __git.create_abbr gcl        git clone
-  __git.create_abbr gclean     git clean -di
-  __git.create_abbr gclean!    git clean -dfx
-  __git.create_abbr gclean!!   "git reset --hard; and git clean -dfx"
-  __git.create_abbr gcount     git shortlog -sn
-  __git.create_abbr gcp        git cherry-pick
-  __git.create_abbr gcpa       git cherry-pick --abort
-  __git.create_abbr gcpc       git cherry-pick --continue
-  __git.create_abbr gd         git diff
-  __git.create_abbr gdca       git diff --cached
-  __git.create_abbr gds        git diff --stat
-  __git.create_abbr gdsc       git diff --stat --cached
-  __git.create_abbr gdw        git diff --word-diff
-  __git.create_abbr gdwc       git diff --word-diff --cached
-  __git.create_abbr gignore    git update-index --assume-unchanged
-  __git.create_abbr gf         git fetch
-  __git.create_abbr gfa        git fetch --all --prune
-  __git.create_abbr gfm        "git fetch origin master --prune; and git merge FETCH_HEAD"
-  __git.create_abbr gfo        git fetch origin
-  __git.create_abbr gl         git pull
-  __git.create_abbr gll        git pull origin
-  __git.create_abbr glr        git pull --rebase
-  __git.create_abbr glg        git log --stat --max-count=10
-  __git.create_abbr glgg       git log --graph --max-count=10
-  __git.create_abbr glgga      git log --graph --decorate --all
-  __git.create_abbr glo        git log --oneline --decorate --color
-  __git.create_abbr glog       git log --oneline --decorate --color --graph
-  __git.create_abbr glom       git log --oneline --decorate --color master..
-  __git.create_abbr glod       git log --oneline --decorate --color develop..
-  __git.create_abbr gloo       "git log --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=short"
-  __git.create_abbr gm         git merge
-  __git.create_abbr gmt        git mergetool --no-prompt
-  __git.create_abbr gp         git push
-  __git.create_abbr gp!        git push --force-with-lease
-  __git.create_abbr gpo        git push origin
-  __git.create_abbr gpo!       git push --force-with-lease origin
-  __git.create_abbr gpv        git push --no-verify
-  __git.create_abbr gpv!       git push --no-verify --force-with-lease
-  __git.create_abbr ggp!       ggp --force-with-lease
-  __git.create_abbr gpu        ggp --set-upstream
-  __git.create_abbr gr         git remote -vv
-  __git.create_abbr gra        git remote add
-  __git.create_abbr grb        git rebase
-  __git.create_abbr grba       git rebase --abort
-  __git.create_abbr grbc       git rebase --continue
-  __git.create_abbr grbi       git rebase --interactive
-  __git.create_abbr grbm       git rebase master
-  __git.create_abbr grbmi      git rebase master --interactive
-  __git.create_abbr grbmia     git rebase master --interactive --autosquash
-  __git.create_abbr grbd       git rebase develop
-  __git.create_abbr grbdi      git rebase master --interactive
-  __git.create_abbr grbdia     git rebase master --interactive --autosquash
-  __git.create_abbr grbs       git rebase --skip
-  __git.create_abbr grev       git revert
-  __git.create_abbr grh        git reset
-  __git.create_abbr grhh       git reset --hard
-  __git.create_abbr grm        git rm
-  __git.create_abbr grmc       git rm --cached
-  __git.create_abbr grmv       git remote rename
-  __git.create_abbr grrm       git remote remove
-  __git.create_abbr grs        git restore
-  __git.create_abbr grset      git remote set-url
-  __git.create_abbr grss       git restore --source
-  __git.create_abbr grup       git remote update
-  __git.create_abbr grv        git remote -v
-  __git.create_abbr gsh        git show
-  __git.create_abbr gsd        git svn dcommit
-  __git.create_abbr gsr        git svn rebase
-  __git.create_abbr gss        git status -s
-  __git.create_abbr gst        git status
-  __git.create_abbr gsta       git stash
-  __git.create_abbr gstd       git stash drop
-  __git.create_abbr gstp       git stash pop
-  __git.create_abbr gsts       git stash show --text
-  __git.create_abbr gsu        git submodule update
-  __git.create_abbr gsur       git submodule update --recursive
-  __git.create_abbr gsuri      git submodule update --recursive --init
-  __git.create_abbr gts        git tag -s
-  __git.create_abbr gtv        git tag | sort -V
-  __git.create_abbr gsw        git switch
-  __git.create_abbr gswc       git switch --create
-  __git.create_abbr gunignore  git update-index --no-assume-unchanged
-  __git.create_abbr gup        git pull --rebase
-  __git.create_abbr gwch       git whatchanged -p --abbrev-commit --pretty=medium
-
-  # git checkout abbreviations
-  __git.create_abbr gco        git checkout
-  __git.create_abbr gcb        git checkout -b
-  __git.create_abbr gcod       git checkout develop
-  __git.create_abbr gcom       git checkout master
-
-  # git flow abbreviations
-  __git.create_abbr gfb        git flow bugfix
-  __git.create_abbr gff        git flow feature
-  __git.create_abbr gfr        git flow release
-  __git.create_abbr gfh        git flow hotfix
-  __git.create_abbr gfs        git flow support
-
-  __git.create_abbr gfbs       git flow bugfix start
-  __git.create_abbr gffs       git flow feature start
-  __git.create_abbr gfrs       git flow release start
-  __git.create_abbr gfhs       git flow hotfix start
-  __git.create_abbr gfss       git flow support start
-
-  __git.create_abbr gfbt       git flow bugfix track
-  __git.create_abbr gfft       git flow feature track
-  __git.create_abbr gfrt       git flow release track
-  __git.create_abbr gfht       git flow hotfix track
-  __git.create_abbr gfst       git flow support track
-
-  __git.create_abbr gfp        git flow publish
-
-  # Cleanup declared functions
-  functions -e __git.create_abbr
-
-  # Mark git plugin as initialized
-  set -U __git_plugin_initialized (date)
-end
diff --git a/private_dot_config/private_fish/private_functions/__git.reset.fish b/private_dot_config/private_fish/private_functions/__git.reset.fish
deleted file mode 100644
index df2642f..0000000
--- a/private_dot_config/private_fish/private_functions/__git.reset.fish
+++ /dev/null
@@ -1,3 +0,0 @@
-function __git.reset
-  __git.destroy; and __git.init
-end
diff --git a/private_dot_config/private_fish/private_functions/__z.fish b/private_dot_config/private_fish/private_functions/__z.fish
deleted file mode 100644
index 981f281..0000000
--- a/private_dot_config/private_fish/private_functions/__z.fish
+++ /dev/null
@@ -1,172 +0,0 @@
-function __z -d "Jump to a recent directory."
-    function __print_help -d "Print z help."
-        printf "Usage: $Z_CMD  [-celrth] string1 string2...\n\n"
-        printf "         -c --clean    Removes directories that no longer exist from $Z_DATA\n"
-        printf "         -d --dir      Opens matching directory using system file manager.\n"
-        printf "         -e --echo     Prints best match, no cd\n"
-        printf "         -l --list     List matches and scores, no cd\n"
-        printf "         -p --purge    Delete all entries from $Z_DATA\n"
-        printf "         -r --rank     Search by rank\n"
-        printf "         -t --recent   Search by recency\n"
-        printf "         -x --delete   Removes the current directory from $Z_DATA\n"
-        printf "         -h --help     Print this help\n\n"
-    end
-    function __z_legacy_escape_regex
-        # taken from escape_string_pcre2 in fish
-        # used to provide compatibility with fish 2
-        for c in (string split '' $argv)
-            if contains $c (string split '' '.^$*+()?[{}\\|-]')
-                printf \\
-            end
-            printf '%s' $c
-        end
-    end
-
-    set -l options "h/help" "c/clean" "e/echo" "l/list" "p/purge" "r/rank" "t/recent" "d/directory" "x/delete"
-
-    argparse $options -- $argv
-
-    if set -q _flag_help
-        __print_help
-        return 0
-    else if set -q _flag_clean
-        __z_clean
-        printf "%s cleaned!\n" $Z_DATA
-        return 0
-    else if set -q _flag_purge
-        echo > $Z_DATA
-        printf "%s purged!\n" $Z_DATA
-        return 0
-    else if set -q _flag_delete
-        sed -i -e "\:^$PWD|.*:d" $Z_DATA
-        return 0
-    end
-
-    set -l typ
-
-    if set -q _flag_rank
-        set typ "rank"
-    else if set -q _flag_recent
-        set typ "recent"
-    end
-
-    set -l z_script '
-        function frecent(rank, time) {
-            dx = t-time
-            if( dx < 3600 ) return rank*4
-            if( dx < 86400 ) return rank*2
-            if( dx < 604800 ) return rank/2
-            return rank/4
-        }
-
-        function output(matches, best_match, common) {
-            # list or return the desired directory
-            if( list ) {
-                cmd = "sort -nr"
-                for( x in matches ) {
-                    if( matches[x] ) {
-                        printf "%-10s %s\n", matches[x], x | cmd
-                    }
-                }
-                if( common ) {
-                    printf "%-10s %s\n", "common:", common > "/dev/stderr"
-                }
-            } else {
-                if( common ) best_match = common
-                print best_match
-            }
-        }
-
-        function common(matches) {
-            # find the common root of a list of matches, if it exists
-            for( x in matches ) {
-                if( matches[x] && (!short || length(x) < length(short)) ) {
-                    short = x
-                }
-            }
-            if( short == "/" ) return
-            for( x in matches ) if( matches[x] && index(x, short) != 1 ) {
-                    return
-                }
-            return short
-        }
-
-        BEGIN {
-            hi_rank = ihi_rank = -9999999999
-        }
-        {
-            if( typ == "rank" ) {
-                rank = $2
-            } else if( typ == "recent" ) {
-                rank = $3 - t
-            } else rank = frecent($2, $3)
-            if( $1 ~ q ) {
-                matches[$1] = rank
-            } else if( tolower($1) ~ tolower(q) ) imatches[$1] = rank
-            if( matches[$1] && matches[$1] > hi_rank ) {
-                best_match = $1
-                hi_rank = matches[$1]
-            } else if( imatches[$1] && imatches[$1] > ihi_rank ) {
-                ibest_match = $1
-                ihi_rank = imatches[$1]
-            }
-        }
-
-        END {
-        # prefer case sensitive
-            if( best_match ) {
-                output(matches, best_match, common(matches))
-            } else if( ibest_match ) {
-                output(imatches, ibest_match, common(imatches))
-            }
-        }
-    '
-
-    set -l qs
-    for arg in $argv
-        set -l escaped $arg
-        if string escape --style=regex '' ^/dev/null >/dev/null # use builtin escape if available
-            set escaped (string escape --style=regex $escaped)
-        else
-            set escaped (__z_legacy_escape_regex $escaped)
-        end
-        # Need to escape twice, see https://www.math.utah.edu/docs/info/gawk_5.html#SEC32
-        set escaped (string replace --all \\ \\\\ $escaped)
-        set qs $qs $escaped
-    end
-    set -l q (string join '.*' $qs)
-
-    if set -q _flag_list
-        # Handle list separately as it can print common path information to stderr
-        # which cannot be captured from a subcommand.
-        command awk -v t=(date +%s) -v list="list" -v typ="$typ" -v q="$q" -F "|" $z_script "$Z_DATA"
-        return
-    end
-
-    set target (command awk -v t=(date +%s) -v typ="$typ" -v q="$q" -F "|" $z_script "$Z_DATA")
-
-    if test "$status" -gt 0
-        return
-    end
-
-    if test -z "$target"
-        printf "'%s' did not match any results\n" "$argv"
-        return 1
-    end
-
-    if set -q _flag_echo
-        printf "%s\n" "$target"
-    else if set -q _flag_directory
-        # Be careful, in msys2, explorer always return 1
-        if test "$OS" = Windows_NT
-            type -q explorer;and explorer "$target"; return 0;
-            echo "Cannot open file explorer"; return 1;
-        else
-            type -q xdg-open;and xdg-open "$target"; and return $status;
-            type -q open;and open "$target"; and return $status;
-            echo "Not sure how to open file manager"; and return 1;
-        end
-    else
-        pushd "$target"
-    end
-end
diff --git a/private_dot_config/private_fish/private_functions/__z_add.fish b/private_dot_config/private_fish/private_functions/__z_add.fish
deleted file mode 100644
index 35d53d6..0000000
--- a/private_dot_config/private_fish/private_functions/__z_add.fish
+++ /dev/null
@@ -1,47 +0,0 @@
-function __z_add -d "Add PATH to .z file"
-  for i in $Z_EXCLUDE
-    if string match -r $i $PWD > /dev/null
-      return 0 #Path excluded
-    end
-  end
-
-  set -l tmpfile (mktemp $Z_DATA.XXXXXX)
-
-  if test -f $tmpfile
-    set -l path (string replace --all \\ \\\\ $PWD)
-    command awk -v path=$path -v now=(date +%s) -F "|" '
-      BEGIN {
-          rank[path] = 1
-          time[path] = now
-      }
-      $2 >= 1 {
-          if( $1 == path ) {
-              rank[$1] = $2 + 1
-              time[$1] = now
-          }
-          else {
-              rank[$1] = $2
-              time[$1] = $3
-          }
-          count += $2
-      }
-      END {
-          if( count > 1000 ) {
-              for( i in rank ) print i "|" 0.9*rank[i] "|" time[i] # aging
-          }
-          else for( i in rank ) print i "|" rank[i] "|" time[i]
-      }
-    ' $Z_DATA 2>/dev/null >$tmpfile
-
-    if test ! -z "$Z_OWNER"
-      chown $Z_OWNER:(id -ng $Z_OWNER) $tmpfile
-    end
-    #
-    # Don't use redirection here as it can lead to a race condition where $Z_DATA is clobbered.
-    # Note: There is a still a possible race condition where an old version of $Z_DATA is
-    #       read by one instance of Fish before another instance of Fish writes its copy.
-    #
-    command mv $tmpfile $Z_DATA
-    or command rm $tmpfile
-  end
-end
diff --git a/private_dot_config/private_fish/private_functions/__z_clean.fish b/private_dot_config/private_fish/private_functions/__z_clean.fish
deleted file mode 100644
index 7d916c6..0000000
--- a/private_dot_config/private_fish/private_functions/__z_clean.fish
+++ /dev/null
@@ -1,11 +0,0 @@
-function __z_clean -d "Clean up .z file to remove paths no longer valid"
-  set -l tmpfile (mktemp $Z_DATA.XXXXXX)
-
-  if test -f $tmpfile
-    while read line
-        set -l path (string split '|' $line)[1]
-        test -d $path; and echo $line
-    end < $Z_DATA > $tmpfile
-    command mv -f $tmpfile $Z_DATA
-  end
-end
diff --git a/private_dot_config/private_fish/private_functions/__z_complete.fish b/private_dot_config/private_fish/private_functions/__z_complete.fish
deleted file mode 100644
index 3de5ccc..0000000
--- a/private_dot_config/private_fish/private_functions/__z_complete.fish
+++ /dev/null
@@ -1,16 +0,0 @@
-function __z_complete -d "add completions"
-  function __z_marks
-      printf "%s\n" (string replace -r '\|.*' '' < $Z_DATA)
-  end
-
-  complete -c $Z_CMD -a "(__z_marks)" -f
-  complete -c $ZO_CMD -a "(__z_marks)" -f
-
-  complete -c $Z_CMD -s c -l clean  -d "Cleans out $Z_DATA"
-  complete -c $Z_CMD -s e -l echo   -d "Prints best match, no cd"
-  complete -c $Z_CMD -s l -l list   -d "List matches, no cd"
-  complete -c $Z_CMD -s p -l purge  -d "Purges $Z_DATA"
-  complete -c $Z_CMD -s r -l rank   -d "Searches by rank, cd"
-  complete -c $Z_CMD -s t -l recent -d "Searches by recency, cd"
-  complete -c $Z_CMD -s h -l help   -d "Print help"
-end
diff --git a/private_dot_config/private_fish/private_functions/fisher.fish b/private_dot_config/private_fish/private_functions/fisher.fish
deleted file mode 100644
index 374be54..0000000
--- a/private_dot_config/private_fish/private_functions/fisher.fish
+++ /dev/null
@@ -1,212 +0,0 @@
-function fisher --argument-names cmd --description "A plugin manager for Fish"
-    set --query fisher_path || set --local fisher_path $__fish_config_dir
-    set --local fisher_version 4.2.0
-    set --local fish_plugins $__fish_config_dir/fish_plugins
-
-    switch "$cmd"
-        case -v --version
-            echo "fisher, version $fisher_version"
-        case "" -h --help
-            echo "Usage: fisher install <plugins...>  Install plugins"
-            echo "       fisher remove  <plugins...>  Remove installed plugins"
-            echo "       fisher update  <plugins...>  Update installed plugins"
-            echo "       fisher update                Update all installed plugins"
-            echo "       fisher list    [<regex>]     List installed plugins matching regex"
-            echo "Options:"
-            echo "       -v or --version  Print version"
-            echo "       -h or --help     Print this help message"
-        case ls list
-            string match --entire --regex -- "$argv[2]" $_fisher_plugins
-        case install update remove
-            isatty || read --local --null --array stdin && set --append argv $stdin
-
-            set --local install_plugins
-            set --local update_plugins
-            set --local remove_plugins
-            set --local arg_plugins $argv[2..-1]
-            set --local old_plugins $_fisher_plugins
-            set --local new_plugins
-
-            if ! set --query argv[2]
-                if test "$cmd" != update
-                    echo "fisher: Not enough arguments for command: \"$cmd\"" >&2 && return 1
-                else if test ! -e $fish_plugins
-                    echo "fisher: \"$fish_plugins\" file not found: \"$cmd\"" >&2 && return 1
-                end
-                set arg_plugins (string match --regex -- '^[^\s]+$' <$fish_plugins)
-            end
-
-            for plugin in $arg_plugins
-                test -e "$plugin" && set plugin (realpath $plugin)
-                contains -- "$plugin" $new_plugins || set --append new_plugins $plugin
-            end
-
-            if set --query argv[2]
-                for plugin in $new_plugins
-                    if contains -- "$plugin" $old_plugins
-                        test "$cmd" = remove &&
-                            set --append remove_plugins $plugin ||
-                            set --append update_plugins $plugin
-                    else if test "$cmd" = install
-                        set --append install_plugins $plugin
-                    else
-                        echo "fisher: Plugin not installed: \"$plugin\"" >&2 && return 1
-                    end
-                end
-            else
-                for plugin in $new_plugins
-                    contains -- "$plugin" $old_plugins &&
-                        set --append update_plugins $plugin ||
-                        set --append install_plugins $plugin
-                end
-
-                for plugin in $old_plugins
-                    contains -- "$plugin" $new_plugins || set --append remove_plugins $plugin
-                end
-            end
-
-            set --local pid_list
-            set --local source_plugins
-            set --local fetch_plugins $update_plugins $install_plugins
-            echo (set_color --bold)fisher $cmd version $fisher_version(set_color normal)
-
-            for plugin in $fetch_plugins
-                set --local source (command mktemp -d)
-                set --append source_plugins $source
-
-                command mkdir -p $source/{completions,conf.d,functions}
-
-                fish --command "
-                    if test -e $plugin
-                        command cp -Rf $plugin/* $source
-                    else
-                        set temp (command mktemp -d)
-                        set name (string split \@ $plugin) || set name[2] HEAD
-                        set url https://codeload.github.com/\$name[1]/tar.gz/\$name[2]
-
-                        echo Fetching (set_color --underline)\$url(set_color normal)
-
-                        if curl --silent \$url | tar --extract --gzip --directory \$temp --file - 2>/dev/null
-                            command cp -Rf \$temp/*/* $source
-                        else
-                            echo fisher: Invalid plugin name or host unavailable: \\\"$plugin\\\" >&2
-                            command rm -rf $source
-                        end
-                        command rm -rf \$temp
-                    end
-
-                    set files $source/* && string match --quiet --regex -- .+\.fish\\\$ \$files || exit
-
-                    echo \"fisher: Plugin not supported: \\\"$plugin\\\"\" >&2
-                    echo (set_color --bold red)\"Support for .fish files outside a functions directory is deprecated\" (set_color --underline)https://github.com/jorgebucaran/fisher/issues/651(set_color normal) >&2
-                " &
-
-                set --append pid_list (jobs --last --pid)
-            end
-
-            wait $pid_list 2>/dev/null
-
-            for plugin in $fetch_plugins
-                if set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] && test ! -e $source
-                    if set --local index (contains --index -- "$plugin" $install_plugins)
-                        set --erase install_plugins[$index]
-                    else
-                        set --erase update_plugins[(contains --index -- "$plugin" $update_plugins)]
-                    end
-                end
-            end
-
-            for plugin in $update_plugins $remove_plugins
-                if set --local index (contains --index -- "$plugin" $_fisher_plugins)
-                    set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files
-
-                    if contains -- "$plugin" $remove_plugins
-                        for name in (string replace --filter --regex -- '.+/conf\.d/([^/]+)\.fish$' '$1' $$plugin_files_var)
-                            emit {$name}_uninstall
-                        end
-                        printf "%s\n" Removing\ (set_color red --bold)$plugin(set_color normal) "         "$$plugin_files_var
-                    end
-
-                    command rm -rf $$plugin_files_var
-                    functions --erase (string replace --filter --regex -- '.+/functions/([^/]+)\.fish$' '$1' $$plugin_files_var)
-
-                    for name in (string replace --filter --regex -- '.+/completions/([^/]+)\.fish$' '$1' $$plugin_files_var)
-                        complete --erase --command $name
-                    end
-
-                    set --erase _fisher_plugins[$index]
-                    set --erase $plugin_files_var
-                end
-            end
-
-            if set --query update_plugins[1] || set --query install_plugins[1]
-                command mkdir -p $fisher_path/{functions,conf.d,completions}
-            end
-
-            for plugin in $update_plugins $install_plugins
-                set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)]
-                set --local files $source/{functions,conf.d,completions}/*
-
-                if set --local index (contains --index -- $plugin $install_plugins)
-                    set --local user_files $fisher_path/{functions,conf.d,completions}/*
-                    set --local conflict_files
-
-                    for file in (string replace -- $source/ $fisher_path/ $files)
-                        contains -- $file $user_files && set --append conflict_files $file
-                    end
-
-                    if set --query conflict_files[1] && set --erase install_plugins[$index]
-                        echo -s "fisher: Cannot install \"$plugin\": please remove or move conflicting files first:" \n"        "$conflict_files >&2
-                        continue
-                    end
-                end
-
-                for file in (string replace -- $source/ "" $files)
-                    command cp -Rf $source/$file $fisher_path/$file
-                end
-
-                set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files
-                set --query files[1] && set --universal $plugin_files_var (string replace -- $source $fisher_path $files)
-
-                contains -- $plugin $_fisher_plugins || set --universal --append _fisher_plugins $plugin
-                contains -- $plugin $install_plugins && set --local event install || set --local event update
-
-                printf "%s\n" Installing\ (set_color --bold)$plugin(set_color normal) "           "$$plugin_files_var
-
-                for file in (string match --regex -- '.+/[^/]+\.fish$' $$plugin_files_var)
-                    source $file
-                    if set --local name (string replace --regex -- '.+conf\.d/([^/]+)\.fish$' '$1' $file)
-                        emit {$name}_$event
-                    end
-                end
-            end
-
-            command rm -rf $source_plugins
-
-            set --query _fisher_plugins[1] || set --erase _fisher_plugins
-            set --query _fisher_plugins &&
-                printf "%s\n" $_fisher_plugins >$fish_plugins ||
-                command rm -f $fish_plugins
-
-            set --local total (count $install_plugins) (count $update_plugins) (count $remove_plugins)
-            test "$total" != "0 0 0" && echo (string join ", " (
-                test $total[1] = 0 || echo "Installed $total[1]") (
-                test $total[2] = 0 || echo "Updated $total[2]") (
-                test $total[3] = 0 || echo "Removed $total[3]")
-            ) plugin/s
-        case \*
-            echo "fisher: Unknown command: \"$cmd\"" >&2 && return 1
-    end
-end
-
-## Migrations ##
-function _fisher_fish_postexec --on-event fish_postexec
-    if functions --query _fisher_list
-        fisher update >/dev/null 2>/dev/null
-        set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share
-        test -e $XDG_DATA_HOME/fisher && command rm -rf $XDG_DATA_HOME/fisher
-        functions --erase _fisher_list _fisher_plugin_parse
-        set --erase fisher_data
-    end
-    functions --erase _fisher_fish_postexec
-end
diff --git a/private_dot_config/private_fish/private_functions/gbage.fish b/private_dot_config/private_fish/private_functions/gbage.fish
deleted file mode 100644
index d1f107d..0000000
--- a/private_dot_config/private_fish/private_functions/gbage.fish
+++ /dev/null
@@ -1,5 +0,0 @@
-function gbage -d "List local branches and display their age"
-  git for-each-ref --sort=committerdate refs/heads/ \
-    --format="%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))"
-end
-
diff --git a/private_dot_config/private_fish/private_functions/gbda.fish b/private_dot_config/private_fish/private_functions/gbda.fish
deleted file mode 100644
index d09fe2f..0000000
--- a/private_dot_config/private_fish/private_functions/gbda.fish
+++ /dev/null
@@ -1,5 +0,0 @@
-function gbda -d "Delete all branches merged in current HEAD"
-  git branch --merged | \
-    command grep -vE  '^\*|^\s*(master|main|develop)\s*$' | \
-    command xargs -n 1 git branch -d
-end
diff --git a/private_dot_config/private_fish/private_functions/gdt.fish b/private_dot_config/private_fish/private_functions/gdt.fish
deleted file mode 100644
index f1dee9b..0000000
--- a/private_dot_config/private_fish/private_functions/gdt.fish
+++ /dev/null
@@ -1,3 +0,0 @@
-function gdt -w "git diff" -d "List changed files"
-  git diff-tree --no-commit-id --name-only -r $argv
-end
diff --git a/private_dot_config/private_fish/private_functions/gdv.fish b/private_dot_config/private_fish/private_functions/gdv.fish
deleted file mode 100644
index cb648fe..0000000
--- a/private_dot_config/private_fish/private_functions/gdv.fish
+++ /dev/null
@@ -1,3 +0,0 @@
-function gdv -w "git diff -w" -d "Pipe `git diff` to `view` command"
-  git diff -w $argv | view -
-end
diff --git a/private_dot_config/private_fish/private_functions/ggl.fish b/private_dot_config/private_fish/private_functions/ggl.fish
deleted file mode 100644
index a748185..0000000
--- a/private_dot_config/private_fish/private_functions/ggl.fish
+++ /dev/null
@@ -1,3 +0,0 @@
-function ggl -w "git pull origin master" -d "git pull origin <current branch>"
-  git pull origin (__git.current_branch) $argv
-end
diff --git a/private_dot_config/private_fish/private_functions/ggp.fish b/private_dot_config/private_fish/private_functions/ggp.fish
deleted file mode 100644
index bf09636..0000000
--- a/private_dot_config/private_fish/private_functions/ggp.fish
+++ /dev/null
@@ -1,3 +0,0 @@
-function ggp -w "git push origin master" -d "git push origin <current branch>"
-  git push origin (__git.current_branch) $argv
-end
diff --git a/private_dot_config/private_fish/private_functions/ggpnp.fish b/private_dot_config/private_fish/private_functions/ggpnp.fish
deleted file mode 100644
index 0cbce88..0000000
--- a/private_dot_config/private_fish/private_functions/ggpnp.fish
+++ /dev/null
@@ -1,3 +0,0 @@
-function ggpnp -d "git pull & push origin <current branch>"
-  git pull origin (__git.current_branch); and git push origin (__git.current_branch)
-end
diff --git a/private_dot_config/private_fish/private_functions/ggsup.fish b/private_dot_config/private_fish/private_functions/ggsup.fish
deleted file mode 100644
index 4db2038..0000000
--- a/private_dot_config/private_fish/private_functions/ggsup.fish
+++ /dev/null
@@ -1,3 +0,0 @@
-function ggsup -d "git set upstream to origin/<current branch>"
-  git branch --set-upstream-to=origin/(__git.current_branch)
-end
diff --git a/private_dot_config/private_fish/private_functions/ggu.fish b/private_dot_config/private_fish/private_functions/ggu.fish
deleted file mode 100644
index 5c1f208..0000000
--- a/private_dot_config/private_fish/private_functions/ggu.fish
+++ /dev/null
@@ -1,3 +0,0 @@
-function ggu -d "Rebase the current branch on top of the upstream branch after fetching"
-  git pull --rebase origin (__git.current_branch)
-end
diff --git a/private_dot_config/private_fish/private_functions/gignored.fish b/private_dot_config/private_fish/private_functions/gignored.fish
deleted file mode 100644
index 622b223..0000000
--- a/private_dot_config/private_fish/private_functions/gignored.fish
+++ /dev/null
@@ -1,3 +0,0 @@
-function gignored -w 'grep "^[[:lower:]]"' -d "list temporarily ignored files"
-  git ls-files -v | grep "^[[:lower:]]" $argv
-end
diff --git a/private_dot_config/private_fish/private_functions/glp.fish b/private_dot_config/private_fish/private_functions/glp.fish
deleted file mode 100644
index 6b55085..0000000
--- a/private_dot_config/private_fish/private_functions/glp.fish
+++ /dev/null
@@ -1,5 +0,0 @@
-function glp -d "git log at requested pretty level" -a format
-  set -q format[1]; and git log --pretty=$format
-end
-
-complete -c glp -x -a "(complete -C 'git log --pretty=' | sed 's/^--pretty=//')"
diff --git a/private_dot_config/private_fish/private_functions/gpoat.fish b/private_dot_config/private_fish/private_functions/gpoat.fish
deleted file mode 100644
index 1254c10..0000000
--- a/private_dot_config/private_fish/private_functions/gpoat.fish
+++ /dev/null
@@ -1,3 +0,0 @@
-function gpoat -d "git push all + tags to origin"
-  git push origin --all; and git push origin --tags
-end
diff --git a/private_dot_config/private_fish/private_functions/grename.fish b/private_dot_config/private_fish/private_functions/grename.fish
deleted file mode 100644
index 90531a5..0000000
--- a/private_dot_config/private_fish/private_functions/grename.fish
+++ /dev/null
@@ -1,11 +0,0 @@
-function grename -d "Rename 'old' branch to 'new', including in origin remote" -a old new
-  if test (count $argv) -ne 2
-    echo "Usage: "(status -u)" old_branch new_branch"
-    return 1
-  end
-  git branch -m $old $new
-  git push origin :$old
-  and git push --set-upstream origin $new
-end
-
-complete -c grename -x -a "(complete -C 'git branch ')"
diff --git a/private_dot_config/private_fish/private_functions/grt.fish b/private_dot_config/private_fish/private_functions/grt.fish
deleted file mode 100644
index f70e0d0..0000000
--- a/private_dot_config/private_fish/private_functions/grt.fish
+++ /dev/null
@@ -1,3 +0,0 @@
-function grt -d "cd into the top of the current repository or submodule"
-  cd (git rev-parse --show-toplevel; or echo ".")
-end
diff --git a/private_dot_config/private_fish/private_functions/gtl.fish b/private_dot_config/private_fish/private_functions/gtl.fish
deleted file mode 100644
index 5ff8ae2..0000000
--- a/private_dot_config/private_fish/private_functions/gtl.fish
+++ /dev/null
@@ -1,3 +0,0 @@
-function gtl -d "List tags matching prefix" -a prefix
-  git tag --sort=-v:refname -n -l $prefix\*
-end
diff --git a/private_dot_config/private_fish/private_functions/gunwip.fish b/private_dot_config/private_fish/private_functions/gunwip.fish
deleted file mode 100644
index 91777e8..0000000
--- a/private_dot_config/private_fish/private_functions/gunwip.fish
+++ /dev/null
@@ -1,7 +0,0 @@
-# Work In Progress (wip)
-# These features allow to pause a branch development and switch to another one
-# When you want to go back to work, just unwip it
-#
-function gunwip -d "git uncommit the work-in-progress branch"
-  git log -n 1 | grep -q -c "\-\-wip\-\-"; and git reset HEAD~1
-end
diff --git a/private_dot_config/private_fish/private_functions/gwip.fish b/private_dot_config/private_fish/private_functions/gwip.fish
deleted file mode 100644
index 2d41368..0000000
--- a/private_dot_config/private_fish/private_functions/gwip.fish
+++ /dev/null
@@ -1,7 +0,0 @@
-# Work In Progress (wip)
-# These features allow to pause a branch development and switch to another one
-# When you want to go back to work, just unwip it
-#
-function gwip -d "git commit a work-in-progress branch"
-  git add -A; git rm (git ls-files --deleted) 2> /dev/null; git commit -m "--wip--"
-end
diff --git a/private_dot_config/private_fish/private_functions/private_fish_prompt.fish b/private_dot_config/private_fish/private_functions/private_fish_prompt.fish
deleted file mode 100644
index 894be86..0000000
--- a/private_dot_config/private_fish/private_functions/private_fish_prompt.fish
+++ /dev/null
@@ -1,9 +0,0 @@
-function fish_prompt
-	test $SSH_TTY
-    and printf (set_color red)$USER(set_color brwhite)'@'(set_color yellow)(prompt_hostname)' '
-    test "$USER" = 'root'
-    and echo (set_color red)"#"
-
-    # Main
-    echo -n (set_color cyan)(prompt_pwd) (set_color red)'❯'(set_color yellow)'❯'(set_color green)'❯ '
-end
jukben added a commit to jukben/z that referenced this issue Mar 10, 2021
@joseluisq
Copy link

joseluisq commented Mar 11, 2021

I don't know if you have thought about it but how about script (.fish) files that you don't want to pack to users like testing or automation intended ones? How do we tell Fisher about it? Is not suitable to just skip "top-level" script files?

Those are some concerns since newer Fisher shows fisher: Plugin not supported: during installations that contains .fish script files outside Fish dirs.

@jorgebucaran
Copy link
Owner Author

When installing plugins, in addition to .fish files, we also copy any files and directories inside your plugin functions/, conf.d/, and completions/ to $fisher_path under functions/, conf.d, and completions respectively, allowing you to access these resources easily (#581).

You can also place .fish files in directories in the top-level, for example, I put Fisher tests in tests/.

@joseluisq
Copy link

I put Fisher tests in tests/.

I did the same and now no more messages but my question is more about what do we need to care about "top-level" script files? Can Fisher just skip them since Fish dirs are well known.

@jorgebucaran
Copy link
Owner Author

Fisher ignores top-level .fish files. I think the error message is confusing and makes people mistakenly think Fisher won't install the plugin. I am just going to remove the warning in the next minor bump (#666). 🤘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or bug fix
Projects
None yet
Development

No branches or pull requests

3 participants