wkirschbaum / elixir-ts-mode

Elixir mode using Treesitter for fontification, navigation and indentation
GNU General Public License v3.0
61 stars 11 forks source link

Using tabs instead of spaces #25

Closed slondr closed 1 year ago

slondr commented 1 year ago

Hi, it seems like files I edit with elixir-ts-mode and heex-ts-mode use spaces instead of tabs; do the modes expose configuration which allows me to change this?

wkirschbaum commented 1 year ago

@slondr elixir-ts-mode does not dictate tabs or spaces. You can disable tabs by setting:

(setq-default indent-tabs-mode nil)

I believe it is standard for elixir code to use spaces, so there might be motivation to enable this in the mode itself. What do you think?

slondr commented 1 year ago

@wkirschbaum I think I might not have explained right. I want tabs, I have indent-tabs-mode set to t, but in elixir-ts-mode and heex-ts-mode buffers, I am getting spaces instead of tabs. If elixir-ts-mode doesn't do anything about tabs or spaces, maybe I have mucked up my config somehow else, hmmm...

wkirschbaum commented 1 year ago

I misread. It is not common for Elixir users to use tabs, but also don't want to limit options for the sake of it. If you use the mix formatter, I believe it will convert tabs to spaces. Let me have a look why elixir-ts-mode might not allow tabs, because I don't recall there being anything blocking this.

slondr commented 1 year ago

Ah, I think maybe the elixir language server auto-formats on save. This probably isn't something to do with elixir-ts-mode, as you say