Left/Right/Up/Down with keyboard? Possible?


#1

Hi all.

I was wondering if its all possible to add a few keystrokes as the:
Left/Right/Up/Down alongside the arrow keys?
I could not find those in the keystrokes commands(did I just miss those?).

So yeah, I kinda want shortcuts + key arrows for the Left/Right/Up/Down.

Any help will be great,

Thank you all.


#2

Sorry I’m sure I’m missing something but I’m not sure what you mean when you say:

I was wondering if its all possible to add a few keystrokes as the:
Left/Right/Up/Down alongside the arrow keys?

Can you explain in more detail or rephrase?


#3

Yes, of course.

I dont want to move my fingers away from keyboard to the arrow keys as I am typing.

In a way, I want to type and than do something like:
Ctrl+i = move text insertion cursor up (upArrow)
Ctrl+k = move text insertion cursor down (downArrow)
Ctrl+j = move text insertion cursor left (leftArrow)
Ctrl+l = move text insertion cursor right (rightArrow)

Looking at some Atom packages code snippets, I could not see the arrow keys definitions, I saw how to assign all sorts of combinations but did not see the “move text insertion” option, guessing its build in and can not be reassign?
Well, that is the question, can those be reassign?

Hope its more clear.

Thank you!


#4

You’ll notice that there aren’t keybindings for every letter, tab, or backspace, either. Basic keyboard operations aren’t sent through Atom’s command system. Thus, there’s nothing to reassign. You can make a command to move the cursor wherever you want, however. You just have to use Atom’s API to write your own function and assign it to a command name. Here’s a very basic example of something you could do to manipulate the cursor’s position.

atom.commands.add "atom-text-editor", "custom:move-cursor-up", () ->
  return unless editor = atom.workspace.getActiveTextEditor() # If there's no active TextEditor, do nothing.

  editor.moveUp(1) # Move all cursors up one row.

#5

Thank you @DamnedScholar , Ill take a alook.