Last Updated: February 25, 2016
·
749
· peterjmit

RSI Prevention in Sublime Text

I have recently spent some time updating my [dotfiles repo][1] and have taken a lot of inspiration from some of the [repositories listed by github][2].

I especially liked [Yan Pritzker's dotfiles][3], and his key bindings for vim.

Particularly useful is the remapping of _ and - to ⌘+k and ⌘+K respectively. I wanted to recreate this in sublime text and which is pretty easy:

If you are on OS X hit Sublime Text > Preferences > Key Bindings - User

To this file add the following lines (your hands will thank you)

{
    "keys": ["super+k"], 
    "command": "insert", 
    "args": { "characters": "_"}
},
{
    "keys": ["super+shift+k"], 
    "command": "insert", 
    "args": { "characters": "-"}
}

Key bindings are pretty easy + powerful to create in ST, check out the list of [commands][5] that you can use in conjunction with the key bindings file.

[1]: https://github.com/peterjmit/dotfiles
[2]: http://dotfiles.github.io/
[3]: https://github.com/skwp/dotfiles
[4]: https://github.com/skwp/dotfiles/blob/master/vim/plugin/settings/yadr-keymap.vim#L21
[5]: http://www.sublimetext.com/docs/commands