My take on removing leading blank chars is to press Ctrl-Shift-Tab a few times. But if the indentation is very large, here's how I do it:- Make a selection or press Ctrl-A to select everything- Press Ctrl-Shift-L to split the selection into lines- Press Home to go to the first non-whitespace character of each selected line- Press Shift-Home to select the leading whitespace- Press Delete to delete the whitespace

That's a lot of keypresses but it shows of one the many wonders of multiple selection

Hi, I made a little improvement. It's very useful for me and I like it.

I don't know if you got the point of my commands. Sublime's default "ctrl+del" removes whites paces PLUS a word (\s*(\w+|^\w]+) in regex). And I want to remove the white spaces OR a word OR symbols ((\w+|\s+|^\w\s]+) in regex). And the same for ctrl+backspace.

Now I made it behave in my way. It removes according to the region's first char(for del) or last char(for backspace). If fist char is an blank space (\s) it removes only blank spaces. And so on for word characters (\w) and for symbols (^\w\s]).

I'm not used with Python tricks, so I wrote it step by step. If someone can improve it I'll be glad.

The onPreSave() will use an heuristic to determine if you have recently pressed enter, and if so it won't delete that indented space. It will also not strip any trailing space inside any regions scoped as string ( which might get annoying for some source code ) Use run() to forcefully strip all or modify onPreSave as you see fit.

I tried updating the example plugin posted by eric1235711 so that it works with ST2 2.0.1/2217, and got most of it working, but am still receiving an error: TypeError: run() takes exactly 3 arguments (2 given). Here is the updated code so far:

The API documentation only lists args to let you know that is where you add your custom args if you are not requiring it, do not add any arguments:

Here is an example of a command that has a custom argument called "option". It is required (you can't run the command without it):[pre=#2D2D2D]class HexViewerOptionsCommand(sublime_plugin.WindowCommand):

...

def run(self, option):[/pre]

Here is an example that uses custom arguments that are optional (you can call the command without the arguments and it will still work; they are defaulted to a value if they aren't used):[pre=#2D2D2D]class HexViewerCommand(sublime_plugin.WindowCommand):

...

def run(self, bits=None, bytearray=None):[/pre]

Here is an example that can take an infinite number of arguments of any name. No need to define them you can read them from the kwargs which is a dictionary:[pre=#2D2D2D]class ExportHtmlCommand(sublime_plugin.WindowCommand): def run(self, **kwargs):[/pre]

For whatever the reason, "super+d" aka "⌘+d" aka "find_under_expand" do not work with macros. "find_under_expand" does not appear to be a plugin. So, here is a sample select-entire-word plugin that does work with macros: