I'm writing python code inside source blocks within an org-mode file; I'm editing
the code-block in a sub-buffer, in python mode using the emacs command C-c '
Example:
#+begin_src python
def function(x):
hitting_tab_inserts_5_spaces=x*2
if x<0:
hitting_tab_inserts_5_spaces=-x
return x
and I'm getting 5 space tabs everywhere, instead of the 4 space tabs that I want.
Note: I have viper (vim emulation) on.
Where in the configuration are the parameters that affect tabination inside codeblocks in org-mode files?
If I edit a .py
file using emacs, I do get 4-space tabs; this 5-space tab thing is only happening inside org-mode.
(defun my-tab-related-stuff ()
(setq indent-tabs-mode t)
(setq tab-stop-list (number-sequence 4 200 4))
(setq tab-width 4)
(setq indent-line-function 'insert-tab))
(add-hook 'org-mode-hook 'my-tab-related-stuff)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With