SciTE show all files in open file dialog

SciTE is a popular cross-platform programmer’s editor. It’s based off of Scintilla.

I edit way more than just source files. Usually I just edit .txt files. If I’m in the Cinnamon desktop environment and not just the terminal, I’ll open up SciTE. However, by default it shows just source files, and I always have to switch it to show all files.

Here’s how to do that.

Get SciTE to show all files in the open file dialog on Linux

Edit the file, probably /usr/share/scite/

	all.files=All Files (*)|*|Hidden Files (.*)|.*|

You can see that you can modify the defaults for other platforms as well. Voila!

Replace config file entry or append if not found

Suppose you need to replace whatever current setting for a particular application to a specific setting. It doesn’t matter what it was before, or if it was absent. You want to define it.

Suppose you want to replace the session pam_mkhomedir setting in /etc/pam.d/common-session to be required. If it was optional, replace it. If it wasn’t listed at all, add it. This line updates an answer on stackoverflow.

sed -i -e '\|session.*|h; ${x;s/mkhomedir//;{g;tF};a\' -e 'session\trequired\ umask=0022' -e '};:F;s/.*mkhomedir.*/session\trequired\ umask=0022/g;' /etc/pam.d/common-session

The -i makes the change inline directly in the file. I write deployment scripts so I don’t care about displaying the output; I want to change the original.

Basically the command looks like this:

sed -e '\|variable.*(possible|values|go|hereornot)|h; ${x;s/variable//;{g;tF};a\' -e 'variable updatedvalue1 updatedvalue2' -e '};:F;s/.*variable.*/variable thisvalueadded1/g;' /etc/inputfile

Questions? I would be happy to explain this if you want a guided tour.