editorconfig / editorconfig-vim

EditorConfig plugin for Vim
http://editorconfig.org
Other
3.13k stars 137 forks source link

Add the ability to disable individual rules per-buffer #155

Closed midchildan closed 3 years ago

midchildan commented 3 years ago

This change introduces a buffer-local version of g:EditorConfig_disable_rules. It's useful in cases where EditorConfig rules are in conflict with the file syntax, e.g. space indents in Makefiles.

Somewhat related to #154

cxw42 commented 3 years ago

I had forgotten until just now that we have g:EditorConfig_disable_rules (#89, #90). If it were up to me, I would remove that variable as well, so please don't think of it as a model :) .

midchildan commented 3 years ago

Are there other specific applications you have in your mind?

I haven't run into this problem outside of Makefiles, but I did run into it often because I occasionally write my own personal Makefiles for projects that doesn't have one. I just currently disable EditorConfig altogether for Makefiles, but I thought it'd be great if I can only disable rules that's causing a problem. However, I do think this is a minority use case, so I'm happy with closing this PR though.

cxw42 commented 3 years ago

@midchildan Thanks very much for your understanding! For what it's worth, I have never had a PR rejected for adding a .editorconfig file ;) . Happy hacking!