1 line
1.6 KiB
Plaintext
1 line
1.6 KiB
Plaintext
<!-- SC_OFF --><div class="md"><p><strong>EDIT:</strong> Never mind! The function I was looking for is <code>M-x indent-relative</code>. That solves my problem. I can combine that with return to make a custom function to do what I want.</p> <p>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.</p> <pre><code>for in i in 1 2 <tab><tab><tab><tab><space><cursor is now here> </code></pre> <p>I don’t want that. I want :</p> <pre><code>for in i 1 2 <cursor is here> </code></pre> <p><code>M-x electric-indent-mode</code> 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:</p> <pre><code>for in i 1 2 do <cursor is here> </code></pre> <p>I want the cursor to be aligned with the <code>do</code>, not at the beginning of the line. Does anyone know how to do this?</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/SequentialDesign"> /u/SequentialDesign </a> <br/> <span><a href="https://www.reddit.com/r/emacs/comments/rrzl74/how_do_i_disable_autoindent_but_not_electricity/">[link]</a></span>   <span><a href="https://www.reddit.com/r/emacs/comments/rrzl74/how_do_i_disable_autoindent_but_not_electricity/">[comments]</a></span> |