在许多 emacs 模式下,多行函数调用的默认缩进样式是将右圆括号与函数的其他参数对齐,因此:
function_one(
arg1,
arg2
);
Run Code Online (Sandbox Code Playgroud)
如果右括号与包含左括号的行的开头对齐,我会更喜欢它。例如:
function_one(
function_two(
f2_arg1,
f2_arg2
),
f1_arg2,
f1_arg3
);
Run Code Online (Sandbox Code Playgroud)
我该怎么做呢?
mav*_*vit 13
c-offsets-alist
以将arglist-close
其设置为c-lineup-close-paren
.cperl-indent-parens-as-block
为 true。cperl-close-paren-offset
为负数cperl-indent-level
perl-indent-parens-as-block
为 true。您可以通过键入来自定义变量M-x customize-variable
。或者,将以下行添加到您的~/.emacs
:
(add-to-list 'c-offsets-alist '(arglist-close . c-lineup-close-paren))
(setq cperl-indent-parens-as-block t)
(setq perl-indent-parens-as-block t)
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2250 次 |
最近记录: |