A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://emacs.stackexchange.com/questions/81792/how-to-auto-indent below:

spacemacs - How to auto indent?

Say I'm in foo.py and I want to paste something into the docstr of function f:

something:

foo
bar
def f():
    """
    
    """

My current workflow (evil normal mode, in python buffer):

  1. Move cursor below first """
  2. Hit TAB to move the cursor 4 characters to the right
  3. Hit p

Now two question arise:

  1. Only the first line is indented. For me this is fundamentally wrong and I'm forced to manually indent. Yet in regards of such an operation's daily impact, there must be a reason, but what?
  2. Shouldn't my second step TAB be automated?

Result:

def f():
    """
    foo
bar 
    """

Or should I rethink my workflow and look at CI/CD tools e.g. black,yapf formatters etc.?

asked Jul 25, 2024 at 11:35

jjkjjk

78855 silver badges2424 bronze badges

2

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4