如何更改Emacs中的缩放级别? [英] How to change brace indentation levels in Emacs?

查看:143
本文介绍了如何更改Emacs中的缩放级别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不能通过传统的互联网方式找到任何答案,所以我希望得到一些帮助。



Emacs for right right现在倾向于在大括号上做缩进,如下所示:

  if(...)
{

}

我发现令人难以置信的刺激性;我从来没有见过这种行为。无论如何,我期望的行为是

  if(...)
{

}

如果有人知道如何修改这个,那将不胜感激。

解决方案

基本上你想要:

 (setq c-default-stylebsd
c-basic-offset 4)

对于更多的缩进命令:


Mx c-set样式RET样式RET



选择预定义的缩进样式
样式。类型?当输入风格到
时,看到支持的样式列表;到
找出什么样的样子,
选择它并重新绑定一些C代码。



Cc Co符号RET偏移RET



设置
句法符号符号
(c-set-offset)的缩进偏移量。第二个参数
offset指定新的缩进
offset。


source: http://www.phys.ufl.edu/docs/emacs/emacs_251.html



还有: http://www.gnu.org/software/emacs/manual/html_node/ccmode/Indentation-Commands.html


I can't for the life of me find any answer to this through conventional Internet means, so I'm hoping for some help.

Emacs for me right now tends to do indentation on braces as follows:

if( ... )
  {

  }

Which I find incredibly irritating; I've never even seen this behaviour anywhere else. At any rate, the behaviour I'm expecting is,

if( ... )
{

}

If anyone knows how to modify this, it'd be greatly appreciated.

解决方案

Basically you want:

(setq c-default-style "bsd"
  c-basic-offset 4)

For more indentation commands:

M-x c-set-style RET style RET

Select predefined indentation style style. Type ? when entering style to see a list of supported styles; to find out what a style looks like, select it and reindent some C code.

C-c C-o symbol RET offset RET

Set the indentation offset for syntactic symbol symbol (c-set-offset). The second argument offset specifies the new indentation offset.

source: http://www.phys.ufl.edu/docs/emacs/emacs_251.html

also: http://www.gnu.org/software/emacs/manual/html_node/ccmode/Indentation-Commands.html

这篇关于如何更改Emacs中的缩放级别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆