
Can I make Sublime Text 2 behave like this? Thanks.

[
{"args": {"extend": false, "to": "eol"}, "command": "move_to"},
{"args": {"by": "characters", "forward": false }, "command": "move"},
{"args": {"by": "characters", "forward": true }, "command": "move"}
] { "keys": ["end"], "command": "run_macro_file", "args": {"file": "Packages/User/newend.sublime-macro"} }
qgates wrote:Sublime does behave like this already but only if you've placed the cursor at the end of line without using the END key. If you place the cursor with the mouse or the cursor keys, you'll see the behaviour you want; if you hit END on the short line then hit Up, you'll get the current behaviour which is to stick to the end of the (longer) line when you hit Up.
But you can get what you want by hitting END+CursorLeft+CursorRight before you hit Up. You can make this the default behaviour for the END key with the following...
1. bind the above behaviour to the end key by creating a macro with the following code:
- Code: Select all
[
{"args": {"extend": false, "to": "eol"}, "command": "move_to"},
{"args": {"by": "characters", "forward": false }, "command": "move"},
{"args": {"by": "characters", "forward": true }, "command": "move"}
]
Save it in your Packages/User folder and call it "newend.sublime-macro"
2. Then bind the macro to the END key by clicking "Prefs..Key Bindings - User" and add the following line
- Code: Select all
{ "keys": ["end"], "command": "run_macro_file", "args": {"file": "Packages/User/newend.sublime-macro"} }
You'll need to add a comma to the end of the above line unless it's the last or only keybinding line in the file. The line should be in-between the starting [ and ending ].
S
Users browsing this forum: No registered users and 17 guests