wishlist
wishlist copied to clipboard
Heuristically set buffer options
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.
~~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.
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.
@Shatur Does https://github.com/NMAC427/guess-indent.nvim satisfy all your wishes?