If you ever installed Linux in your life, I'm sure you might have come across Vim.
Vim is a
command-line based text editor. It's a great tool but I won't say that it's the best text editor in Linux as it would lead to a never-ending debate.
Vim is actually an
improved version of the old
vi editor. It comes with many new features including multi-level undo, multiple window support, visual mode and command-line completion.
If you're using it for the first time, you may have hard time trying to exit Vim.
What? Don't you believe me?
Here's the proof :
Stack Overflow@stackoverflowStack Overflow launched in 2008, demonstrating what’s possible with the internet: an open community that gives people knowledge at their fingertips.
Since then, over 1.8M people have visited us just to learn how to exit Vim. #Web30 #ForTheWeb
stackoverflow.com/questions/1182…02:00 AM - 13 Mar 2019
In this blog, I'll list down 15 shortcuts that will save you a lot of time while working with
You can replace '2' by any number and delete any number of lines.
That's all for the blog. I hope you had good time reading the blog!😃
Top comments (10)
I think some of these are slightly wrong:
bmove forwards and backwards in normal mode, not command mode. In command mode, you have the little
:prompt and can enter instructions for the editor to execute.
dwdeletes from the cursor to the start of the next "word". To delete the word you're currently on, you'd use
daWdepending on exactly how you wanted to do it.
:%s/old/newwill replace "old" with "new" in every line of the file, but it will only replace the first occurence of "old" in each line. If you want to replace every occurence, you'd pass the
gflag like so:
:wexample suggests that it will use the filename "sample_filename" but you haven't put that in the command. It'd need to be
:w sample_filenamefor that to work!
or to delete from the cursor to the end of the word you are on de
Thank you for your feedback Ben! I've made the corrections accordingly.
Thanks for sharing. I use vim but in a very basic way!
we all start that way, then you add a few new commands, and a few more and so on, I'm learning all the time
Glad you liked it!
Glad you like it Kelsey!
Why omitted maybe the most important handy ones? ;))
ZZ to write and exit (like :x!, :wq!)
ZQ to exit without writing (like :q!)