Bạn từng xài .editorconfig
chưa?
https://github.com/editorconfig/
Nếu chưa thì mình khuyên nên xài, nó là 1 công cụ tự động tuỳ chỉnh code-style-type cho bạn.
Nó hỗ trợ phần lớn các editor hiện nay, vì vậy nếu mai này có đổi editor/môi trường khác, chỉ cần bê file đó đi là được.
VS editorconfig
Demo code-style của mình:
root = true
[*]
end_of_line = LF
charset = utf-8
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
[*.{cpp,h,js,php}]
max_line_length = 80
insert_final_newline = true
[*.{html,phtml}]
insert_final_newline = false
[Makefile]
indent_style = tab
indent_size = 4
# Adding
[*.tmpl]