Sublime Forum

How to navigate up/down one line

#1

Hi,

I’ve used Sublime for many years (it was my first editor back in Sublime 2) and have recently come back to it after using Replit and Visual Studio Code for a few months.

One of the features I really grew accustomed to was being able to use Alt+Up or Alt+Down to navigate up/down one line at a time. However, this doesn’t seem to be a feature in Sublime.

Is there a plugin I can install or a keybind/setting I can change for this? Sublime’s settings are not very intuitive and can be a massive time-sink trying to figure out what you want, and what everything does.

I’m using macOS 10.15.7 with Sublime 4126 (latest version).

Thanks,
DillonB07

0 Likes

#2

not sure what that is since I use neither of those two editors, so a wild guess here.

    { "keys": ["alt+up"], "command": "scroll_lines", "args": { "amount": 1.0 } },
    { "keys": ["alt+down"], "command": "scroll_lines", "args": { "amount": -1.0 } },
0 Likes

#3

Thanks, but that’s not what I wanted. I don’t think I was very clear, sorry :expressionless:

What I wanted was a way for the cursor to move up or down 1 line at a time via Alt+Up and Alt+Down.

0 Likes

#4

weird request but here you are.

	{ "keys": ["alt+up"], "command": "move", "args": {"by": "lines", "forward": false} },
	{ "keys": ["alt+down"], "command": "move", "args": {"by": "lines", "forward": true} },
1 Like

#6

Sorry, just realised why that was weird. I completely missed out the most important part. In addition to that, I want the line I’m on to move with me. (Shown in gif)

0 Likes

#7

dead gif but anyway, ST has a default keybinding for that

	{ "keys": ["ctrl+shift+up"], "command": "swap_line_up" },
	{ "keys": ["ctrl+shift+down"], "command": "swap_line_down" },
1 Like

#8

Thanks! That is what I wanted :slight_smile:

0 Likes