| 1 | # ble/contrib/integration/skim-completion.bash (C) 2024, akinomyoga |
| 2 | |
| 3 | [[ $- == *i* ]] || return 0 |
| 4 | |
| 5 | # skim/shell/completion.bash を未ロードの時のみロードする |
| 6 | if ! ble/is-function _skim_complete; then |
| 7 | ble-import contrib/integration/skim-initialize || return 1 |
| 8 | if [[ -f $_ble_contrib_skim_base/completion.bash ]]; then |
| 9 | source -- "$_ble_contrib_skim_base/completion.bash" |
| 10 | elif [[ -f $_ble_contrib_skim_base/shell/completion.bash ]]; then |
| 11 | source -- "$_ble_contrib_skim_base/shell/completion.bash" |
| 12 | elif [[ $_ble_contrib_skim_base == */share/skim && -f /etc/bash_completion.d/skim ]]; then |
| 13 | source /etc/bash_completion.d/skim |
| 14 | fi |
| 15 | fi |
| 16 | |
| 17 | # clear blesh completer for cd |
| 18 | blehook/eval-after-load complete 'builtin unset -f ble/cmdinfo/complete:cd' |
| 19 | |
| 20 | # Note: completion integration has been moved from "skim/shell/completion.bash" |
| 21 | # to "skim/shell/key-bindings.bash". See "skim-key-bindings.bash" for details. |
| 22 | if ble/is-function _skim_handle_dynamic_completion; then |
| 23 | ble-import contrib/integration/fzf.common |
| 24 | ble/function#advice -f around __skim_generic_path_completion 'ble/contrib/integration:fzf/complete.advice' |
| 25 | ble/function#advice -f around _skim_complete 'ble/contrib/integration:fzf/complete.advice keep-stdin' |
| 26 | ble/function#advice -f around _skim_complete_kill 'ble/contrib/integration:fzf/complete.advice' |
| 27 | ble/function#advice -f around _skim_handle_dynamic_completion 'ble/contrib/integration:fzf/handle_dynamic_completion.advice' |
| 28 | _ble_contrib_fzf_adjust_dynamic_completion=1 |
| 29 | fi |