I commonly prefer the select variations of extend commands, as they don't preserve where you started the selection, which is more intuitive for me. select_line_below and select_line_above are a godsend. However, many extend binds don't have select alternatives.
I specifically ran into this with extend_to_first_nonwhitespace and extend_to_line_end. I had these bound to H and L respectively, and I was hoping that a key sequence like HL would select all the way to the left, then select all the way to the right from the left, therefore selecting the entire line. However, because of how extend binds worked, this just selected the left half, then selected the right half.
I originally tried to get working behavior through something like this (done through home-manager):
H = [ "collapse_selection" "select_mode" "goto_first_nonwhitespace" "normal_mode" ];
L = [ "collapse_selection" "select_mode" "goto_line_end" "normal_mode" ];
This worked for a single line, but by necessity, if I had any other lines selected, it would deselect them. I don't believe there's a key combination that would replicate my ideal behavior here, where it wouldn't deselect previous lines, but it also wouldn't care about where you started the selection.
In my ideal solution, these binds would be added:
select_to_line_start
select_to_first_nonwhitespace
select_to_line_end
select_to_line_end_newline
I commonly prefer the
selectvariations ofextendcommands, as they don't preserve where you started the selection, which is more intuitive for me.select_line_belowandselect_line_aboveare a godsend. However, manyextendbinds don't haveselectalternatives.I specifically ran into this with
extend_to_first_nonwhitespaceandextend_to_line_end. I had these bound toHandLrespectively, and I was hoping that a key sequence likeHLwould select all the way to the left, then select all the way to the right from the left, therefore selecting the entire line. However, because of how extend binds worked, this just selected the left half, then selected the right half.I originally tried to get working behavior through something like this (done through home-manager):
This worked for a single line, but by necessity, if I had any other lines selected, it would deselect them. I don't believe there's a key combination that would replicate my ideal behavior here, where it wouldn't deselect previous lines, but it also wouldn't care about where you started the selection.
In my ideal solution, these binds would be added:
select_to_line_startselect_to_first_nonwhitespaceselect_to_line_endselect_to_line_end_newline