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

I feel like the images should be switched.

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

If you wanna save changes: :wq

If not: :q!

Else: :SpanishInquisition

[-] metallic_z3r0@infosec.pub 6 points 6 months ago

Hmm, I didn't expect that last one.

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

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

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

Cause I don't like to think about my x

[-] rwhitisissle@lemmy.world 6 points 6 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)
load more comments (3 replies)
[-] dannym@lemmy.escapebigtech.info 32 points 6 months ago* (last edited 6 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 28 points 6 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 28 points 6 months ago

Nano literally tells you all the shortcuts to your face.

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

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

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

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

load more comments (8 replies)
[-] doctorn@r.nf 25 points 6 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 6 months ago

it's right next to the turbo button

[-] backhdlp@lemmy.blahaj.zone 20 points 6 months ago

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

[-] raptir@lemdro.id 17 points 6 months ago

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

[-] DocMcStuffin@lemmy.world 6 points 6 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.

[-] backhdlp@lemmy.blahaj.zone 4 points 6 months ago

wait people care about the mtime?

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

:ggdGwq (please don't do this)

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

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

%d|wq

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

you can replace wq with x

:%d|x

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

Only in Vim, not in Vi.

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

E492: Not an editor command: ggdGwq

[-] ignotum@lemmy.world 11 points 6 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 14 points 6 months ago* (last edited 6 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 6 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 6 months ago

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

[-] CaptainBlagbird@lemmy.world 6 points 6 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 12 points 6 months ago
<ESC>
<CTRL>+Z
killall -9 vim
[-] construct_@lemmy.ca 11 points 6 months ago

And then sudo apt install nano

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

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

[-] johannesvanderwhales@lemmy.world 5 points 6 months ago
[-] iUseTc@sh.itjust.works 4 points 6 months ago
[-] JGrffn@lemmy.world 4 points 6 months ago* (last edited 6 months ago)

Serious question. Why? No, for real, why? Why are these hard to understand editors still the default on most distros and flavors? Why haven't they reinvented themselves with easier to understand shortcuts?

I get the feeling my comment will attract heat, but I'm a web dev, studied comp Sci for years, have worked for nearly a decade and have spent over half my 30 year old life using computers of all sorts. I'm by no means a genius and I by no means know enough about this or most tech subjects, but I literally only knew how to close vim with and without saving changes in a recent vim encounter, purely due to a meme I saw in this community a few days prior, and I had already forgotten the commands by the time I saw this post. Nothing about vim and alternatives feels intuitive or easy to use, and you may say it's a matter of sitting down and learning, which you can argue that, but you can't argue this isn't a bit of a gatekeeper for people trying to dip their toes into anything that could eventually rely on opening vim to do something.

I won't try to deny its place in computer history, or its use for many, or even that it is preferred by some, but when every other software with keyboard shortcuts agrees on certain easy to remember standards, I don't quite understand how software that goes against all of that hasn't been replaced or hasn't reinvented itself in newer versions.

Then again, I have no idea what the difference between vi, vim, emacs, and nano are, so roast away!

[-] AngryCommieKender@lemmy.world 12 points 6 months ago

Then again, I have no idea what the difference between vi, vim, emacs, and nano are, so roast away!

Lol. Git Gud, Noob.

[-] voidMainVoid@lemmy.world 11 points 6 months ago

Some people like vim the way it is. That's why they haven't re-invented it. If you want to use a more intuitive text editor, there are plenty available (such as nano or micro).They don't need to turn vim into a clone of something that already exists.

As for why it's still the default... It's the same reason why everybody uses QWERTY keyboards when Dvorak is clearly superior. People already know how to type with QWERTY and they don't want to take the time to re-learn with a new layout, change their workflows, etc.

It isn't universal, though. Garuda Linux defaults to micro. The web dev boot camp I was in didn't bring vim up at all! We only used nano! I think that was a disservice to the students, but the instructors must've thought that it would be too confusing.

load more comments (5 replies)
[-] camr_on@lemmy.world 10 points 6 months ago

Why would vim reinvent itself? Vim's functionality has been standard for years, and works as expected. You can always use nano or something similar instead, which is probably a lot more usable to someone who doesn't want to learn all the advanced functionality of vim or emacs

[-] bitwaba@lemmy.world 6 points 6 months ago

As a ~20 year vim user, and by no means a proficient power user (any time I end up in recording mode, I just mash ESC repeatedly until this start behaving normally again.), I think it's just "it's easier for someone that doesn't know how to use it to learn, than it is for everyone that already knows how to use it to relearn".

Like the damn scroll options on laptop trackpads. Multitouch scroll down = scroll down. Then someone decided it needed to match the way phone scrolling works after smartphones became popular, so now there's lots of scroll down = scroll up software behavior. But the options are still there to behave neither way. If you don't like the vim commands, you're free to install something that behaves in a way that you expect. If you do like vim commands, install it and get the behavior that users have come to expect for the last 20+ years.

[-] azertyfun@sh.itjust.works 6 points 6 months ago

Is vi still the default? On Debian it sure isn't, nano is the default and has been for years, and I can only assume the debian derivatives have all followed suit. That'd already be most new installs taken care of.

If you find something that opens vi unexpectedly, double-check $EDITOR's value then file a bug report and tell them to follow $EDITOR.

load more comments (1 replies)
[-] rtxn@lemmy.world 5 points 6 months ago* (last edited 6 months ago)

To ensure the Unix-like standard of maximum backwards compatibility. Vi (the original, before Vim) was made in an age where computer keyboards might not have had luxury features like arrow keys, but did have alphanumeric keys and minimally competent users. It has worked for almost half a century, so unless you're Microsoft, why would you change it?

Even today, many people prefer it because you don't have to move your hand far away from the home row while typing or navigating, and the modality gives the user a much greater toolkit (seriously, I just about nutted when I discovered d i "). Not having to rely on modifiers and the arrow keys also reduces the risk of the repeated stress injury known as Emacs pinky.

[-] johannesvanderwhales@lemmy.world 5 points 6 months ago

Because vim (and emacs too!) is a powerful editor that works purely on command line and most people who are experienced in the Unix world are generally familiar with it. There are plenty of easier editors to use, like nano, that are also widely distributed and you are free to change your default. Being really powerful but you kind of need to know what you're doing is basically unix's whole thing.

load more comments (4 replies)
load more comments
view more: next ›
this post was submitted on 27 Dec 2023
152 points (76.0% liked)

linuxmemes

19717 readers
331 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