Sublime Forum

Ctrl-Right behaviour on Windows

#1

I’m very new to Sublime Text and think I’m going to like it. There are many cool features but there is one behaviour I have a slight problem with.

Given the text “first second third” with the cursor sitting somewhere in “first”. In any other Windows editor I’ve ever used pressing Ctrl-Right will move the cursor to the start of “second” and pressing again moves to the start of “third”. Sublime Text behaves differently, moving to the end of the current word, rather than the start of the next one; so Ctrl-Right once moves to the end of “first”; and another press moves to the end of “second”.

If I was going to use Sublime Text exclusively I could just decide to just get used to the behaviour, but as I must continue using other editors in various IDEs having different behaviours will be annoying. Is there any way to control how this works in Sublime Text?

0 Likes

#2

Yes, I found that a little annoying with certain filetypes. I’ve overriden it on a per-filetype basis, because the default behaviour is actually quite useful with certain languages and files, but if you want to change it globally, choose Preferences…key bindings (user) and add this in between the square brackets:

	{ "keys": "ctrl+right"], "command": "move", "args": {"by": "words", "forward": true} },
	{ "keys": "ctrl+shift+right"], "command": "move", "args": {"by": "words", "forward": true, "extend": true} },

If the last line line above is the last line before the closing ], remove the last trailing comma.

Then save the file. You’ll now have consistent ctrl-right/left behaviour, and it’ll work with shift when selecting too.

:smile:

0 Likes