Keyboard shortcut - Move cursor up/down two lines

I want to move the cursor two lines down or up with a keyboard shortcut. I’ve only found go-to-line (which moves the cursor to a specific line) and keyboard-scroll (which moves the cursor up/down by two lines, but also scrolls the page).

Are you looking for something that moves the cursor faster than just holding down/up?

You could add commands to your init.coffee file:

# init.coffee
atom.commands.add 'atom-workspace atom-text-editor:not([mini])', 'init:move-down-twice', didDispatch: ->
  editor = atom.views.getView(atom.workspace.getActiveTextEditor())
  atom.commands.dispatch editor, 'core:move-down'
  atom.commands.dispatch editor, 'core:move-down'

atom.commands.add 'atom-workspace atom-text-editor:not([mini])', 'init:move-up-twice', didDispatch: ->
  editor = atom.views.getView(atom.workspace.getActiveTextEditor())
  atom.commands.dispatch editor, 'core:move-up'
  atom.commands.dispatch editor, 'core:move-up'

then assign keys to those commands in keymap.cson:

# keymap.cson
'atom-workspace atom-text-editor:not([mini])':
	'ctrl-up': 'init:move-up-twice'
	'ctrl-down': 'init:move-down-twice'
1 Like

Thank you!