I want to do some tricky mappings that wraps currently selected visual area with some code. In order to do that I need to make sure that I am at the beginning of the current visual area. Is there any hotkey for that in visual mode?
feedback
|
|
If I understand correctly, you might be able to use
and
The tricky bit is that they go to the start/end of the previous visual area, not the current one. So, you could do something like this:
In my version of Vim, after using that sequence, the last visual area is slightly wonky (re-selecting it with To move around in the current visual area a user can use So, I wrote the function below to make a deterministic version of
| ||||
|
feedback
|
|
Capital H ("Home") will take you to the beginning, and "L" ("Last") to the end. One bit of behaviour that might cause you trouble is that these put the cursor on the first non-blank character of the line, so type "0" to go to the absolute start of line. | |||
|
feedback
|