-
-
Notifications
You must be signed in to change notification settings - Fork 610
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
Visual Selection #2994
Comments
This feature would be incredible! I've found myself naturally doing the same: A first class solution is desirable.
As usual, pull requests are most gratefully appreciated, see CONTRIBUTING.md |
While we can't use bookmarkings because they have other usages, I found it very useful to have at least bookmarking-based selection feature. Here I implemented working with visual selection through selection multiple bookmarking in visual mode. By itself it can be separate feature that can be useful in some cases. I attached basic function that works on the. Here is the showcase of three commands (adding bookmarking, deleting them and toggle). 123-6000.mp4And the code for mentioned commands
|
That's really elegant! I'd be really grateful if you shared this as a recipe This would be a valuable core nvim-tree feature that a lot of users would appreciate. Are you open to creating a PR to contribute this? |
Sure, I will be more than happy to create a PR! |
Discussed in #2993
Originally posted by l00sed November 9, 2024
First of all, thank you so much to the open source community, the plugin author, and plugin contributors. Nvim Tree is a fantastic plugin and part of my everyday workflow. 🌳
Some Background, Visual Selection
The vim-centric way to delete multiple lines of text is to first
Shift-v
— visually select a full line of text. Next, with the visual line selection, I could navigate (j
ork
) to expand the selection area down or up, respectively. See below:Screen.Recording.2024-11-08.at.9.13.43.AM.mov
I would love to mimic this behavior for selecting multiple files in Nvim Tree, using
<S-v>
to visually select files or folders, then pressingc
(for example, to copy) ord
(to delete)— or running any action against that selection of files.Performing the selection this way, using the standard Vim visual selection, would feel like a seamless extension of normal buffer behavior.
Example Scenario
I want to delete several markdown files from a folder,
blog
. The files are in consecutive order, so I can<S-v>
to visually select the first file to delete (car-hacking.mdx
) and then pressj
several times to expand the selection downward. Pressingd
deletes the selected files.Screen.Recording.2024-11-08.at.9.20.17.AM.mov
Does anyone have an existing recipe that makes this behavior possible? Perhaps using the existing buffer marking (
m
) behavior as a way to integrate the key-bindings somehow?I suspect there are other people interested in this as well— or those who may have already found a solution. Funny enough, I found a stack overflow issue related to NERD Tree which was likely asked in the hope of achieving the same visual-selection behavior in this other Neovim tree-based file manager.
Other relevant discussions:
The text was updated successfully, but these errors were encountered: