153
:wq! (lemmy.world)
top 50 comments
sorted by: hot top controversial new old
[-] victorz@lemmy.world 65 points 8 months ago

I feel like the images should be switched.

load more comments (9 replies)
[-] EuroNutellaMan@lemmy.world 50 points 8 months ago

If you wanna save changes: :wq

If not: :q!

Else: :SpanishInquisition

[-] youngGoku@lemmy.world 6 points 8 months ago

Why do so many people prefer :wq over :x?

[-] EuroNutellaMan@lemmy.world 12 points 8 months ago

Cause I don't like to think about my x

[-] rwhitisissle@lemmy.world 5 points 8 months ago

Because :wq to me means "Issue command write, followed by command quit." "Issue command x" to me means nothing in the context of vim, and ctrl + x on most systems is reserved for cutting, so it just "feels" wrong.

load more comments (4 replies)
[-] metallic_z3r0@infosec.pub 6 points 8 months ago

Hmm, I didn't expect that last one.

load more comments (3 replies)
[-] dannym@lemmy.escapebigtech.info 32 points 8 months ago* (last edited 8 months ago)

I prefer the extremely intuitive:

[C-R]=system("grep -P "PPid:\t(\d+)" /proc/$$/status | cut -f2 | xargs kill -9")

or

i:!grep -P "PPid:\t(\d+)" /proc/$$/status | cut -f2 | xargs kill -9[esc]Y:@"[cr]

It just rolls off the fingers, doesn't it?

Edit: damn it lemmy didn't like my meme because it assumes that characters between angle brackets are html tags :( you ruined it lemmy

EDIT 2: rewrote it, just assume that square brackets are buttons not characters

load more comments (2 replies)
[-] aard@kyu.de 29 points 8 months ago

I always get annoyed when I'm on some system and nano pops up and I need to figure out how to kill that thing.

[-] jol@discuss.tchncs.de 29 points 8 months ago

Nano literally tells you all the shortcuts to your face.

load more comments (7 replies)
[-] mvirts@lemmy.world 7 points 8 months ago

Same. As a vim user I now can't quit nano.

[-] 0x4E4F@sh.itjust.works 5 points 8 months ago

Very intuitive - Ctrl + X... unlike vim.

[-] voidMainVoid@lemmy.world 12 points 8 months ago

Why is Ctrl-X intuitive? Shouldn't it be Ctrl-Q (for "quit")?

[-] mihnt@lemmy.world 5 points 8 months ago
[-] voidMainVoid@lemmy.world 9 points 8 months ago

In most apps, Ctrl-X means "cut", not "quit". Especially when it's a freakin' text editor!

I will grant you that it's more intuitive than vi, but that is a very, very low bar.

load more comments (2 replies)
load more comments (3 replies)
load more comments (6 replies)
load more comments (8 replies)
[-] doctorn@r.nf 25 points 8 months ago

There's a button to exit vim on your pc. Just hold it 7 seconds and vim is closed. 😅

[-] cupcakezealot@lemmy.blahaj.zone 7 points 8 months ago

it's right next to the turbo button

[-] backhdlp@lemmy.blahaj.zone 22 points 8 months ago

you don't need the ! when you have the w, because your changes already get saved.

[-] raptir 18 points 8 months ago

If anything it is dangerous as it will still exit even if changes cannot be saved.

[-] DocMcStuffin@lemmy.world 6 points 8 months ago

Try editing a file in /etc as a regular user. It happens sometimes and you really want that warning that the write failed.

Anyway, :x is superior. It only writes if there are changes. So, your mtime doesn't change unnecessarily.

load more comments (2 replies)
[-] Bishma@discuss.tchncs.de 19 points 8 months ago

:ggdGwq (please don't do this)

[-] JustinAngel@lemmy.world 14 points 8 months ago

VIM Golf.... Same outcome, fewer strokes:

%d|wq

[-] itslilith@lemmy.blahaj.zone 6 points 8 months ago

you can replace wq with x

:%d|x

[-] 0x4E4F@sh.itjust.works 5 points 8 months ago

Only in Vim, not in Vi.

[-] backhdlp@lemmy.blahaj.zone 12 points 8 months ago

E492: Not an editor command: ggdGwq

[-] ignotum@lemmy.world 11 points 8 months ago

I use Vim daily, and i have absolutely no clue what that command would do, what would it do? Delete the document, save and quit?

[-] filiberto_kunstlinger@lemmy.world 15 points 8 months ago* (last edited 8 months ago)

exactly.

gg -> go to top of document

d -> delete (actually, it's cut, but it destroys the mnemonic)

G -> here is a modifier to "d" and tells it do "delete until end of document"

w -> write current state of buffer to disk

q -> exit program

[-] backhdlp@lemmy.blahaj.zone 17 points 8 months ago

Actually not, binds and commands aren't the same. ggdG only works as a series of inputs, while wq only works as a command (with the colon).

[-] victorz@lemmy.world 8 points 8 months ago

Exactly. The colon needs to be just before the w, not at the front of the sequence...

[-] CaptainBlagbird@lemmy.world 6 points 8 months ago

And while you're at it, throw an ESC in there at the beginning, will ya?

load more comments (1 replies)
load more comments (1 replies)
load more comments (1 replies)
load more comments (1 replies)
[-] chris@l.roofo.cc 13 points 8 months ago
[-] construct_@lemmy.ca 11 points 8 months ago

And then sudo apt install nano

load more comments (1 replies)
load more comments (5 replies)
[-] eruchitanda@lemmy.world 10 points 8 months ago* (last edited 8 months ago)
load more comments (1 replies)
[-] slapchop@lemmy.world 9 points 8 months ago
[-] stepanzak@iusearchlinux.fyi 5 points 8 months ago

I love how in the comments on even the most basic vim meme I learn something new

load more comments
view more: next ›
this post was submitted on 27 Dec 2023
153 points (75.6% liked)

linuxmemes

20693 readers
155 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