I posted in the previous thread on this subject about a year ago, and have mentioned it in other posts too. A number of people are chiming in with the position that extensions are more powerful than macros, which obviates the need for macros to record things like Find/Replace. I sit firmly on the side of the argument that macros should record everything that makes sense, with a few documented exceptions that should also make sense.
While I agree that extensions are more powerful and can always do the work of a macro - though I feel that Sublime’s API needs some work to really unleash that power - they’re no substitute for macros. The reason is simple: Being programmers, we would rather avoid having to write more programs to achieve sophisticated editing operations wherever possible. For many of us, Python and Sublime’s API are not our primary programming environment so the process can become overly time consuming. The editor is there to save us time and make complex editing operations a breeze. Extensions are useful where we might want to do something complex, repeatedly over time and with necessary logic that might change based on a variety of conditions or variables. Such functionality will often be useful to others. Macros should allow us to record a sequence of operations by doing them, optionally allow refinement by editing the macro’s code, then allow macro playback to be triggered with a keystroke.
The power of a programmer’s editor becomes evident to most when they discover the ability to build complex editing operations out of simple building blocks. Originally a Brief user whose editor of evolved through Emacs, Vim and Crisp for many years (I still use the latter), the ability to record and repeat a series of operations, including and beyond text entry and cursor movements, and play them back with a keystroke or say ‘repeat playback 20 times or until EOF’, is a workflow that can surmount complex editing tasks over large files in record speed. While Sublime’s multi-cursors and multi-selections can get you to the same place in some cases, it often can’t. So I’m left falling back to Crisp as others fall back to Notepad++ etc. to do such things - and that’s a real shame.
Many ask why this is the case. I don’t have insight into Jon’s design choices but I am a programmer, and the reason seems fairly obvious. Jon engineered macros to sequence simple keystroke-based operations like text entry, deletion and cursor movement into atomic language specific operations. Any text editor will need a wealth of these, and a dumb ‘sequencer’ which avoids functional code seems a logical, quick to implement approach. Beyond actual keystrokes, TextCommands are the lowest level operations falling into this category so Jon implemented the facility this way. Adding other types of function adds complexity because they might potentially affect the state of entire buffers, require input etc… So if I’m right the reason is simplicity, justified perhaps by the thinking that multi-cursors/selections would be an alternative workflow to the same ends.
With the time that’s passed it’s become clear that, while useful, multi-cursors/selections are not a panacea for the challenges of complex editing tasks. We need macros that can record and playback everything, which can then be used in extensions or as part of eg. ‘repeat X times or until EOF’.
Addressing Sublime’s key limitations should probably be high on the priority pile moving forward. For me, more powerful macros that record everything, and extensions that can do more by virtue of a richer API should be right at the top of the list.
