DEV Community

Discussion on: Moving around in Vim

Collapse
 
fidelve profile image
FidelVe

One I use quite often is:

:!<command>

This will run a shell command, show you the result and then go back to vim, is pretty useful when you need to run a shell command without opening another shell window or closing vim

Collapse
 
miniscruff profile image
miniscruff

Ohh yes and using % will insert your open buffer file.
:!black % will run python black on your open file

Collapse
 
iggredible profile image
Igor Irianto • Edited

Haha yup! I actually made a note to dig into this. This command alone unlock myriads of possibilities.

Going off topic- something I learned these past 3-4 weeks thought I would share!

  • :!! repeat the last :!command :)
  • :r prints output into vim - :r !ls for example, prints the output of ls command - I am sure will come in super handy!
Thread Thread
 
miniscruff profile image
miniscruff

Oh yea always forget !!.
I also gotta learn the other special characters I think # means something as well.