如何在emacs中自动格式化(而不仅仅是自动缩进)c++代码
How to autoformat (not just auto-indent) C++ code in emacs?
如何在emacs中按照gnu风格自动格式化c++代码?
有这个自动换行的东西:https://www.gnu.org/software/emacs/manual/html_node/ccmode/Auto_002dnewlines.html,但即使我将style设置为GNU,它也不会将返回值与函数名分开放在单独的行上。
我还想在参数列表中的参数之间添加空格。我可以在我写完代码后"运行"一些东西(而不仅仅是在我输入的时候移动东西)
这里已经回答过了。有一个叫做astyle
(艺术风格)的工具,可以用c++格式化代码。
(defun astyle-this-buffer (pmin pmax)
(interactive "r")
(shell-command-on-region pmin pmax
"astyle" ;; add options here...
(current-buffer) t
(get-buffer-create "*Astyle Errors*") t))
相关文章:
- clang格式:宏的缩进
- C++setiosflags函数操纵器-未确定的缩进
- 为什么这个案例陈述需要一个"if else"而不仅仅是一个"if"?
- std::find,返回所有找到的值的替代方法,而不仅仅是存在重复的向量的第一个值
- 为什么C++总是显示十六进制内存地址,而不仅仅是整数?
- 为什么我们要做"INT_MAX/10"而不仅仅是INT_MAX?
- VSCode 中带有 C/C++ 扩展名的多行注释缩进错误
- 为什么 std::vector 需要 is_trivial 才能按位移动,而不仅仅是is_trivially_copya
- 为什么在这个C++问题中使用const_iterator而不仅仅是迭代器?
- C++,从文件读取到结构,然后读取到向量(结构被推入向量太多次,而不仅仅是一次)
- 如果要求比较器是严格的总排序,而不仅仅是严格的弱排序,C++标准算法会更快吗?
- 为什么我们必须在 C++ 中释放数组数组,而不仅仅是整个"matrix"
- 如何使用c++调整文本文件中代码的缩进?
- 如何在C++中制作 clang 格式的缩进 extern C 块?
- 在 vscode 中使用特定缩进/对齐 C/C++ 自动格式化
- 十进制文字不仅仅是LONG_LONG_MAX
- "If Else"语句缩进在C++中是否重要?
- 为什么非放置"新建"和"删除"内置于语言中,而不仅仅是常规函数?
- 构造函数中初始值设定项列表的缩进是错误的
- 如何在emacs中自动格式化(而不仅仅是自动缩进)c++代码