There's times when I have to remove an outter conditional block from a script & in order to keep everything orderly this means I also need to decrease the indent in the code within that conditional block by one.
To the right is an example of this situation. I want to remove the else outter conditional since the inner code needs to be evaluated whether the preceeding code succeeds or not.
Normally in something like Notepad this would mean alot of fancy finger work on the down arrow and the delete key on my keyboard.
In Notepad2 I was able to utilize the find & replace support for Regular Expressions and remove the tabs from the beginning of each line in the selection.
Now that I have gedit as my primary editor since I'm on Ubuntu I don't have acces to Notepad2, however I do have access to the External Tools plugin for gedit.
Through the external tools plugin I can filter selected text through sed, which is basically a RegEx filter designed to be used with pipes.
So I setup two new commands through that plugin, one for decreasing the indent by one which I call indent-- and another which I use to do the exact oppisite which I call indent++
If you're new to gedit like I am, first you'll need to enable the Enternal Tools plugin.
You do this by going through
Edit -> Preferences -> Plugins Tab -> Check "External Tools"
This will enable the following menu option where you can manage commands to filter selected text and documents through.
Tools -> External Tools
The dialog for managing tools is pretty self explainitory, here's what I entered for the command to be used for my indent-- tool.
Here's the command I'm using for my indent++ tool.
I actually got the idea after seeing the existing command to remove whitespace from the end of lines.