Need some help with configuring indentation prefs #14749
-
|
Just started using Helix, enjoying it so far. I'm having trouble configuring my indentation prefs. Specifically, I want TypeScript/JavaScript files to only use two spaces for indentation. I feel like I might be not understanding something about how Helix approaches language-specific indentation. My configs are as follows: If I create an empty But if I open any existing file in our repo, the indentation reverts to four spaces. I recorded a video: hx-tab.movAny help or pointers would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
The mystery deepens as this seems to work on my personal laptop running Arch but not on my work laptop running macOS. Same version in both: |
Beta Was this translation helpful? Give feedback.
-
|
I figured it out! The project had an As you can see, it defines
I'm not sure why Helix defaults to 4 instead of |
Beta Was this translation helpful? Give feedback.
I figured it out! The project had an
.editorconfigfile which I wasn't aware of:As you can see, it defines
indent_stylebut notindent_size. Reading helix-core/src/editor_config.rs (forgive me, I'm not a Rust programmer) it seems that the logic is:indent_sizeis number then use thatindent_sizeis tab (?) then usetab_widthI'm not sure why Helix defaults to 4 instead of
languag…