Rule of thumb before using any IDE, you need to familiarize the keyboard shortcuts first
common stuff: /string - start searching for the string, press enter then `n` for next and `N` :number - go to line number :q! - quit without saving :wq - write/save and quit v - visualmode(you can select text with these) y - copy selected string p - paste string dd - delete line dnumber - delete number of lines i - insertmode(you can edit the text with these) u - undo last change esc - exit visual or insert mode vim is good when you don't have a mouse and/or editing GBs worth of files, its perfect when youre working on a linux server remotely
Yeah that works, but I like to use the UI first and the slowly learn the keyboard shortcuts at my own pace. That is however not possible with vim, vi, etc.
Learn the basic shortcuts by following the built-in tutorial (type :Tutor and press enter) and that should give you everything you need to use the editor so that you can learn other shortcuts over time.
When I started with Unix based Systems in university (Apollo Domain WS30, in case you're interested, while using Amiga with Cygnus Ed at home), the student admin of the system recommended we should NOT use the screen oriented editor with mouse support etc (pretty dumb editor anyway), but learn vi instead, stating it was available everywhere.
Best advice ever.
Of course, still using vi (albeit vim) everywhere nowadays... Blowing all nano etc users out of the water once a bit more than just typing is needed...
I wonder if there is anything more to Vim which is not there in nano...... I only use Vim/nano when I need to edit some configs or edit some text on a remote server.....
You have full explicit control over everything you do, and you can do complex things that fuzzier GUI editors can't or you have to make macros for. Replace 1 character after the cursor? r followed by the character, then you're back into normal mode - no accidentally typing more characters into your documents. Delete a word? dw. not ctrl+shift+(right), delete. Delete 4 words? d4w. Delete a line? dd.
Your hands don't move much on the keyboard, much less back and forth to the mouse. And what i described is the very basic kid stuff. You can get very complex stuff pretty easily in vim once you know it exists. The hard complex stuff will boggle your mind.
39
u/nom-nom-nom-de-plumb Jun 19 '23
Oh god..I had vi flashbacks "how the fuck do I exit this!! Welp...better just pull the power cable and hope for the best."
Ahh good times
20
u/planktonfun Jun 19 '23
Rule of thumb before using any IDE, you need to familiarize the keyboard shortcuts first
common stuff:
/string - start searching for the string, press enter then `n` for next and `N`
:number - go to line number
:q! - quit without saving
:wq - write/save and quit
v - visualmode(you can select text with these)
y - copy selected string
p - paste string
dd - delete line
dnumber - delete number of lines
i - insertmode(you can edit the text with these)
u - undo last change
esc - exit visual or insert mode
vim is good when you don't have a mouse and/or editing GBs worth of files, its perfect when youre working on a linux server remotely
26
u/nfsnobelxp Jun 19 '23
I can relate at my early days with vim 😭 Now, I want to have it on visual studio
4
u/Creepy-Ad-4832 Jun 19 '23
Or
If the previos doesn't work
4
u/oni_dave Jun 19 '23
The number of times a day I try to :wq to exit non-Vim applications….
1
u/kai58 Jun 19 '23
Why do people use vim? Only things I’ve heard about are that it’s a pain in the ass to use.
2
u/Oolupnka Jun 20 '23 edited Jun 27 '23
Its easy to exit vim, just remove power plug of server. I dont know why people complain how hard it is.
1
u/[deleted] Jun 19 '23
-> :
-> q!
-> chill
1
u/EnkiiMuto Jun 19 '23
Doesn't help that no one ever tell us on tutorials that "^" = ctrl lol
1
u/ObserverOfVoid Jun 19 '23
1
u/spycodernerd2048 Jun 19 '23
:wq
1
u/ixis743 Jun 20 '23
:UWU
1
u/incunabula001 Jun 20 '23
escthen:q!that's it.1
u/TalesOfMaxwell Jun 20 '23
Shift+Z+Z and pray I didn't fuck anything up.
1
u/[deleted] Jun 21 '23
How about "убрать тыкалку из двудырки"
1
u/gudlag Jul 23 '23
killall vim
1
u/abelornanel Jul 27 '23
I felt that 😆