-
Notifications
You must be signed in to change notification settings - Fork 329
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
Add select + motion or visual select #477
Comments
@marekzidek Sorry for late reply and thank you for your interest in contributing. I don't think we have such a feature discussion before. It seems like there is already a usecase for this so I would be interested to see a pull request about this. Go is an easy language and if you know programming you should be able to pick it up easily. The feature itself might be more difficult to implement. My initial guess is that you should first implement a modal command to change the operation mode to visual mode as you say. And then you should check this operation mode in various movement commands to toggle selections of relevant file. Feel free to shoot your questions here if you decide to work on this and I can try my best to guide you. |
It seems like @kmarius have worked on this feature, what's the next steps if we want to see this feature merged? |
@lefuturiste I can create a PR soon-ish (maintainer seems quite busy anyway), there are still some open questions regarding e.g. how this should behave with |
Excuse me sir, this was finally implemented? |
One approach would be to implement a command to "invert selection below the cursor", which would invert the selection status of every file at or below the cursor. This would give most of the benefits of visual selection. To select a contiguous subset of files, you'd use this command on then first file you want to select. Then, you'd move down to the first file you do not want to select (the one after the end of the desired selection) and use the same command again. It would work in the opposite order as well (selecting the file after the last one you'd like to select, and then the first file of the selection). One thing I'm unsure about is what key to assign to such a command, but I'm sure we'll find some. Update: I think it could simply be Update 2: Inverting all files is currently bound to |
This command inverts the selection for the current file and all the files below it. Using this command twice substitutes for having a "visual" mode. This is described in more detail in the docs and in gokcehan#477 (comment). Since `invert` is bound to `v` by default, `invert-below` gets `V` as a default binding. Fixes gokcehan#477
This command inverts the selection for the current file and all the files below it. Using this command twice substitutes for having a "visual" mode. This is described in more detail in the docs and in gokcehan#477 (comment). Since `invert` is bound to `v` by default, `invert-below` gets `V` as a default binding. Fixes gokcehan#477. While that's not exactly what was asked for, I hope it's a suitable replacement and seems more in the spirit of `lf`.
I would appreciate it if people tried out #1101 and saw whether it works for them or if it's too confusing. |
I thought of an alternative design that might be more intuitive than #1101 and still relatively simple. I am not sure how motivated I am to implement it, though. We could have a Then, we would have a These could be mapped to One outstanding issue is whether to have a command to remove the anchor. I'm not sure whether it's convenient to do that on Later, this could evolve further towards looking like a visual mode, but this halfway point might be easier to get to. |
@ilyagr I really like that idea. I would like existing selections to remain and toggle command for setting/removing the anchor. |
This command inverts the selection for the current file and all the files below it. Using this command twice substitutes for having a "visual" mode. This is described in more detail in the docs and in #477 (comment). Fixes #477. While that's not exactly what was asked for, I hope it's a suitable replacement and seems more in the spirit of `lf`, at least until a better replacement is implemented.
@gokcehan I think this should be reopened. I should've modified the commit message so that it didn't auto-close this. |
Not sure if this helps but Visidata (which is excellent btw) solves this with several commands:
|
Feature I am often using in other file managers is to e.g. sort by date and then select everything from a date to bottom, or everything from a date to top. (In gui file manages, this is done by select and then shift click.)
Right now, Space select is working one by one and automatically goes downwards if held. I'd like to add a feature for e.g. Shift+Space or whatever to enter something like a visual mode and select ranges with motion keys (without disturbing any other previous selections by single Space/e.g. Shift+Space hits)
Is this something interesting for a pull request? Has this been tried, tackled with or rejected? I tried filtering out all issues by "select/visual" but found nothing similar. Or are we not interested in this and I should try in my own fork? Anyhow, I'd be happy if someone pointed me out to the right direction as I'm quite new to Go :)
The text was updated successfully, but these errors were encountered: