Replies: 12 comments
-
If I may ask, what's the reasoning behind this style choice? It seems odd, especially considering that some might have their tab render width to be set to something other than 8. |
Beta Was this translation helpful? Give feedback.
-
Not our choice, it's a horrible legacy we have to work with.. |
Beta Was this translation helpful? Give feedback.
-
Vim and Emacs can handle it. In Vim it's |
Beta Was this translation helpful? Give feedback.
-
Is the formatter used at all when editing a file or only when formatting using for example |
Beta Was this translation helpful? Give feedback.
-
I was confused here at first because you didn't post the full vim config/the explanation was a bit unclear. What you have is that the visual width of a tab char is set to 8 ( Helix can run an autoformatter on save (you just need to turn it on, clangd can do the autoformatting) so that can easily cover the "turn 8 spaces into a tab" usecase. What that doens't cover is the usecase of turning the tab back into spaces. The most ergonomic way to deal with this is likely to just work entirely with spaces and to run clangfmt in a precommit hook. I am not sure if we want to support this in core since it does seem really niche and add quite a bit of extra completiity to tab. |
Beta Was this translation helpful? Give feedback.
-
Sorry for the confusion. I know nothing about vim. My coworker gave me that snippet saying that's what does what we need. How would I do Yeah I understand it's a niche style by now. Re-styling the code is not an option. For now I went back to Spacemacs.. |
Beta Was this translation helpful? Give feedback.
-
tabstop=8 and shifttab=4 would be equivaent to setting |
Beta Was this translation helpful? Give feedback.
-
Ah I see. Yeah I tried that and while it displays the code correctly, editing and inserting new code doesn't get correctly indented. |
Beta Was this translation helpful? Give feedback.
-
My hopes are that we can do a minimal whitespace change and convert tabs to spaces to save our sanity, and enable me to go back to my favorite editor :) |
Beta Was this translation helpful? Give feedback.
-
Yeah I thought about it a bit more and this just seems way to nieche to be supported in core. Another possible workaround for you could be to have git hooks that convert tabs to spaces in checked and then convert back on check in |
Beta Was this translation helpful? Give feedback.
-
That is a valid argument, but another one could be: If Helix is going to be compete with Emacs, Vim, VSCode, etc, maybe it needs to support the same flexibility and configurability (when it comes to critical features like style and formatting)? I know Helix is still young and I think many are willing to compromise on non-critical features and functionality to use it, but lack of a |
Beta Was this translation helpful? Give feedback.
-
FWIW,, I also encountered this issue today while evaluating helix. In APT, we indent with 3 spaces and replace 8 spaces by tabs, a completely crazy indentation scheme but it is what it is... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All!
Is there a way to configure indent setting for mixed tabs? That is, basic indent is 4 spaces, but whenever the indent is a multiple of 8 (so 2nd level, 4th level, etc), a tab is used instead? We have a big project that uses this style and it would be awesome if I could use Helix for it.
If not supported by Helix yet, is there something I can add in the grammar file to make this work?
Thank you!!!
Beta Was this translation helpful? Give feedback.
All reactions