开发者

Emacs: Makefile tab size

开发者 https://www.devze.com 2023-02-21 12:02 出处:网络
How t开发者_高级运维o make tab to indent by 4 spaces (be it spaces or true tabs like in makefiles). By default my emacs inserts 2 spaces in C files and tabs indent by 8 in makefiles.

How t开发者_高级运维o make tab to indent by 4 spaces (be it spaces or true tabs like in makefiles). By default my emacs inserts 2 spaces in C files and tabs indent by 8 in makefiles.

Thanks.


I have this in my emacs config file to set tab width to 4 globally:

; Turn on tabs                                                                                                       
(setq indent-tabs-mode t)                                                                                             
(setq-default indent-tabs-mode t)                                                                                     

;; Bind the TAB key                                                                                                   
(global-set-key (kbd "TAB") 'self-insert-command)                                                                     

;; Set the tab width                                                                                                  
(setq default-tab-width 4)                                                                                            
(setq tab-width 4)                                                                                                    
(setq c-basic-indent 4)  
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号