LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1807|回复: 4

emacs如何设置自动缩进

[复制链接]
发表于 2004-8-2 00:21:03 | 显示全部楼层 |阅读模式
我在网上搜索了一些文档, 查看了
使用C-c C-a切换到auto-state 子模式, 就支持自动缩进了。

但是我试过,还是不行啊。
发表于 2004-8-2 09:01:53 | 显示全部楼层
  1. C-j runs the command newline-and-indent
  2.    which is an interactive compiled Lisp function in `simple'.
  3. (newline-and-indent)

  4. Insert a newline, then indent according to major mode.
  5. Indentation is done using the value of `indent-line-function'.
  6. In programming language modes, this is the same as TAB.
  7. In some text modes, where TAB inserts a tab, this command indents to the
  8. column specified by the function `current-left-margin'.
复制代码
 楼主| 发表于 2004-8-2 11:42:41 | 显示全部楼层
是C-j了?

没有起到效果啊。

看来还要继续摸索啊。

不过谢谢Vel的回复!^_^
发表于 2004-8-2 12:26:07 | 显示全部楼层
indent according to major mode.

你想要某种格式的缩进,必须进入那个major mode,比如c和c++就要cc-mode,java要java-mode。
在text模式是没有什么缩进的概念的。
 楼主| 发表于 2004-8-2 12:39:57 | 显示全部楼层
恩, 我使用emacs iot.cpp, emacs就已经自动进入了c++模式了。

(虽然一般不应该象我这么使用emacs iot.cpp命令进入emcas)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表