A sublime-settings file enforces settings on a per-project basis:
{
"folders": [ ... ]
"settings":
{
"tab_size": 4
}
}
How is it possible to use syntax specific settings in this file, for example to set a tab_size
of 2 only for *.js
files?
sublime-syntax file, then just download it and copy it to ~/. config/sublime-text-3/Packages/User . It will then be available in the syntax menu at the very bottom right of the Sublime window, either on its own (it will say "SystemVerilog") or under the User submenu, depending on your setup.
Projects in Sublime Text are made up of two files: the . sublime-project file, which contains the project definition, and the . sublime-workspace file, which contains user specific data, such as the open files and the modifications to each.
You could checkout .editorconfig.
Basically an .editorconfig file would look like,
# editorconfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,py}]
charset = utf-8
# 4 space indentation
[*.py]
indent_style = space
indent_size = 4
# Tab indentation (no size specified)
[Makefile]
indent_style = tab
# Indentation override for all JS under lib directory
[lib/**.js]
indent_style = space
indent_size = 2
# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2
There's even a nice Sublime Text package that automatically reads and understands them. Just throw your .editorconfig in version control and you're ready to go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With