jmacdonald / amp

A complete text editor for your terminal.

Home Page:https://amp.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature Request]: Allow line jump mode within select line mode

lberrymage opened this issue · comments

As it currently stands, when one enters SELECT LINE mode by pressing "V" in NORMAL mode, they can use the standard commands (e.g. "L", "k", "j") to navigate the file and expand their selection. JUMP mode can also be used with SELECT LINE mode to navigate further, but pressing "g" to enter line jump mode has no effect. I would love to see line jump mode implemented here as well so that one can select a region from line x to line y without manually "j"-ing and "k"-ing through a file. Using SELECT LINE mode and quickly using line jump mode to cut out the boundaries of their selection would be much more efficient.

I should note that this "issue" as it is also exists in SELECT mode, although I don't see as big of a use case there. It might be worth implementing anyway though.

From my very limited code browsing, this doesn't appear difficult to implement, although the prompt which typically appears in line jump mode would have to either overwrite the "SELECT LINE" or "SELECT" text on the screen temporarily, or not show it at all, although the latter has the disadvantage of not showing the user that they're currently in a "sub-mode". I vouch for the former personally.

After doing some browsing, I found that you have a project card describing a similar feature.

Possibly related: #105

Hi @lberrymage! I'm curious about this use case: why is using line numbers more convenient than jump mode? I've avoided Vim's use of numbers in general because I find it awkward using repetition or arithmetic to navigate the doc. Jump mode's prevalence/interoperability with other modes was added to re-inforce the visual approach, instead.

@jmacdonald, my original thought was that it would be nice for selecting large areas of text that extend beyond the current view. I thought that if one wanted to do that, they would have to enter select line mode and "j, k" up and down since "," and "m" don't move the cursor and you can't scroll while in jump mode. Now that you bring it up though, I just realized I could "," "m" to navigate while in select line mode and enter jump mode from wherever in the file I need. Whoops. 🤦‍♂️