Real Vim's power

Real Vim's power
Photo by NEOM / Unsplash

Why Vim is a better option than others code editors? πŸ€”

Answering this question is really easy: Terminal Power


TL;DR

Use Linux's background processes along side Vim to improve your workflow. 😎


Terminal power 🦾

As a Vim user your first super power is the terminal!

If you're using NeoVim (AKA vim), hopefully not GUI version, you are inside the Terminal:

opening neovim from terminal

But what it means... πŸ€”

That means that you're a first class citizen of the amazing world of terminal! congrats πŸŽ‰

as a citizen you could enjoy your rights:

  • Customize your terminal as you want πŸ’…
  • Run your NPM commands in a proper place πŸ’†
  • Entry to a new world full of options for you πŸŒ„
  • Don't overload your machine with a cumbersome IDE πŸ₯΅
  • And even more...

OK but...

When you opens Vim you can't use your terminal bucause vim occupies all your terminal, so, should I open a new terminal, that is not great πŸ˜’

Whell, that is not true at all βœ…

because you have been entry in a new world, then, so you have a new bunch of options to use in your workflow, and, one of that options is foreground and background processes in Linux/Unix.

What is background processes? πŸ˜•

Are processes in linux that are send to background (sleep 😴), so if you have a process that is running in your terminal you could send it to background and voila! you have your terminal free to do another task! πŸ’«

How to send processes to background? ⏸️

We could call background as bg and to do that you just need to use the key conbination: Ctrl + z

How to bring back the process to forground? ▢️

You just need to use the command fg (foreground) to bring it back!

How it will improve your workflow? πŸ“ˆ

Well, let's suposse you are in Vim working in your stuff, and you realize you need execute a command like:

  • find a file
  • run a unit test
  • or run any other command/script
  • search for a key word in a folder

In my workflow I constantly am trying to find a key word in my root folder, so I send vim to background find the key word blazing fast 🏎 and return to vim to continue hands on editing files πŸ‘”

How it looks:

nvim background + pnpm lint sscript running along side each

Trust me, it is really fast as you could swith between different stuff and it feels natural and just at your fingettips! πŸ– πŸš€

Enjoy!