Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gq快捷键格式选中代码后的缩进为2格,个人感觉不太美观,如何更改? #55

Open
EndofTimE-code opened this issue Jan 22, 2025 · 2 comments

Comments

@EndofTimE-code
Copy link

No description provided.

@archibate
Copy link
Owner

clang-format的锅,本插件整合包中对cpp文件的格式化背后调用的是clang-format,糟糕的clang-format默认格式化为2缩进。

建议创建~/.clang-format配置文件,里面写一行:

IndentWidth: 4

更多格式化选项,请参考本仓库的dotfiles/.clang-format
https://github.com/archibate/vimrc/blob/nvim-2/dotfiles/.clang-format
如你所见,clang-format默认的配置实在太糟糕了,用我这个配置会好点,你可以基于我这个配置修改。
推测你可能没用我的一键安装脚本,如果用一键安装脚本安装,则会自动把该默认配置拷贝到用户目录的~/.clang-format

@EndofTimE-code
Copy link
Author

问题解决了,非常感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants