-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
[Feature Request] Ability to pin files or directories to the top #1008
Comments
The previous time it came up I suggested to use 'sortgroups' option as a workaround, but it has its limitations. Providing this as a builtin functionality requires some more analysis. I'm not sure I fully understand how pinned items would relate to sorting. At the moment it sounds like they would just ignore it completely (including reversing of sort order), so it wouldn't be a modification of Also, items are to be pinned within a specific path, right? |
I somehow missed you responded to this request. Anyway, you're right: in general, sorting would be ignored and the items would be pinned within a specific path. Maybe we could have two kinds of pinning: one within a specific path and the other across all directories. Thank you for your effort and I appreciate very much how your answers are devoid of any cynicism or such. |
Thanks, things are clearer now.
If path matching for pinning is done via patterns, then there is no distinction because patterns can match either file names or paths. However, that might be too much for pinning where something more specialized could suffice.
If there is some kind of Order of pinned files can probably match relative order of corresponding patterns/paths so that reordering them would result in different file order. |
Something like, for example: Only thing which could be more thought about are default keybindings for both |
In other words, not pinned? Is that supposed to unpin things? |
|
If the purpose of pinning is for entries to not be affected by sorting, then how come this is pinning? |
I'm proposing a specific kind of pinning, something like: If In structure, this would be actually three separate lists maintained as one list: two pinned lists at the top, and the rest of the files which would have the first two filtered out. (We could work out the details how Maybe we could, for the moment, only implement This could all seem like a over-engineering, but it's actually very ordinary: And, in the end, maybe we should not call this specific kind of option pinning. |
Since we have something like this in forums (sticky posts/threads), name could be |
(I just noticed...) In the post above, pun not intended. Having that in mind, pin is a better name. @xaizek Have you started on a prototype and/or made some kind of progress to implement this? |
No, don't expect it in the next release. It's already rather late and I still have long list of things to do for it. |
One thing I often had a need for is an ability to pin some files or directories to the top.
Since filters (:filter, =, ...) are fairly inexpensive, I have hundreds (thousands etc.) of files of different type etc. in one (e.g. home) directory, and, usually, no need (at least not for a long time and depending on the work I do at the moment) to hierarchically structure them.
Sometimes, after many days or much time spent on a specific thing, some other thing cames up to which I need to pay attention, it gets lost down the files (I have ":set sort=-ctime,dir" by default)
I would propose, if it's feasible and doesn't require too much complex coding,
to add an ability to pin files or directories (e.g. [dD]ownloads) to the top.
Every new pinned file could go to the top of the list of pinned files
(pinned files would be immune to the sorting by default, we could have this settable by option (e.g. :set sortpinned..)).
If a pinned file is again pinned, it could go to the top of the pinned files.
We could, maybe latter, generalize this further...
The text was updated successfully, but these errors were encountered: