Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [electric-indent]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
85 views

Evil mode "o" auto indent in text mode - how to turn it off?

When I press o in evil mode (which moves the cursor to the line under, and goes into insert mode), the cursor is indented by two spaces. When I press o, the cursor goes here This happens in text ...
Vinn's user avatar
  • 293
0 votes
1 answer
50 views

Calling c-electric-brace programmatically

I'm currently extending the tempo.el template insertion system to be sensitive to C styles. Specifically, I want to insert braces using c-electric-brace. How programmatically insertion of braces as ...
Nordlöw's user avatar
  • 507
2 votes
1 answer
211 views

Changing indent-tabs-mode and electric-indent-mode in a buffer

I want to change indent-tabs-mode and electric-indent-mode to nil. There exist three possibilities setq-default setq-local setq I think setq-default only changes the behaviour for major modes where ...
Dilna's user avatar
  • 1
0 votes
2 answers
29 views

How to make indentation follow beginning of text in list

I want electric-indent or more generally, hitting ENT, to indent the new line to the beginning of text. I'd like this to work with auto-fill as well. Before: 1. This is a long list item that I'll wrap ...
mcp's user avatar
  • 556
4 votes
2 answers
504 views

How can I enable electric indentation for all modes except some?

I am trying to enable electric-indent-mode for all modes except fundamental-mode, where it is just annoying. In my init file, I have the following: (electric-indent-mode +1) (add-hook 'after-change-...
tinskip's user avatar
  • 41
2 votes
1 answer
484 views

New line and indent without electric mode

I have come to hate the inconsistency of the electric indent mode and I haven't much of a clue about how it works anyways, so I've disabled it and am trying to get the desired behavior from scratch. I ...
Andrii Kozytskyi's user avatar
1 vote
1 answer
274 views

Why is electric-indent-mode adding extra indentation after pressing return twice in org source blocks?

When I try to write code in source block in Org mode, pressing return once acts as expected while hitting it a second time increases the indentation to two levels if it's currently less than that. ...
Ivanna's user avatar
  • 111
1 vote
0 answers
34 views

yas-expand doesn't trigger reindent in aggressive-indent-mode

I'm trying to make a call to yas-expand doesn't trigger aggressive-indent. I'm guessing this is because yas-expand, for some reason, doesn't trigger a call to after-change-functions into which ...
Nordlöw's user avatar
  • 507
1 vote
0 answers
19 views

web-mode turn off auto indent on yank [duplicate]

How to turn off auto indent on yank in web mode? As far as I understand, I must call remove-hook with the name of the hook and the function. But how too find them?
user4035's user avatar
  • 1,069
2 votes
2 answers
150 views

Define key binding for a single mode (Fundamental)

In light that this may be a duplicate, but I did not find the answer to my question scouring this site. The default behavior of GNU Emacs appears to have electric-indent-mode enabled, which is fine ...
Phoenix's user avatar
  • 351
0 votes
3 answers
665 views

Python and electric-indent: newline autoindent disregards previous blank line

This is (yet) another question related to electric-indent-mode and Python, but since I couldn't find what I address here in the other ones, here we go. I find the behavior of electric-indent-mode ...
Arthur Colombini Gusmão's user avatar
3 votes
1 answer
505 views

SML Mode weird indentation

Whenever I hit enter to get to the next line when writing a function for example emacs indents an addition tabs worth of space. I'll try to sketch out the problem: fun pow(x : int, y : int) = ----...
lefty_lucy_righty_tighty's user avatar
1 vote
1 answer
374 views

Previous indentation is discarded on newline

Let's say I have the following code: void foo(){ ~ } I have marked point with ~. When I press enter the electric indentation works as normal but it doesn't keep the indentation for the previous ...
Nathan's user avatar
  • 13
1 vote
2 answers
240 views

Getting electric indent behaviour for added chars to "electric-indent-chars"

I am trying to get electric indent behaviour in bazel BUILD files. These are essentially python files, although the structure is extremely simple. Let me give you an example: cc_binary( name = "...
Realraptor's user avatar
  • 1,293
13 votes
2 answers
2k views

Change the behaviour of RET (with electric indent) to only indent the new line, not the previous one

https://stackoverflow.com/questions/27077770/how-do-i-disable-electric-indent-on-ret-but-still-keep-other-electric-characters asks and answers how to disable electric indent when pressing RET. All ...
AnoE's user avatar
  • 440
6 votes
1 answer
592 views

Prevent electric-indent-mode from reindenting the current line on RET

I am using the Spacemacs configuration files. When I am typing code, electric-indent-mode reindents the current line whenever I press enter. This often causes the indentation to be incorrect when ...
user3369551's user avatar