1
Ubuntu 19.10
emacs 26.3 from system repos
I do use elpy and evil-mode

In general when I am editing python code, indentation works just fine. However, when I am editing doc-strings, when I type enter to get a newline, it goes all the way to column 1. (fill-paragraph) and (indent-region) will both fix the indentation, but its annoying and I'm wondering if its possible to get emacs to respect the indentation that I'm using.

below is an example of what I mean

def func():
    """a dummy function

    if I start typing here, then type enter,
then it moves here...,

    however if I type here... lorem ipsum lorem ipsum blah blah blah, need
characters to get past 80, now if I hit M-q, or highlight the region and then
(indent-region), then it changes it to:

    however if I type here... lorem ipsum lorem ipsum blah blah blah, need
    characters to get past 80, now if I hit M-q, or highlight the region and
    then (indent-region), then it changes it to:

    """

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.