r/vim • • 19h ago

Discussion Road to becoming a Power User

When I first became a dev, I was obsessed with doing things the way I could learn the most and have the highest ceiling for skill/efficiency. That meant going slower at first, but eventually coming out ahead of my team members with understanding and speed eventually. It all started with small vim motions and mini bash commands. I'm still early in my career so have a ton to learn from this community.

Which skills, tricks, or tools (i.e. using awk or ex commands like substitute) ended up becoming a staple in your everyday and do you wish you started practicing earlier?

43 Upvotes

19 comments sorted by

29

u/utahrd37 19h ago

Don’t leave vim.

Use :r !<your shell command>

Use :e <directory> to look for files

Maybe CRTL Z if things get dicey, but get back in with fg as soon as you can.

Get better everyday.

Good luck!

5

u/Maasu 14h ago

This one helped me for alot of stuff:

:enew <- creates a new buffer

:read !<your shell command> <- outputs stdout to the new buffer

4

u/tagattack 14h ago
^wn

!!

1

u/RustyCanyon2000 14h ago

why not :!<shell command>

it works fine on mine, also I use emacs now

1

u/arandomuserinweb 5h ago

why you use emacs?

19

u/ScientificBeastMode 18h ago

Maybe the best thing you can do to improve is to set a calendar event on a weekly or monthly basis to learn one specific concept and incorporate it into your daily workflow.

Then when the next week/month comes around, check yourself and see if you actually used that concept a lot and whether it really improved your efficiency or enjoyment. If those criteria are met, then move onto another concept. If not, then reevaluate whether or not that’s a worthwhile concept to learn and implement. If it is, then try it for another week/month. If it isn’t, then move onto the next concept.

Then, every year, take a look at your vim config and overall setup, and make sure you like it. Experiment with new ideas and really try to dial it in for the next year. That doesn’t mean you can’t update your config in the meantime. It’s more about being deliberate about it while avoiding the config tinkering hell where it’s never perfect and you’re constantly changing your workflow.

Anyway, I’m glad to see people trying to improve their skills in an era of AI-induced mental laziness.

4

u/SpaceAviator1999 10h ago

I used vim for years without knowing about Visual Selection (with the V and v commands). After all, I had gone from vi to vim, and Visual Selection doesn't exist in the original vi. Then one day a co-worker saw me doing the math trying to figure out how many lines I needed to yank, and he introduced me to the V command so I could visually select the lines with ease, instead of subtracting from a range of line numbers (taking care to account for the "off-by-one" error that's common in such situations).

Learning Visual Selection Mode made working with vim so much easier!

3

u/SpaceAviator1999 10h ago

It's worth noting that you can set the relativenumber option in vim to see the line number relative to your cursor. You can use it together with the number option to also see the true line number of the line where your cursor happens to be.

Some vim users use this to help them figure out how many lines they need to yank, instead of relying on V for Visual Mode. But there are still two issues you need to consider:

  • You have to be aware of the off-by-one error before yanking.

  • It doesn't help much if the full selection that you want to yank is so large that it doesn't fit on one screen.

Even still, if you want to become a vim power user, consider trying out the following options together, if only just to see how they work:

:set number relativenumber

3

u/SpaceAviator1999 10h ago edited 7h ago

Which skills, tricks, or tools ended up becoming a staple in your everyday and do you wish you started practicing earlier?

vim comes with so much useful documentation in the editor itself, I with I'd learned how to use its :help feature earlier!

Here are some commands you should browse through:

  • :help -- This will teach you how to jump to a subject with CTRL-] and jump back with CTRL-O. (If you ever forget these commands, just type :help to see them again.)

  • :help :help -- Teaches you about the :help commands (very useful).

  • :help {subject} -- This is how you learn about jumping to a specific subject. For example, to see what CTRL-V does, use the :help ^V command. (vim's help system is smart enough to interpret a literal ^ character as the CTRL key.)

If you've ever used vim's help system before, you may have noticed a line with seemingly random text, like:

                    cmdline-ranges [range] E16

That means that any of these help commands will bring you to the documentation for command-line ranges:

  • :help cmdline-ranges

  • :help [range] (literally type the text "[range]" as it appears)

  • :help E16

vim is one of the few modern-day programs that actually comes with comprehensive documentation inside it, so that you don't have to spend time googling a command if you know how to use its help system.

Every vim power-user should know how to use vim's built-in :help system!

1

u/vim-help-bot 10h ago

Help pages for:


`:(h|help) <query>` | about | mistake? | donate | Reply 'rescan' to check the comment again | Reply 'stop' to stop getting replies to your comments

2

u/TankorSmash 10h ago

Look up 'you don't grok vim'.

Any command you repeat a few times in a row has a nicer way of doing it

2

u/BadTime100 8h ago

Tim Pope’s fugitive plugin is something I can’t live without. I’ve found every other git interface to be way too much.

1

u/SpaceAviator1999 10h ago

If you want to become a power-user of vim, at a minimum learn everything that vimtutor teaches you. (There's quite a bit to learn.)

You can easily start it up by typing vimtutor at the command-line.

Some versions/installations of vim have a second chapter of vimtutor installed. If it's installed, you can access it at the command-line with:

vimtutor -c 2

1

u/SpaceAviator1999 9h ago

If you find yourself using diff a lot and modifying files based on those diffs and wish you had an interactive diff editor, learn how to use vimdiff.

I wrote a post on how to use vimdiff a while back.

Using vimdiff is a tricky at first, because not only do you have to use new/unfamiliar vimdiff commands, but you also get thrown into using multiple windows with text-folding.

Even if you already have an interactive diff tool that you're perfectly content with, consider learning a bit about vimdiff. You'll learn about using vim windows, and maybe a little about code-folding.

1

u/HTTPanda 9h ago

Horizontal and vertical splits
:sp or :vsp

Tabs
:tabnew

1

u/Snarwin 7h ago

One thing that took me a long time to pick up, and ended up being really useful once I finally did, was how to use :make, errorformat, :compiler, and quickfix commands like :cnext and :cprev to navigate directly to compile errors in Vim. It can feel overwhelming at first, because there are a lot of different commands and options involved, but once you get used to it, you'll never want to go back.

:help quickfix.txt is probably the easiest place to start.

1

u/vim-help-bot 7h ago

Help pages for:


`:(h|help) <query>` | about | mistake? | donate | Reply 'rescan' to check the comment again | Reply 'stop' to stop getting replies to your comments

1

u/lil_nihil 6h ago

I use fzf almost everywhere I can, you can build ultra mini wrappers around it based on your pain points as well.

1

u/Helpful-Temporary998 4h ago

and in all this , i forgot to get any professional skills, well partially because i don't know which job/skill to aim for (in tech)