-
Notifications
You must be signed in to change notification settings - Fork 31
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
check adjacent-files like vim-sleuth #43
Comments
I think this would need some more work, but it's mainly a matter of selecting suitable files and then feeding them to dtrt to get the settings, then applying them to the new buffer; I don't know vim-sleuth, but presumably its algorithm could be copied. As far as the code goes, the guts of So realistically this would require some work, but it'd be great to have! An alternative solution is to write out the current settings to a |
It would definitely be appreciated, the problem with per project mechanisms is that one usually manages many file-types in one project and one might have different indentation settings for them, sure you could specify them, but then dtrt wouldn't make much sense then, since it wouldn't need to actually analyze anything. but it's rare when two files of the same file-type have different indentation, so that's why I suggested that, I guess it wouldn't have to scan all the buffers available, I imagine something like this:
If this is my folder layout, dtrt would first try with old.js, then if no information is found (empty lines, no indentation found etc.) it would go on to scan older.js, and if still no information is found, it would go one level up and search for Thanks for your thoughtful response! |
More often than not I find myself creating a new file, it would be useful that dtrt adjusts indentation settings based on a few files of the same type adjacent to it, or maybe in the parent directories, would this be possible with the existing code-base? if so, how?
thanks for such a nice plugin, btw
The text was updated successfully, but these errors were encountered: