Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Change the order of the completion, e.g. based on the extension or size of the entry #641

Closed
tobiasBora opened this issue Sep 14, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@tobiasBora
Copy link

tobiasBora commented Sep 14, 2023

What do you want?

Would it be possible to allow the user to change the order of the suggested completion, or even to move some item in a "less important" section? E.g. in:

image

I’d prefer to have:

  1. all .tex files appear first, before the .pdf (these are the "important extensions" I care about)
  2. the .bbl, .run.xml, .aux, .synctex.gz… appear in another section "less important files" rather than "files" since I never directly manipulate them and they pollute my view
  3. The "less important files" should also be determined by regexp, so that I can add for instance all files that contain "-pratend".
  4. if two files share the same base name like hey.tex and hey-backup.tex or hey-pratend-foo.tex, I would prefer to have the shorter files listed first: sometimes, I can even type the full name, and the file is listed at the very end of the line, making it hard to select:

image

(not that these screenshots are taken with a relatively old version (~1y) so things might have changed a bit now, but I see nothing in the doc about that anyway)

Why do you want this?

In LaTeX, you get an enormous amount of temporary files created during compilation, and most of the time only the .tex file and the .pdf files are important. Sometimes, some .tex files are also created with the same prefix but with an additional part in the name (the -pratend in the screenshot). This means that completion of these kind of files is very hard, and it is often easier to type the full name manually.

Who else would benefit from this?

People that care about some extensions more than others, so at least any LaTeX user.

How should it work?

The user should provide in configuration something like:

# first method (advanced users)
zsh_sort_function() { write the function that sets the category of each file and their position (for advanced users only)}
# second method (regular users)
- importantFiles: [ "\.tex$", "\.pdf$" ] # this will list tex before pdf
- lessImportantFiles: [ "\.bbl$", "\.synctex$", "-pratend-" ]
- priorityShortFiles: true

When I perform the following steps:

  1. Type a string with proposed completion

Then I expect the following to happen:

  • files that match the list "importantFiles" should be listed before other files (unless maybe if the fuzzy matching is way more fuzzy for the normal files?)
  • files that match the list "lessImportantFiles" should appear in a separate section "Less important files", below the normal "file" section.
  • shorter files should appear first
@tobiasBora tobiasBora added the enhancement New feature or request label Sep 14, 2023
@marlonrichert marlonrichert closed this as not planned Won't fix, can't repro, duplicate, stale Sep 14, 2023
@marlonrichert marlonrichert added the duplicate This issue or pull request already exists label Sep 14, 2023
@marlonrichert marlonrichert reopened this Sep 14, 2023
@marlonrichert marlonrichert removed the duplicate This issue or pull request already exists label Sep 14, 2023
Repository owner locked and limited conversation to collaborators Sep 14, 2023
@marlonrichert marlonrichert converted this issue into discussion #642 Sep 14, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants