Skip to content
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

Heuristically set buffer options #19

Open
Shatur opened this issue Apr 24, 2021 · 3 comments
Open

Heuristically set buffer options #19

Shatur opened this issue Apr 24, 2021 · 3 comments
Labels
help wanted Extra attention is needed idea

Comments

@Shatur
Copy link

Shatur commented Apr 24, 2021

What?
This plugin automatically adjusts 'shiftwidth' and 'expandtab' heuristically based on the current file.

Why?
When you work with several projects, it is not very convenient to manually set formatting parameters. It would be nice to be able to define these options automatically.

Potential existing implementations:
This functionality is provided by default in VSCode. There is also a great plugin https://github.com/tpope/vim-sleuth, but it is written in Vimscript and can slow down the editor.

Potential pitfalls:
It would be nice to implement this feature async.

@Shatur Shatur added help wanted Extra attention is needed idea labels Apr 24, 2021
@matu3ba
Copy link

matu3ba commented Sep 18, 2021

I disagree to make a heuristic to fix missing code formatting settings.
If the language or project has none, it is already unfriendly to contributors.

Please change title to something like "plugin that extracts and conditionally sets options from code formatters (per buffer)".

After thinking more about various formatter config formats (lol), I get convinced about the idea. However I still think languages settings should be hardcoded and used, if the language formatter enforces them.

@Shatur
Copy link
Author

Shatur commented Sep 18, 2021

Please change title to something like "plugin that extracts and conditionally sets options from code formatters (per buffer)".

Sorry, but personally would like to see the plugin exactly as I described. The implementation will be much simpler (no need to handle configuration reading for every possible formatter) and it will work for projects without formatting settings just for free.

@matu3ba
Copy link

matu3ba commented Mar 7, 2022

@Shatur Does https://github.com/NMAC427/guess-indent.nvim satisfy all your wishes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed idea
Projects
None yet
Development

No branches or pull requests

2 participants