Giter Site home page Giter Site logo

Show identical keys nearby about fzf-tab HOT 12 CLOSED

aloxaf avatar aloxaf commented on September 28, 2024
Show identical keys nearby

from fzf-tab.

Comments (12)

webmastak avatar webmastak commented on September 28, 2024

I made an exact search for fzf for yourself as a temporary solution in the absence of the functionality that I talked about in this issue.

from fzf-tab.

webmastak avatar webmastak commented on September 28, 2024

Tell me where in the code the command line arguments are fetched?

from fzf-tab.

Aloxaf avatar Aloxaf commented on September 28, 2024

Sorry for the late reply.
In fact, fzf-tab used to behave as you expect. But I found it is inconsistent with the default behavior of zsh's interactive search.
ๅ›พ็‰‡

To be consistent with zsh, and to improve performance, I changed the list order.

Since this behavior is the same as zsh, I will still keep this as the default. But I'd like to add an extra variable like FZF_TAB_NO_SORT for the behavior you expect. What do you think?

from fzf-tab.

webmastak avatar webmastak commented on September 28, 2024

Yes, that would be great.

It will be for everything or only for arguments?

from fzf-tab.

Aloxaf avatar Aloxaf commented on September 28, 2024

For everything.
It will mess some results like completion of variable name.
image

Ummm, need a better way to solve this.

from fzf-tab.

webmastak avatar webmastak commented on September 28, 2024

This can only be done for arguments?
I decided this by quickly switching the sort: bindkey '^S' toggle-sort-fzf-tab ## Ctrl+S

toggle-sort-fzf-tab() {
    if [[ ${FZF_TAB_SORT} == 1 ]]; then
        FZF_TAB_SORT=0
    else
        FZF_TAB_SORT=1
    fi
}

https://i.imgur.com/hoz6lzQ.gif
and created a PR

toggle-sort-fzf-tab works visually but when disabling sorting, arguments are not selected. ๐Ÿ˜Ÿ
https://i.imgur.com/KqkzxY2.gif
https://i.imgur.com/TkmMxwV.jpg

from fzf-tab.

Aloxaf avatar Aloxaf commented on September 28, 2024

It's still under development. I need a better way to meet the needs of different people.
I'm considering switching fzf-tab's configuration from variables to zstyle so that it can be more flexible.
eg.

zstyle ':completion:fzf-tab:-parameter-' sort true
zstyle ':completion:fzf-tab:*:' sort false

from fzf-tab.

webmastak avatar webmastak commented on September 28, 2024

While sorting is not solved with fzf-tab, I adapted two plugins.

## fzf-tab
bindkey '^[[Z' fzf-tab-complete ## Shift+Tab

## fzf-tab-completion
bindkey '^I' fzf_completion ## Tab

from fzf-tab.

webmastak avatar webmastak commented on September 28, 2024

How are you doing with the development?

from fzf-tab.

Aloxaf avatar Aloxaf commented on September 28, 2024

Please check #46
You can now set zstyle ':fzf_tab:*:options' sort false to just disable sorting when completing options.

from fzf-tab.

webmastak avatar webmastak commented on September 28, 2024

I do not understand how to apply it zstyle ':fzf_tab:*:options' sort false

Even if I just put zstyle ':fzf_tab:*:options' sort false this does not work, the arguments are not selected!

from fzf-tab.

webmastak avatar webmastak commented on September 28, 2024

Here the bug is fixed, everything works.

Added sorting switch, so much more convenient:

....
disable-sort-fzf-tab() {
    typeset -g _ZSH_FZF_TAB_SORT
    emulate -L zsh
	zstyle ':fzf_tab:*' sort false 
}

enable-sort-fzf-tab() {
    unset _ZSH_FZF_TAB_SORT
    emulate -L zsh
    zstyle ':fzf_tab:*' sort true
}

sort-fzf-tab() {
    if [[ -n "${_ZSH_FZF_TAB_SORT+x}" ]]; then
        enable-sort-fzf-tab
    else
        disable-sort-fzf-tab
    fi
}

enable-fzf-tab
zle -N toggle-fzf-tab
zle -N sort-fzf-tab
....

In .zshrc

....
## toggle sort in fzf-tab
bindkey '^S' sort-fzf-tab # Ctrl+S
....

from fzf-tab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.