EDIT: Never mind! The function I was looking for is M-x indent-relative. That solves my problem. I can combine that with return to make a custom function to do what I want.

Writing a shell script, Emacs adds 4 tabs and 1 space. I don’t want this to happen. I want Emacs to go to the first character in the previous line. Emacs is going wild with auto-formatting. I want electricity. I like electricity. But I don’t like auto-formatting. That is, I don’t like tons of random tabs and spaces added for no reason.

for in i in 1 2 <tab><tab><tab><tab><space><cursor is now here> 

I don’t want that. I want :

for in i 1 2 <cursor is here> 

M-x electric-indent-mode doesn’t work, because then I lose electricity, which is also problematic. I like electricity, but I don’t like auto-formatting. Turning off electricity isn’t good:

for in i 1 2 do <cursor is here> 

I want the cursor to be aligned with the do, not at the beginning of the line. Does anyone know how to do this?

submitted by /u/SequentialDesign
[link] [comments]