Giter Club home page Giter Club logo

Comments (21)

Aloxaf avatar Aloxaf commented on May 26, 2024 1

You can set sort tag to false to let fzf-tab respect to the original order.

zstyle ':completion:complete:ls:argument-rest' sort false

from fzf-tab.

tastytea avatar tastytea commented on May 26, 2024 1

Thanks. Because the fzf command is given the argument --layout=reverse, the file-sort completion needs to be reversed to get the right order:

zstyle ':completion:*' file-sort access reverse
zstyle ':completion:complete:*:argument-rest' sort false

The fzf argument --no-sort seems to be unnecessary.

Edit: Reversing the file-sort is no longer necessary.

from fzf-tab.

romkatv avatar romkatv commented on May 26, 2024 1

Could you explain in more detail how to implement this?

function toggle-fzf-tab-sort() {
  if (( _no_sort_fzf_tab )); then
    zstyle ':fzf-tab:*'    extra-opts '--sort'
    zstyle ':completion:*' sort       'true'
    unset _no_sort_fzf_tab
  else
    zstyle ':fzf-tab:*'    extra-opts '--no-sort'
    zstyle ':completion:*' sort       'false'
    _no_sort_fzf_tab=1
  fi
}
zle -N toggle-fzf-tab-sort
bindkey '^T' toggle-fzf-tab-sort

from fzf-tab.

Aloxaf avatar Aloxaf commented on May 26, 2024

You can also add --tac to extra-opts to reverse the list.

from fzf-tab.

webmastak avatar webmastak commented on May 26, 2024

As I understand it, you went the way statically calling the plugin sort or nosort? Option switch did not implement? Bad, I'll use my fork!
https://i.imgur.com/ujfaexc.gif
https://i.imgur.com/aBRTE7Y.gif

from fzf-tab.

romkatv avatar romkatv commented on May 26, 2024

As I understand it, you went the way statically calling the plugin sort or nosort?

No. See #58 (comment).

from fzf-tab.

webmastak avatar webmastak commented on May 26, 2024

As I understand it, you went the way statically calling the plugin sort or nosort?

No. See #58 (comment).

And how it will help me to change sorting on the fly? What I showed in the screenshots.

from fzf-tab.

romkatv avatar romkatv commented on May 26, 2024

And how it will help me to change sorting on the fly? What I showed in the screenshots.

Wish I knew what you mean. Fortunately you have your fork.

from fzf-tab.

webmastak avatar webmastak commented on May 26, 2024

Wish I knew what you mean. Fortunately you have your fork.

Toggle plugin from sort to nosort when you type something either. My rejected PR 😉

from fzf-tab.

romkatv avatar romkatv commented on May 26, 2024

@webmastak #58 (comment) appears to do what you are asking for. If not, you can always use your fork.

from fzf-tab.

webmastak avatar webmastak commented on May 26, 2024

@webmastak #58 (comment) appears to do what you are asking for. If not, you can always use your fork.

Could you explain in more detail how to implement this?

from fzf-tab.

webmastak avatar webmastak commented on May 26, 2024

Thanks, I'll try.

from fzf-tab.

webmastak avatar webmastak commented on May 26, 2024

After comparing the version of the plugin which is in my fork and the current one. I noticed that when sorting is disabled, the results are different and the plugin in my fork shows better.
Can I fix it somehow?

Current plugin:
https://i.imgur.com/1pndRPW.png

My fork:
https://i.imgur.com/xsUCaQS.png

from fzf-tab.

romkatv avatar romkatv commented on May 26, 2024

@webmastak Your fork has diverged too much. It's a lot of work go through all the changes, guess what config you are using, just to answer your question. If you ask better questions, you'll get better answers.

from fzf-tab.

webmastak avatar webmastak commented on May 26, 2024

Your fork has diverged too much.

The fact is that no matter how the code under the hood changes, the output to the user should be the same in all versions!

Which block of code in the plugin is responsible for sorting the results?

from fzf-tab.

Aloxaf avatar Aloxaf commented on May 26, 2024

@webmastak It's a bug. I introduced GNU sort in d7ed42b and it seems always doesn't work as I expect...
I give it a simple fix in f0627fe, before I find the right way to use GNU sort.

from fzf-tab.

webmastak avatar webmastak commented on May 26, 2024

Thanks a lot. Your plugin is the best. 👍

from fzf-tab.

mxmilkiib avatar mxmilkiib commented on May 26, 2024

I'd like to get the list sorted this way, but I'm not seeing an effect after adding the suggested config. Might I be misunderstanding what is required or the order? I have tried commenting my own completions.zsh and even the junegunn/fzf parts, but files are still being ordered alphabetically.

from fzf-tab.

Aloxaf avatar Aloxaf commented on May 26, 2024

@mxmilkiib You should also specify the file sort: zstyle ':completion:*' file-sort access

And make sure you're using ls not something like exa.

from fzf-tab.

mxmilkiib avatar mxmilkiib commented on May 26, 2024

Thanks, whoopy, I realise I somehow broke that link, the file-sort access bit was on 191.

I was looking for file-sort modification anyway.

From this modification order;
image

(and this access order
image)

Without fzf-tab, and with file-sort modification I get;

image

Without fzf-tab, and with file-sort access;

image

With fzf-tab, and with either of the sort, I get;

image

from fzf-tab.

Aloxaf avatar Aloxaf commented on May 26, 2024

@mxmilkiib

zstyle ':completion:complete:ls:argument-rest' sort false only disable sorting for ls. You should use zstyle ':completion:complete:*:argument-rest' sort false if you want to disable it for every commands.

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.