About 27,200 results
Open links in new tab
  1. How to get GitHub copilot to use 4 spaces to indent Python code?

    Jun 17, 2025 · I have also run (setq-default indent-tabs-mode nil) (My tab-width variable is set to 8, but since I don't want to see a TAB character within a 10-mile radius of this code, this should not matter.) …

  2. Python mode indentation - Emacs Stack Exchange

    5 I feel kind of ridiculous for not having seen this before, but I found the answer on the EmacsWiki: No Tabs page under the "Smart inference of indentation style" section. Putting that code in my init.el file …

  3. indentation - Indenting Python multiline argument lists like Black/Ruff ...

    Feb 7, 2025 · I want to configure Emacs to indent multiline argument lists in Python like Black or Ruff (4 spaces before each argument), but Emacs is very insistent on following PEP-8 (8 spaces). Even if I …

  4. indentation - How can I make python-mode correctly indent python's ...

    Nov 10, 2021 · Python 3.10 added a match statement. When I try and type one in emacs 27.2, it does not indent it correctly, presumably because it does not yet have support for it. How do I get python …

  5. indentation - How to set python indent offset to 2 spaces in elpy …

    Sep 3, 2020 · I tried python-indent-guess-indent-offset to nil and checked the python-indent-offset to be 2! The yapf formatting is still happening with 4 spaces. There is also python-indent-guess-indent …

  6. Is there indentation in org src blocks? - Emacs Stack Exchange

    Nov 3, 2021 · EDIT 2: Note that you should not expect "real" python indentation. This is more like typing python code in a buffer that is in fundamental mode. EDIT 3: I stand corrected: you should expect …

  7. indentation - Emacs occasionally using wrong indent in python - Emacs ...

    Feb 28, 2020 · I assume you always want an indentation with 4 spaces even if there are indents of width 8 lurking around in your python file. Set python-indent-guess-indent-offset to nil and keep the default …

  8. python - add a new line with the same indentation level as the current ...

    Aug 4, 2023 · 0 You can use the following function to inserts a new line just before the next line that has the same or less indentation level: (e.g., to insert # (2) when the cursor is on l2): (defun my-insert-line …

  9. Python-mode Multi-line Conditional Indentation

    Mar 14, 2023 · (advice-add 'python-indent--calculate-indentation :around #'python-indent-calc-indent-ad) This is less efficient than the modification of python-indent--calculate-indentation since the heavy …

  10. indentation - change python indent in a specific file - Emacs Stack ...

    May 23, 2016 · I have a piece of legacy code in Python that uses inconsistent tabs - 2 spaces in some instances and 4 in others. I have my defaults set in my .emacs file to use 4 spaces, but in this case …