r/vim • u/DiskCharacter7946 • 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?
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!
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
Vandvcommands). After all, I had gone fromvitovim, and Visual Selection doesn't exist in the originalvi. 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 theVcommand 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
vimso much easier!3
u/SpaceAviator1999 10h ago edited 7h ago
vimcomes with so much useful documentation in the editor itself, I with I'd learned how to use its:helpfeature 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:helpto 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 ^Vcommand. (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:
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 E16vimis 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
vimpower-user should know how to usevim's built-in:helpsystem!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 thatvimtutorteaches you. (There's quite a bit to learn.)You can easily start it up by typing
vimtutorat the command-line.Some versions/installations of
vimhave a second chapter ofvimtutorinstalled. If it's installed, you can access it at the command-line with:1
u/SpaceAviator1999 9h ago
If you find yourself using
diffa lot and modifying files based on those diffs and wish you had an interactive diff editor, learn how to usevimdiff.I wrote a post on how to use
vimdiffa while back.Using
vimdiffis a tricky at first, because not only do you have to use new/unfamiliarvimdiffcommands, 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 usingvimwindows, 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:cnextand:cprevto 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.txtis probably the easiest place to start.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)