首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在文本模式下在Emacs中设置4个空格缩进?

如何在文本模式下在Emacs中设置4个空格缩进?
EN

Stack Overflow用户
提问于 2018-03-22 07:55:19
回答 2查看 0关注 0票数 0

TAB使用主模式按下缓冲区时,我一直没有成功让Emacs从8个空间制表符切换到4个空间制表符text-mode。我已将以下内容添加到我的.emacs

代码语言:javascript
复制
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)

;;; And I have tried
(setq indent-tabs-mode nil)
(setq tab-width 4)

无论我如何更改我的.emacs文件(或我的缓冲区的局部变量),TAB按钮始终会执行相同的操作。

  1. 如果上面没有文字,请缩进8个空格
  2. 如果上一行有文本,请缩进第二个单词的开头

尽管我爱Emacs,但这变得令人讨厌。有没有办法让Emacs在上一行没有文本的情况下至少缩进4个空格?

EN

Stack Overflow用户

发布于 2018-03-22 16:13:06

代码语言:javascript
复制
(customize-variable (quote tab-stop-list))

或在.emacs文件中将制表符停止列表条目添加到自定义设置变量中:

代码语言:javascript
复制
(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(tab-stop-list (quote (4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120))))
票数 0
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/-100007738

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档