Sublime Forum

Change cursor position at beginning of next word when moving

#1

Hello,
when I run with the cursor on text to reach some position, the cursor usually stops at the end of the previous word.
Is it possibile somehow to change this behaviour? Like always stopping at the beginning of next word? That is like W in vintage mode, inestead of E.
Thanks!

0 Likes

#2

The default keybindings is similar to vim’s e:

{
    "keys": ["ctrl+right"], "command": "move",
    "args": {"by": "word_ends", "forward": true}
},

You can change it to this keybinding, which is similar to vim’s w:

{
    "keys": ["ctrl+right"], "command": "move",
    "args": {"by": "words", "forward": true}
},
1 Like

#3

For a paradigm of where this is implemented in vim -
https://docs.oracle.com/cd/E19683-01/806-7612/6jgfmsvqf/index.html - See section “Moving One Word”
This emulates vim’s movement between word vs WORD beginning
https://stackoverflow.com/questions/22931032/vim-word-vs-word
https://www.computerhope.com/unix/vim.htm - “Moving From Word To Word”
https://vim.rtorr.com/

Press w (“word”) to move the cursor to the right one word at a time.
Press b (“back”) to move the cursor to the left one word at a time.

I found that Sublime’s move “words” and “words_ends” keybindings of vim’s “b” and “w” emulation mode still stop at punctuation characters even if you make “word_separators” blank.

KeyboardNavigation allows vim “w” and “b” like movement fastly through contiguous boundaries. - Navigate fast between contiguous boundaries.


https://packagecontrol.io/packages/KeyboardNavigation

1 Like

#4

That is a sweet plugin! All I needed were just four keybindings, but man I’ve been looking for that functionality for like 2 years.
Thanks a lot for developing it.

0 Likes