The small linux problem thread

My team wants to follow absurd standards for development. I use vim and found a pretty good way to do this.

au BufRead,BufNewFile *.go set shiftwidth=8
au BufRead,BufNewFile *.go set tabstop=8

au BufRead,BufNewFile *.rb,*.py set shiftwidth=2
au BufRead,BufNewFile *.rb,*.py set tabstop=2

Everything else is 4 spaces by default in the global settings – Rust, Bash, JS, etc.

Full settings for anyone interested:

filetype plugin indent on

set expandtab
set shiftwidth=4
set tabstop=4

au BufRead,BufNewFile *.go set shiftwidth=8
au BufRead,BufNewFile *.go set tabstop=8

au BufRead,BufNewFile *.rb,*.py set shiftwidth=2
au BufRead,BufNewFile *.rb,*.py set tabstop=2


set number
syntax enable
1 Like

wait what?

They want 8 wide go files but 2 wide python and ruby?

They’re clearly on meth, stay away.

4 Likes

Google/Golang standards, PEP8 standards (:face_vomiting:), and I guess all the Rails twinks used two spaces back when Ruby was the new hotness so they want to do that. Most people on my team come from a Ruby background. One guy is from game dev/C++. I’m from systems and networking.

My eyes bleed resisting to soap box every single day.

1 Like

8 has a good justification.

There is no justification for 2 spaces.

Unless you’re a shit programmer.

2 Likes

“I have to use a sticky note to see where the indentations are”

Really? REALLY? Your fucking $500 a year IDE doesn’t tell you what space you’re at or where the indents are?

I’m not mad at you, or mad at all. I’m just

fuming

3 Likes

have you tried

sudo tmux

1 Like

I’m of the opinion that 4 space tabs is is ideal, 8 is acceptable for boomers who can’t see well and more over, 2 spaces just makes it very difficult to see where things are.

3 Likes

Every job I’ve had I used four spaces. Unless they specifically asked for something else. But my whole life I’ve used four spaces: Java, JavaScript, C, C++, Go, Rust, Bash, VisualBasic6, PowerShell, Pascal…

I don’t get why Rob Pike decided to do 8 spaces, unless they just thought it was funny. Vim defaults to 6 so that would have made more sense.

2 Likes

@SgtAwesomesauce Maybe it’s because Golang was the 8th successful project at Google

I’ll see myself out :wave:

1 Like

what?

that’s not base 2

Oh weird, it is eight. I thought it was six. Maybe it was prior to version 8.x? :thonk:

No idea dude, 6 spaces would be about as dumb as 3 spaces.

2 Likes

Maybe it’s always been that way. My whole life is proving to be a lie.

2 Likes

That’s been my 2020 as well. :confused:

2 Likes

The sudo thing is resolved, or do you mean to capture the exit code?

Might be a good addition to your defaults if there are more complicated cases where you need to change tab/indent behavior.

Also, I use 2-space indent for shell scripts (sorry sgt).

2 Likes

Lmao

RE: vim-sleuth

Nice, if this becomes a burden to maintain I’ll look into that.

I love tpope’s stuff. I use vim-surround and vim-fugitive

1 Like

image

5 Likes

Is it not possible to map Control + Escape in tmux? Trying to make it more vim-like. C-Escape, C-Esc, etc say it’s not a valid key.


I just made a mapping in the terminal emulator instead.


New tmux issue…

When I bind a key for next-window it says No next window but when I actually enter the command next-window it works… (same with previous-window).

And this seems to only happen with my particular binding (left and right arrows). If I use the defaults it works.

I’m bumping my head against the wall with something that should be so simple.

I want to make some encrypted 7z archives, so I can upload them to google drive for backup.
I don’t care about compression, since the gain are so small, and the added time to create the archive are so huge.

But gnomes built in file roller has no option for compression level when creating the archive. I googled about and installed the dconf-editor, and found the place to set the default compression level.

But all the guides says to set the level to maximum, for storing with no compression. Which goes completely against my own logic when I want zero compression.

But testing with an .mkv file, the cpu is pinned at 100% on both very fast and maximum. So it doesn’t make a difference anyway…

I’ve also tried out peazip, it has the option to store files, and it’s pretty much at regular copy-paste speed, which the “store option” should be.
But every time it finishes making an archive, it spits out an error. It stops at 99% with error 127: Cannot execute requested operation. None of my googling have revealed an answer to that problem.
So I can’t trust it, since it can’t complete its job without an error.

Man I miss Winrar…

So, is there some way to set file roller default compression to zero compression?