Emacs bulk indent for Python

前端 未结 8 1238
星月不相逢
星月不相逢 2021-01-29 17:37

Working with Python in Emacs if I want to add a try/except to a block of code, I often find that I am having to indent the whole block, line by line. In Emacs, how do you inden

8条回答
  •  失恋的感觉
    2021-01-29 18:29

    I do something like this universally

    ;; intent whole buffer 
    (defun iwb ()
      "indent whole buffer"
      (interactive)
      ;;(delete-trailing-whitespace)
      (indent-region (point-min) (point-max) nil)
      (untabify (point-min) (point-max)))
    

提交回复
热议问题