Thursday, April 4, 2013

Python, oh how you care about spaces and tabs, and intro to Emacs

Python is really picky about indentation (spaces and tabs). Because of this, the resulting code is very readable. The internet seems to somewhat agree that 4 spaces = one indent level. I would like to be able to make my tabs always be 4 spaces so that I don't have to hit the space bar so much.

I have been using gedit, so I'll figure out how to do it there!

Edit--> Preferences--> Editor--> Insert spaces instead of tabs
and change the Tab width to 4

oooh, Display line numbers! That's an option I'll select as well. Gedit shows you the current row and column at the bottom of the window, but I'll see how I like always seeing the line numbers.

Ok, but really, I should graduate to Emacs... I find Emacs very intimidating for all it's shortcut keys and how it doesn't use the microsoft-era shortcut keys I'm used to. One step at a time though.

Dash Home --> type Emacs, Enter

Now I'm going to lock it to my toolbar. What a commitment!

The tutorial is telling me that two main keys are Control and Alt (Meta). The abbreviations for these are C and M.

C-<chr> means the same thing as Ctrl+<chr> (in all the programs I'm used to)
M-<chr> means Alt+<chr>

To quit:
C-x C-c

It worked! Hrm, but that exited  my session, okay, starting it back up to get back to the tutorial.
C-g quits a command partway through typing it

There are three major commands for paging up and down a text document:

C-v see one screenful further down
M-v see one screenful further up
C-l center the screenful on your current cursor (just top to bottom, not left to right)

Continuing to type C-l moves the line with the cursor in it progressively to the
1 time: center
2 times: top
3 times: bottom
and it keeps cycling through.

That's enough for now! C-x C-c



No comments:

Post a Comment