[–] [S] 2 points 1 year ago

I am very rarely working in other people's stuff because I am too rudimentary but of course I try to follow their rules when I do.

For my own purposes, I would do it in one of the below ways. I made the case more complicated by changing the lengths. I mostly choose consistent levels of indentation using tabs over per-character alignment but not always.

[--] = tab, ~ = single space (and double space = double space in front of comments for legibility here)

function() {
[--]var = 1
[--]another_var = 2
[--]indented(arg, arg2, arg3)
[--]indentedTwo(arg, 
[--]~~~~~~~~~~~~arg2,
[--]~~~~~~~~~~~~arg3)  #: aligned by spaces to match specific charecter length
[--]indentedThree(
[--]~~~~~~~~~~~~arg,
[--]~~~~~~~~~~~~arg2)  #: aligned by space to arbitrary charecter length, same as the previous
[--]indented4(
[--][--]arg,
[--][--]arg2)  #: aligned by tabstop by level
[--][--]~~~~~  #: this would be my preference overall if I had to chose
[--][--]~~~~~  #: (which so far I haven't)
}

Kate has a great feature called "insert smart newline" which I shortcut to shift+enter. If you are typing for example on the penultimate line above and "insert smart newline" it'll automatically fill the line with [--][--]~~~~~ #: and put the cursor at the end. This feature really enables a lot of these habits for better or worse.

When I write output to terminal I really like being able to use tabs to modify the length of tabs according to what is the content. Sometimes I wish I could set tabs in my editor (like a word processor), it would make things simpler. But then there's portability issues for non standard features like that so.

  • source
  • parent
  • context
  • [–] [S] 3 points 1 year ago (4 children)

    Thanks! Searching for this led me to this extremely charming website where in addition to robust folding, the author argues in favor of proportional width fonts and tabstops (not spaces) in coding. Unconventional. It's nice to know someone who processes text in a similar way to me can be a successful programmer. Even if they had to write their own tools. https://tibleiz.net/code-browser/elastic-tabstops.html

  • source
  • parent
  • context
  • [–] [S] 2 points 1 year ago

    It makes sense it's a Vim thing since it's used in kitty config. When I search for marker based folding as someone else said it's called above, almost everything I get is for Vim. It's always confused me why gui-based text editors seem to not have a lot of visually-based features like this compared to terminal-based editors. I guess it's harder to create a system for user customization in a GUI application.

    At least Kate has some support. Now that I know what it's called I will look into what else is available there.

  • source
  • parent
  • context