I feel like the images should be switched.
When you know how to exit, you just slap your face 🤦 and ask “why… why, please, why don’t they add new shortcuts 🤦!”.
Lol if you know how to exit, you may know that you actually can change almost everything about vim.
I don’t think you can add modifier keys in shortcuts.
And this behavior should come out of the box, not me changing stuff around so I can make it usable. For something that I use all the time, sure, but I only use a terminal text editor with git, and I don’t use git that often. For everything else, I use a GUI text editor (mousepad, leafpad, whatever).
nnoremap <C-q> :q<CR>
This works for me to bind control+q to quit.
edit: easier to upload an image because lemmy is eating the “html” characters
Hm, will try that. If it works, I’m buying you a beer 🍺.
You can set which editor to use with git using the GIT_EDITOR environment variable instead of telling other people their editor isn’t usable by your standards.
Yes, I know, and I have it set to nano, but even then, I don’t use nano that much anyway, I do most edits in a GUI text editor.
IDK, I exit vim and promptly fall asleep.
Likewise 👍.
If you wanna save changes: :wq
If not: :q!
Else: :SpanishInquisition
Hmm, I didn’t expect that last one.
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.
:x
was a gamechanger. And it doesn’t update the file’s modify date if you made no changes.Sometimes I just sit back and think about all that saved time and effort so much that I have actually lost time by switching from
:wq
.why not?
There is a other option?
same reason I prefer :wq to ZZ. muscle memory.
help! i wanna leave!
:wq
why isn’t it working???You have been chosen by the Vim Dommy Mommy. You cannot leave.
I prefer the extremely intuitive:
["grep -P "PPid:\t(\d+)" /proc/$$/status | cut -f2 | xargs kill -9")
]=system(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
deleted by creator
This is how you get buffer files everywhere
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
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.
Nano literally tells you all the shortcuts to your face.
It shows a message which wastes valuable screen estate, especially on low resolution terminals, containing a message I have to read every single time because the keys are not in muscle memory, and never will because the bindings are stupid.
On systems I have control over the reaction to nano popping up is exiting, removing it, making sure the package system blocks reinstallation attempts, and go back to what I was initially doing in a sane editor.
My man, most of us aren’t connecting to our mainframes on VT20s these days. Even on my phone screen the three extra lines nano takes over vi aren’t a problem.
Also if you have the time to go through all that you have the time to learn ctrl+x.
Sometimes I’m on call and all I have is my 3DS! Stop assuming by maximum screen resolution :'(
I know you kid but even the 3ds fits a decent number of lines on screen.
You have so much pent up emotion over a text editor. Life can be so much more my friend!
First day on linux?
You know the bell curve meme? I’m just beyond this.
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.
Ctrl-X in Nano is arguably more nonsensical, considering that vi was made in an era long (decades) before many of the conventions we know today came about. They were figuring it out in real time. And the criterium here is much simpler: it must be available on all keyboards so no fancy keys. That’s all.
On the other hand, when nano decided to use Ctrl+X for eXit, Apples Ctrl+X/C/V had already been brought over to Windows and Apple, and was also the de facto way for most Linux apps to handle these inputs although I do think it came before any “official” efforts to standardize these shortcuts in desktop environments.
It doesn’t have to be X, just the fact that it uses modifier keys is enough. It could be Q or anything else, just please, for the love of god, we live in the 21st century now, all keyboards have modifier keys, please, add modifier keys shortcuts as well.
And it’s also an X, like any GUI app in any OS.
I know I always try GUI methods in console
That’s normal for people that didn’t grow up in the 70s and 80s and GUI wasn’t the first thing they knew. I was a teen in the late 90s and early 00s, so yeah, we had GUIs for almost everything.
We’re basically trying to do catchup with the cool kids, but let’s face it, they live somewhat in the past regarding modifier keys and vi/vim.
Because it also sends the kill signal in every terminal I’ve witnessed yet… And you have it right on screen the second you start Nano.
I’m over here using Ctrl c all over the place to kill stuff…
Yeah, you could use that as well.
Can you please elaborate on the first part? It is not standard Linux terminal behavior to send the KILL signal on Ctrl+X.
Because nano just shows how to exit, as well as some other basic functions at bottom
Why not just using Micro? Ctrl + Q. Intuitive af
Yeah, sure, that works as well.
As long as I get to use modifier keys, almost anything is fine with me. We don’t live in the 70s, that was 50 years ago. If backwards compatibility is what they’re after, I’m sorry but I think they overdid it. Plus, you can just add them, the defaults don’t need to be changed.
gg/un2x?-d/like
FTFY
I’m not planning on googling that 😒.
result: Very intuitive like vim.
gg
- top of the file/un
- find “un” place cursor at u2x
- remove 2 characters?-
- search backwards for the character-
d/like
- delete everything up until the characterslike
See, intuitive!
I don’t do that much search and replace in any terminal based text editor to actually use that on a regular basis. If I need edits like that, I use a GUI text editor.
Sure, I just hate moving from mouse to keyboard every few seconds as I code.
deleted by creator
you don’t need the
!
when you have thew
, 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.wait people care about the mtime?
I’ve had to do forensics on a rogue change. In finding when and who actually changed the file, mtime can help narrow it down when compared with wtmp.
: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, whilewq
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?If you want to cover every case (mode), indeed. 😊
yeah, I screwed it up
gg
Huh… I always just used :1
ggdGZZ
This actually does what you intend to do. On nvim atleast.
+Z killall -9 vim
And then
sudo apt install nano
No no no no, it’s
sudo xbps-install -Suv nano
👍.
Alt+SysReq+O
deleted by creator
Just SysRq. Alt+PrtScr is how you press SysRq Just like you wouldn’t write “shift+1” instead of “!”
If you can remember this, you can remember how to save and quit
It’s just a meme. I actually use vim regularly. But this is funnier.
ZZ/ZQ.
I am also a shift-zz fan.
:x
ZZ
I love how in the comments on even the most basic vim meme I learn something new
:qa!
ZZ
Wouldn’t you want to just want to type q! As you’ve probably opened it and accidentally made changes you didn’t want to. So you wouldn’t want to save the config file. Or the text file you just created.