Skip to content

Instantly share code, notes, and snippets.

@GuyHoozdis
Created July 18, 2024 16:47
Show Gist options
  • Save GuyHoozdis/2a59f0230a82e86b5d668718e53c17b7 to your computer and use it in GitHub Desktop.
Save GuyHoozdis/2a59f0230a82e86b5d668718e53c17b7 to your computer and use it in GitHub Desktop.
Verify that your editor is respecting the correct .editorconfig file and what configuration is being applied.

From this thread:

This will show the settings for a file with the .txt extension, but it probably should be the filetype you are debugging.

$ vi
:let g:EditorConfig_verbose=1
:e anything.txt
Applying EditorConfig vim_core on file "/home/guyhoozdis/something.sh"
Options: {'max_line_length': '79', 'insert_final_newline': 'true', 'end_of_line': 'lf', 'charset': 'utf-8', 'indent_style': 'space', 'i
ndent_size': '2', 'trim_trailing_whitespace': 'true', 'tab_width': '2'}
"something.sh" [New]
Applying EditorConfig vim_core on file "/home/guyhoozdis/something.sh"
Options: {'max_line_length': '79', 'insert_final_newline': 'true', 'end_of_line': 'lf', 'charset': 'utf-8', 'indent_style': 'space', 'i
ndent_size': '2', 'trim_trailing_whitespace': 'true', 'tab_width': '2'}

Or you could open the actual file you want.

$ vi somethings.sh
:let g:EditorConfig_verbose=1
:e
"something.sh" [New]
Applying EditorConfig vim_core on file "/home/guyhoozdis/something.sh"
Options: {'max_line_length': '79', 'insert_final_newline': 'true', 'end_of_line': 'lf', 'charset': 'utf-8', 'indent_style': 'space', 'i
ndent_size': '2', 'trim_trailing_whitespace': 'true', 'tab_width': '2'}

See also this and the :help editorconfig (you may need to run :helptags ALL to update the documentation index.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment