Set 4 Space Indent in Emacs in Text Mode

后端 未结 20 2211
梦谈多话
梦谈多话 2020-11-29 15:27

I\'ve been unsuccessful in getting Emacs to switch from 8 space tabs to 4 space tabs when pressing the TAB in buffers with the major mode text-mode.

相关标签:
20条回答
  • 2020-11-29 15:54

    Just changing the style with c-set-style was enough for me.

    0 讨论(0)
  • 2020-11-29 15:54

    From my init file, different because I wanted spaces instead of tabs:

    
    (add-hook 'sql-mode-hook
              (lambda ()
                 (progn
                   (setq-default tab-width 4)
                   (setq indent-tabs-mode nil)
                   (setq indent-line-function 'tab-to-tab-stop) 
                   (modify-syntax-entry ?_ "w")       ; now '_' is not considered a word-delimiter
                   (modify-syntax-entry ?- "w")       ; now '-' is not considered a word-delimiter 
                   )))
    
    0 讨论(0)
提交回复
热议问题