Sublime Forum

Vintage mode, end of line (g$)

#1

in vintage mode j and k move between screen lines, as hoped and expected. But $ jumps to the end of the actual line, not screen line.

Id like, then, to make g$ move to the end of the screen line (typical in vim). I’ve tried the following advice: End of line key binding
but it doesnt work for me. Here they suggest hardeol: Bug: jump-to-end of line in word wrap mode but this didnt work either.

I can go into insert mode and use home/end keys but id like to navigate in command mode, g$ is common in vim so i imagine there’s a way to set it? (this person has listed it: https://gist.github.com/vitorbritto/9983723 but no explanation of how to set it in key bindings)

0 Likes

#2

Hi @neverdimed, this is what I use:

{ "keys": ["g","$"], "command": "set_motion", "args": {"motion": "move_to", "motion_args": {"to": "eol", "repeat": 1, "extend": true}, "inclusive": true, "clip_to_line": true }, "context": [ {"key": "setting.command_mode"} ] },
{ "keys": ["g","0"], "command": "set_motion", "args": {"motion": "move_to", "motion_args": {"to": "bol", "extend": true} }, "context": [ {"key": "setting.command_mode"}, {"key": "vi_has_repeat_digit", "operand": false} ] },
1 Like

#3

:grinning: excellent, works perfect, thanks!

0 Likes