Go to: Why you should consider using Vim? · I started Vi and nothing works · Navigation · Reading terminal output · Working with multiple files and windows · Single repeats · Compare upstream and edited version of file in split · Macro · .vimrc
Normally nobody cares about the tools you use for development. I don’t either, but for some reason you visited this page. So I present you the benefits of using Vim (compared to your favourite IDE™):
If you care about the things above (and you have all the time in the world), Vim might be for you.
the Unix philosophy “is the idea that the power of a system comes more from the relationships among programs than from the programs themselves.”
Now some opinion: Most of those fancy IDE features are done by language servers. Autocomplete is overrated, it’s the automations that will save you time.
Here is a good article on the history of Vim.
help compatible
set nocompatible
The excellent vimtutor
is a good starting point.
Tells you how to navigate within a file, switch modes and do some
basic editing tasks.
My favourites:
%
), start/end of
function ([
,{
)^H: Backspace
^W: Delete word
^U: Delete line
ls -ail | vim -
Now check how we can use the %
command-line range
specifier.
:help :%
You can also use Linux commands to modify buffer content.
sort; grep; cut
Don’t forget to
trim
beforecut
!
Now insert the date in the current line.
:help :.
:.!date
Do the json lookup
https://pokeapi.co
Do some buffer magic here: bn, bp, ls, bd
save layout: :mksession
then start with vim
-S
Simple changes can be repeated with the .
command.
Global search and replace? Nah, search and repeat with dot.
Keep lines that contain string
:v/keeeep/d
:% !git show main:my-file.txt
Then reload file that was edited outside of vim
q
as in quote?
Yes pls.
Termdebug
:e $VIMRUNTIME/compiler/<Tab>
I try to live without plugins, but:
<c-c>v
,
<c-c><c-c>
,
<c-k><c-k>
<c-v>n
Happy editing!
#productivity #training