簡體   English   中英

Emacs org-mode python塊有5個空格標簽,但我想要4個空格標簽

[英]Emacs org-mode python blocks have 5 space tabs, but I want 4 space tabs

我在組織模式文件中的源塊內編寫python代碼; 我正在使用emacs命令Cc '在python模式下在子緩沖區中編輯代碼塊

例:

#+begin_src python
def function(x):
     hitting_tab_inserts_5_spaces=x*2
     if x<0:
          hitting_tab_inserts_5_spaces=-x
     return x

我到處都有5個空格標簽,而不是我想要的4個空格標簽。

注意:我有v蛇(vim仿真)。

配置中的哪些參數會影響org-mode文件中代碼塊內的列表?

如果我使用emacs編輯.py文件,我會得到4個空格的標簽; 這個5空格的標簽只發生在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)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM