Insert the following into your user key bindings.
[
{ "keys": ["up"], "command": "swap_line_up" },
{ "keys": ["down"], "command": "swap_line_down" }
]
The key mapping file is just JSON. There are 4 keys.
keys
is a list of key entries. An entry will generally be something like ["<modifier> + <character>"]
. You can define multi level keybindings by creating additional entries in the array. An example of this is to show and hide the side bar. The entry for this is ["ctrl+k", "ctrl+b"]
. The available keys are described here.
command
is a string specifying the command to run. To see what command is running with a particular action, you can enter sublime.log_commands(True)
in the ST console.
args
are the arguments passed to the command. This is a dictionary object. The keys for this correspond to the parameter name for a given command.
context
is a list of dictionary entries to conditionally execute a given command. These can be somewhat complicated. There is a reference for context here.
I think the best way to familiarize yourself with the key bindings is to just try things out. I used the default keys as a reference.
You might want to keep this as a reference.
You can run a series of commands by creating macros. These are just lists of commands and arguments and are further described here.