-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
Option to disable EditorConfig override? #83
Comments
Found this undocumented option: let g:sleuth_editorconfig_overrides = {
\ expand('$HOMEBREW_PREFIX/.editorconfig'): '',
\ } |
I think there is a related challenge here with NeoVim. @tpope, I'm not sure if you consider NeoVim a supported user of this plugin (although I use and have been using it regularly together over the last few years). NeoVim has fairly recently merged built-in editorconfig support: neovim/neovim#21633. It would be really nice to be able to disable the editorconfig capabilities of vim-sleuth, whilst retaining its heuristics (which are super-useful in the 80% case where editorconfig is not yet used for a project). |
Disabling EditorConfig in Sleuth would cause it to apply heuristics even when a relevant EditorConfig rule exists. Depending on autocommand order this could even cause Sleuth's heuristics to override Neovim's built-in EditorConfig support. Whereas now, the worst case scenario is settings get applied twice. Am I missing something? |
@andrewferrier Alternatively, disable Neovim's builtin EditorConfig support in favor of vim-sleuth's (pending neovim/neovim#21649): let g:editorconfig = v:false |
I don't think this option supports what I want to do. I want to override editorconfig but only in |
It doesn't do what you want to do, but it solves the problem you're trying to solve. Namely the problem is using
There's a difference between "this project uses spaces for indentation" and "every file in every subdirectory of this directory should use spaces instead of tabs". Personally, any time I see For what you want to do, there's no built-in solution, but it should be straightforward to achieve by sticking a
Citation needed. I don't see anything in the EditorConfig spec about that. In fact, some usages of EditorConfig assume you do want it to influence |
You're right, and I agree about
Interesting idea! I suppose I can add that to my existing clones as well. Thanks. |
If you call |
Oh please do. That will help a lot more than just Sleuth users. I think the ideal fix there would be to target not (just?) file extensions but the containing directories. The |
This feels like an unfortunate situation:
I have a Go project with no modeline or editor config. I use default
sw
which is4
.I use LSP go to definition to jump around and end up in something like
/opt/homebrew/Cellar/go/1.18.3/libexec/src/fmt/print.go
. Then thesw
suddenly becomes2
.:verbose Sleuth
tells me:To Sleuth, it's definitely working as expected. But not sure I ever want this as everything in my homebrew packages will respect the homebrew's root
.editorconfig
.This would normally be fine as I'll never edit these files. But since I have the indent line on, things look very strange. I always have to pause and think if something is wrong.
Maybe an option to disable the EditorConfig? Or exclude folder? The latter feels heavy...
The text was updated successfully, but these errors were encountered: