简体   繁体   English

在emacs中,如何在基本模式下为TAB配置固定宽度?

[英]In emacs, how do I configure fixed width for TAB in Fundamental mode?

I have the following in my .emacs file: 我的.emacs文件中包含以下内容:

(setq-default
    indent-tabs-mode nil
    tab-width 4
    tab-stop-list (quote (4 8 12 16))
)

But in my text file below, in the 3rd line, "3" lines up with "12" when I press TAB; 但是在下面的文本文件的第三行中,当我按TAB键时,“ 3”与“ 12”对齐; it seems to base on the "D" column in the line above. 它似乎基于上面一行中的“ D”列。 I wanted "3" to line up at 8 instead. 我希望“ 3”排成8。 How do I achieve that? 我该如何实现?

0   4   8   12  16
AB  C       D
1   2       3

Thank you. 谢谢。

A simple solution is to change what TAB does to tab-to-tab-stop 一个简单的解决方案是将TAB的功能更改为“逐个tab-to-tab-stop

ie, place the following somewhere in your .emacs file 即,将以下内容放在您的.emacs文件中的某个位置

(global-set-key (kbd "<tab>") 'tab-to-tab-stop)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM