some

joined 5 months ago
[–] some@programming.dev 2 points 3 weeks 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.

[–] some@programming.dev 3 points 4 weeks 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

[–] some@programming.dev 2 points 4 weeks 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.

[–] some@programming.dev 1 points 4 weeks ago

I am probably a bit over the top with this tbh. I put everything in functions, even single-use activities like declaring initial variables at the beginning. I just do it to enable the code folding. Even though everything I do is small time and I'm sure it's not excessively burdensome on the system, it seems wasteful to me to have the computer hold a the function in memory when it's never going to get used again. So I was thinking this might be more efficient in such cases.

 

I noticed that the developer of kitty terminal uses this style of comments I have rarely if ever seen elsewhere:

outside
#: section {{{
inside
#: }}}

Kate text editor recognize sections for purposes of highlighting, folding etc. It's really nice for me because I sometimes I have a difficult time navigating large text files. And it lets you nest them.

  • what is this called?
  • are there other ways to do it?
  • is it standard among text editors? I believe Kovid the dev for kitty is a vim guy so presumably there is support there also.
  • why don't more people use it? are there problems?

Screenshot that shows the code folding.

  • Cursor is at the end of line 7 so the whole section line 7-22 is highlighted
  • lines 12-16 are folded in a 3rd level comment
  • I also included tab indents just to make it easier to see what's going on (Kate treats it the same way regardless of indents)
  • Highlighting/Mode > Scripts > Bash

I also like his style of distinguishing between narrative comments (starting with #:) and commented-out code (starting with #). Although in my example, Kate doesn't treat them differently. Is there a term for this? Any conventions, support etc?

plain text used for screenshot


#: Comment level 1 {{{
	#: Comment level 2 {{{
		#: configure something
		key value
	#: }}}
	#: Another Comment level 2 {{{
		#: Comment level 3 {{{
			#: Helpful explanatory comment
			file location
		#: }}}
		#: Comment level 3 with hidden text {{{
			you_cant see_this
			hidden_emoji "👁️"
			hidden_emoji2 " 👁️"
			hidden_emoji3 "   👁️"
		#: }}}
		#: let's set some things up
		# setting yes
		# other_setting no
		different_setting maybe
	#: }}}
	# regular comment
#: }}}

# regular comment outside anything


For a real world example, see sample kitty.conf file provided on project website.

[–] some@programming.dev 14 points 4 months ago (1 children)

That's a very nuanced analysis. I've explained it this way especially to people who describe themselves as "bad at computers". Hey, give yourself a break, you've learned a lot about how to cope with windows. But this investment leads to a conservatism--- they dont want to learn coping skills o a new system. The devil you know.

I'd just add that GUI is more discoverable. When faced with a terminal, what to do? Whereas with a GUI you have a menubar, some icons etc. The GUI gives a lot more hints.

In the terminal (which I love) it is more powerful once you know how to crack the lid.

[–] some@programming.dev 12 points 4 months ago

I felt the same way every time I tried to use Twitter as I feel every time I try to use Mastodon. It's either way too much or way too little. I prefer everything about the reddit/lemmy/threadiverse style.

How would we even be having this conversation on microblogging? A bunch of reposts, with or without comments, disconnected from each other... So much nicer to have a "subject" line and a page where every relevant comment is presented.

[–] some@programming.dev 2 points 4 months ago (1 children)

Can you imagine if the threadiverse was sorted that way? It would be insane and essentially unusable at scale

On lemmy there is a way to basically do this by toggling the filters at the top of the top of the front page. You can see how this looks form my instance: https://programming.dev/?dataType=Comment&listingType=All&sort=New

I've always assumed nobody every uses it like that. I guess if you were bored you might get lucky and see something that interested you, at least if it was limited to Local and you were on a good instance.

[–] some@programming.dev 1 points 4 months ago

I'm really interested in the concept.

I would like to see community-oriented search engines. But I don't know if "the community" is viable really. It would better be for communies. I just downloaded the browser extension and it lets you see the pages it is crawling; they are the sorts of things that would be of interest to a lemmy type community--- a lot of nerd stuff. Which is of interest to me. That's why I'm here. :)

What if I am in an online community interested in a different part of the web--- say celebrity gossip and royal watching. A network of forums, comment sections, socials, chats etc with thousands of people who are at least casually interested and some hundred who are very motivated. Like everyone else the web is getting harder for us to navigate. How realistic would it be for us to spin up an instance of this to make our own community search engine? This community does not want to see a bunch of stackoverflow, gihubs, arxiv papers, tech news or the other stuff I am seeing float past me in the crawling extension.

It seems that the place where this kind of thing is somewhat documented would be https://book.mwmbl.org/


but it's pretty vague.

[–] some@programming.dev 3 points 4 months ago

mumble is already the name of FLOSS voip software so they're probably better off with the existing name. Which I don't love on first glance but there's probably some rationale for it.