Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I always favored emacs. But when git forces me to edit something or add and commit on the command line, vi would always pop up... and I'm always like 'FML!'
-
Archer045667yMost people say that exiting vim is the hardest part, I would say that remember to hit i to enter edit mode is the hardest part for me lol.
Two months straight using only vim and I still manage to fuck my code because of this. -
@mrstebo everytime People talk about vi I feel like using notepad while they use atom
-
Noob64607y@linuxx remember Shift+Z+Z.
@Data-Bound Nano is awesome. Sometimes all you need is simplicity. Otherwise I do use Vim. -
gitblame9137yI was going to say I wish I was able to use Vim at work to get my practice in, but I work with Visual Studio. Now it turns out that VsVim is a thing. Problem solved!
-
Eariel19067y@Archer04, :q! is pretty important when you're starting to learn vim and still make weird mistakes like deleting whole lines and stuff like that. That should be the first command to teach.
-
Archer045667y@Eariel yep, I have to use it when I mistakenly change something while being out of edit mode. And most of the time when I'm closing Vim is when my code works, so if there's an unwanted change I can safely close it without making a mess.
-
Here's what I think are the essentials
(I'll use <n> for any number, ANY number)
:q to quit
:w to save
:wq works too
:q! To quit without saving or force quit.
:o <path> to open another file
:split <path> to open a file on half of the screen
:vsplit (same but vertically)
<hjkl> to move
<n><hjkl> to move n times
w to move one word
<n>w to move n words
$ to go to end of line
o to open a new line
gg to go to the first line
<n>gg to go to row number <n>
G to go to the last line
yy to yank(copy) a line
p to paste a line
dd to delete a line (you can also paste it with p later)
<w | hjkl | $ | G >d to delete words | in a direction | till the end of line | till the end of the document. (you can also use <n> before w to delete n words, for example)
u to undo
ctrl+r to redo
There's more commands but these are a good start. You can also have fun configuring the ~/.vimrc.
PS: I'm pretty sure you can combine yank with w and <n>. And welcome to vim! -
@deus yeah, at first it is a bit challenging but the utility they give is great and when you figure out most of the key bindings actually make sense it's just second nature.
-
hell165967yWait, you are forced to use vim? Can't you use emacs or any other thing? 🤔
So sorry for you , jk, always nice to learn new things
Related Rants
Always postponed learning vim. For my new job I need to know how to work with vim.
Finally a reason not to postpone anymore!
undefined
linuxxx
vim
alrighty then
let's learn