this post was submitted on 05 Dec 2023
884 points (98.0% liked)

linuxmemes

20753 readers
1631 users here now

I use Arch btw


Sister communities:

Community rules

  1. Follow the site-wide rules and code of conduct
  2. Be civil
  3. Post Linux-related content
  4. No recent reposts

Please report posts and comments that break these rules!

founded 1 year ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] arandomthought@sh.itjust.works 49 points 9 months ago (2 children)

If they don't understand this, can we even call it intelligent life?

[–] partial_accumen@lemmy.world 61 points 9 months ago (10 children)

Maybe they use Emacs.

Bonus: I googled "emacs" to make sure I got the capitalization right for the post and Google is throwing shade:

[–] TurnItOff_OnAgain@lemmy.world 11 points 9 months ago (1 children)
load more comments (1 replies)
[–] hemko@lemmy.dbzer0.com 6 points 9 months ago (1 children)
[–] dukk@programming.dev 6 points 9 months ago (1 children)

It’s the other way around, too.

Not as true though.

[–] hemko@lemmy.dbzer0.com 3 points 9 months ago

This gotta be some inside joke leaking from google

[–] dubyakay@lemmy.ca 5 points 9 months ago

Maybe it's time to stop using GOOG

[–] Willem@kutsuya.dev 4 points 9 months ago
[–] possiblylinux127@lemmy.zip 4 points 9 months ago
load more comments (5 replies)
load more comments (1 replies)
[–] vsis@feddit.cl 34 points 9 months ago (1 children)

wrong: you press esc multiple times to make sure you are in normal mode.

[–] treadful@lemmy.zip 14 points 9 months ago

At least 3 times. 5 to make sure.

[–] doctorn@r.nf 25 points 9 months ago (1 children)
[–] hemko@lemmy.dbzer0.com 22 points 9 months ago (2 children)

You shouldn't really use editor with sudo, but instead use sudoedit to edit files restricted to root user

SUDO_EDITOR=nano sudoedit /etc/fstab

This accomplishes the same function while running the text editor as unprivileged user

[–] doctorn@r.nf 10 points 9 months ago* (last edited 9 months ago) (2 children)

Why?

Files from user: nano

Files from root: sudo nano

Files from another user: sudo nano (and if new sudo chown after)... 😂

Never had any problems with this in over 10 years... 😅😂

[–] Hawk@lemmy.dbzer0.com 13 points 9 months ago (2 children)

Doing sudo nano will not load your user configuration, sudoedit will. I had plenty of problems with this, but I assume you don't have any custom configuration.

[–] samuelc@lemmy.world 8 points 9 months ago* (last edited 9 months ago)

One reason why sometime I don't do sudoedit is that I make a lot of changes to the config/restart service/see it works/edit etc.. sudoedit only write to the file when exiting, so that flow won't work...

for example when having adding a new host on nginx and some configuration and see if everything work (sudo vim/systemc nginx restart/curl https:// domain loop)

but yeah in general i'll just use sudoedit (which alias to se for me) for my root editing

load more comments (1 replies)
[–] hemko@lemmy.dbzer0.com 3 points 9 months ago (1 children)

As mentioned, to prevent running your text editor with root permissions. It's just security optimization

[–] doctorn@r.nf 4 points 9 months ago (12 children)

Let me rephrase my question:

Why would I not want to open nano as root?

No offense, but that sounds like more OCD behavior. 😅 I don't need or want protection against myself, and I even loath the whole "that's not how you're supposed to do it"-mentality of linux (where when commands know very well what you want, instead of doing it, just tell you you forgot something). 😅

load more comments (11 replies)
[–] Huschke@lemmy.world 7 points 9 months ago (6 children)

Alternatively you could use my favorite approach, Visual Studio Code. Just open the file with it, edit it and upon saving you will be promoted if the file needs admin rights to save.

[–] LaSaucisseMasquee@jlai.lu 7 points 9 months ago* (last edited 9 months ago) (1 children)

Okay but how can I show how good I am with shortcuts to edit legacy software ?

load more comments (1 replies)
[–] MalReynolds@slrpnk.net 3 points 9 months ago

Yup, s/vsc/kwrite/ personally, it's lighter, but why shouldn't I have a pretty for my config editing needs...

load more comments (4 replies)
[–] SigHunter@feddit.de 21 points 9 months ago* (last edited 9 months ago) (2 children)

until the moment you realize that somehow you are not on your native keyboard layout and where the hell is : and ! in this weird language??!

[–] lseif@sopuli.xyz 8 points 9 months ago* (last edited 9 months ago)
[–] JetpackJackson@feddit.de 3 points 9 months ago

I have done this too many times now lol, you'd think I would have learned

[–] MacNCheezus@lemmy.today 20 points 9 months ago (1 children)

"I use Arch Linux btw"

*doesn't know how to use vim

Pottery

load more comments (1 replies)
[–] marietta_man@yall.theatl.social 19 points 9 months ago* (last edited 9 months ago) (3 children)

ESC Z Z

Although I usually bang ESC a few times to
make sure i’m back to command mode

[–] lseif@sopuli.xyz 12 points 9 months ago (1 children)
[–] digger@lemmy.ca 6 points 9 months ago (1 children)

Double Z's will save and then exit. The command on until board will exit without saving changes.

[–] Astaroth@lemm.ee 3 points 9 months ago

yeah to exit without saving you do ZQ instead of ZZ

load more comments (1 replies)
[–] TimeSquirrel@kbin.social 17 points 9 months ago (1 children)
[–] _cnt0@sh.itjust.works 16 points 9 months ago (3 children)

Great, now all my changes are lost. Thank you very much!

[–] possiblylinux127@lemmy.zip 10 points 9 months ago

Your welcome!

load more comments (2 replies)
[–] key@lemmy.keychat.org 11 points 9 months ago (2 children)
[–] WaterWaiver@aussie.zone 7 points 9 months ago* (last edited 9 months ago)

Alternative:

Ctrl-z  
kill -9 %1   # Shell keeps track of job pids for you, job 1 is %1, job 2 is %2, etc
fg  # Not technically necessary, but it's fun to see the corpse
[–] possiblylinux127@lemmy.zip 5 points 9 months ago (1 children)
[–] SpaceCadet@feddit.nl 3 points 9 months ago* (last edited 9 months ago)

Reminds me of the time I brought down a whole AIX server with the killall command back in the 1990s.

On AIX killall really means kill every single process.

[–] cupcakezealot@lemmy.blahaj.zone 8 points 9 months ago (3 children)

i think you mean ctrl s and ctrl x

load more comments (3 replies)
[–] glowie@h4x0r.host 7 points 9 months ago

What is this sorcery?! I thought you had to reboot each time to exit.

[–] kbotc@lemmy.world 5 points 9 months ago (3 children)

META-C :wq!

ESC is all the way over there and my hand is already on the space bar.

load more comments (3 replies)
[–] Tenthrow@lemmy.world 5 points 9 months ago (2 children)

That's only if you don't want to save first (ahem write the buffer).

[–] Jorgelino@lemmy.ml 9 points 9 months ago

Odds are if you don't know how to exit vim you probably don't want to save whatever you wrote in there.

[–] possiblylinux127@lemmy.zip 7 points 9 months ago (1 children)

Who in there right mind would want to save a bunch of gibberish

[–] QuazarOmega@lemy.lol 4 points 9 months ago

ihh splqqiq:wq

Wear your mistakes proudlyq!

load more comments
view more: next ›