Changing Alt Key Behavior in Sublime Text 2

I want to use the Alt key in Sublime Text 2, how can I use it on the command line in iTerm. For example, when I press alt + f , the cursor moves the word forward, or when I press alt + b , the cursor moves back and forth.

Instead, UTF + 8 characters occur, corresponding to the entered keys (for example: ฦ’ or โˆซ ). On iTerm on Mac, I can change the behavior on the left of alt to act like + esc, and it seems to be a trick.

This could be a Mac OS X issue in general (I have the same problem in a web browser) or something specific with Sublime Text 2, so I would appreciate any Mac or Sublime Text 2 experience. Thanks!

+4
source share
2 answers

There is a Sublime Text 2 plugin called Sublemacs Pro that provides keyboard shortcuts and emacs operations, including the ones you talked about. You can find installation instructions and a full link to the key binding to the Github page .

+2
source

After using Sublemacs Pro for several days, I realized that it was too much for me, although it might be good for more experienced emacs users.

I came from TextMate, and what I really want is the best of all worlds: mostly Sublime shortcuts, a few missing shortcuts from the Ruby Textmate shortcuts library, and a few shortcuts that Textmate stole from emacs.

So, I figured out how to solve the problems of alt + f and alt + b :

 { "keys": ["alt+b"], "command": "move", "args": {"by": "subwords", "forward": false} }, { "keys": ["alt+f"], "command": "move", "args": {"by": "subword_ends", "forward": true} } 

If I find some more really useful, I will post them here. In addition, if I find a resource that lists all the possible values โ€‹โ€‹of the "by" field, I will also publish this.

+4
source

Source: https://habr.com/ru/post/1484277/


All Articles