I feel like the images should be switched.
linuxmemes
I use Arch btw
Sister communities:
- LemmyMemes: Memes
- LemmyShitpost: Anything and everything goes.
- RISA: Star Trek memes and shitposts
Community rules
- Follow the site-wide rules and code of conduct
- Be civil
- Post Linux-related content
- No recent reposts
Please report posts and comments that break these rules!
If you wanna save changes: :wq
If not: :q!
Else: :SpanishInquisition
Why do so many people prefer :wq over :x?
Cause I don't like to think about my x
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.
Hmm, I didn't expect that last one.
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
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.
Same. As a vim user I now can't quit nano.
Very intuitive - Ctrl + X... unlike vim.
Why is Ctrl-X intuitive? Shouldn't it be Ctrl-Q (for "quit")?
CTRL+eXit
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.
There's a button to exit vim on your pc. Just hold it 7 seconds and vim is closed. 😅
it's right next to the turbo button
you don't need the !
when you have the w
, because your changes already get saved.
If anything it is dangerous as it will still exit even if changes cannot be saved.
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.
:ggdGwq (please don't do this)
VIM Golf.... Same outcome, fewer strokes:
%d|wq
you can replace wq with x
:%d|x
Only in Vim, not in Vi.
E492: Not an editor command: ggdGwq
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?
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
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).
Exactly. The colon needs to be just before the w
, not at the front of the sequence...
And while you're at it, throw an ESC
in there at the beginning, will ya?
:x
I love how in the comments on even the most basic vim meme I learn something new