Emacs and the eternal struggle!

So I’ve really been knuckling down getting to grips with emacs recently, ditching my other editors and forcing myself to focus purely on emacs. And boy am I glad I did.

Emacs and the eternal struggle is more about my eternal struggle with understanding the complexities of this editor, and boy can it be complex for a newbie.

The default emacs environment sucks, it just does, no getting away from that, but with a few tweaks here and there you can have a really great editing / programming environment.

Three resources I’ve found extremely helpful in my quest are these:

www.masteringemacs.org – a website by my friend Mickey Petersen with an accompanying book (had to give it a plug!)
Uncle Dave – A great emacs playlist, and lots of useful knowledge
Mike Zamansky – another awesome emacs playlist

Between these three resources I’ve now got a much, much better understanding of the inner workings of emacs.

It seems there is a lot more interest in the editor these days, not bad for an editor that’s been around since the 70’s!

I know vi is probably just as old and well supported, but you can never have too many editors to play around with.


SQL*Plus on Windows (Part 1)

Welcome to Part 1 in a series of articles on running SQL*Plus on the Windows platform.

Did you know that SQL*Plus under Windows is often preferred to its Unix equivalent?
There are many ways to configure SQL*Plus to suit your individual needs but today I’ll just cover one option that makes life that little bit easier (at least in my opinion).

Many beginner DBA’s (and some senior ones too!) often overlook the usefulness of a login.sql script.

We all have our favorite editors, I personally still float between Sublime Text and emacs, but the choice is truly down to personal preference. SQL*Plus on Windows defaults to notepad, as do most applications that use a text editor in the Windows environment, and we all know how useful that is; but its old and there are much better editors out there these days.

With a few choice commands and a bit of technical know-how you can change the default editor for SQL*Plus to something more DBA/Developer friendly.

Launch SQL*Plus on Windows from either the gui or a command prompt.

C:\>sqlplus /nolog

This will launch sqlplus.


ed login

By default This will launch you into notepad.exe and you will be editing a new file named “login.sql”, this file will be located in the directory you launched SQL*Plus from so remember where that was (the easiest way to do this is to create a shortcut to launch SQL*Plus which starts in the same directory every time, but this is something for another article).

Now this is where we define your preferred editor, so in my case, I like Sublime Text, therefore the line for setting my default SQL*Plus editor is as follows:

def _editor = “C:\Program Files\Sublime Text 3\subl.exe”


Save and close your file, then restart SQL*Plus.

Now when you type “ed” within SQL*Plus you will be thrown into your preferred editor.

This is just one of the changes that can be made in the login.sql; there are lots of others documented in the SQL*Plus reference documentation but this is my favorite change to make when first working on a new Windows environment.

Keep an eye out for further articles in my series on running SQL*Plus on a Windows platform.