3

Yes, we can convert tabs to spaces via Sublime, VS-Code and etc, it's not a big problem.

But what if I want to get rid off this additional action ?

Found answer by adding this line to .nim file :

#? replace(sub = "\t", by = "    ")

My additional question is :
What is this #?, how this thing works and what kind of variations I can find also, for example:
#!
#some_chinese_character

How2
  • 365
  • 1
  • 6

1 Answers1

2

It is called a "source code filter", it's like a Nim preprocessor less powerful than macros and templates. You can read about it here: https://nim-lang.org/docs/filters.html

Anyway, I wouldn't recommend using it, but rather using an editor which replaces tabs with spaces, such as vscode. This seems more like an hack than an actual solution.

Davide Galilei
  • 484
  • 6
  • 9