Vim Tips I Wish I Knew Earlier

preview_player
Показать описание
When starting out your journey with Vim, there are so many things to learn. Over time, you will see which features will stick with you and which ones are helpful in your work. In this video, I’m showing Vim tips that I'm using now, that I wish I knew earlier.

Рекомендации по теме
Комментарии
Автор

Timestamps:

0:24 - Relative line numbers
2:26 - Mapping Esc to Caps Lock
3:22 - :norm
4:41 - C-v (similar to :norm A & I)
6:04 - in(de)crement numbers with C-a / C-x
8:36 - using o to change visual select direction
9:24 - % for jump to matching pair: ({[
11:04 - i / a (inside / outisde)
13:55 - W vs w
15:51 - Invoking external scripts/binaries
19:08 - Creating (dynamic) snippets
20:25 - Using netrw/fzf/search

dexedrine
Автор

Has to be the most underrated piece of software ever. I'll never go back.

pldvs
Автор

highly recommend placing some segments and timestamps on these videos, as you rarely have everything being new for Vim users. That way we can easily click to those points that might apply.

GOTHICforLIFE
Автор

Dude I've been using vim for almost 2 years and you're the first person that's actually taught me something new past the first month of this endeavor.

andrewiglinski
Автор

Great video, nicely done. Didn't know about o for adjusting the visual selection. I've always cancelled and started from scratch when I screwed up. No longer!

LeviNotik
Автор

Vertical visual mode with the multi cursor was the only thing I saw an emacs user have that I wanted, and vim turns out to have it too. It's such a nice experience using that. Absolute chad developers.

Snollygoster-
Автор

One very helpful keybinding in vim, is Ctrl+R in insert mode, when pressing it you are able to paste directly from some register.
I was finding my self a lot of the times, just pressing escape to go into normal mode, and press p (to paste) and i again to move to insert mode.
It is very helpful...

medkdsf
Автор

Set environment variable "EDITOR=vim" or whatever you like
Write some command in your bash terminal and press (CTRL + X & CTRL + E)

This allows you to modify the command you want to write by opening up the command in your "$EDITOR"

Especially useful when writing commands that you want to split over multiple lines, but still be executed as if it was all in one command. Or just want to get some syntax highlighting in your favorite text editor.


Most people might already know this... but if you don't, you're welcome.

Yeet_the_code
Автор

What the...! I absolutely love that :norm command! I didn't knew it was that easy! Thanks a lot Sebastian.

EmielvanGoor
Автор

That *W* is a replacement of my *t<space>*
Tysm mate, gotta use it more often

iusearchbtw
Автор

One of my favourites has to be a way to "encase" text in quotes/braces/etc: replace the text either after selecting in visual or with motions, i.e. cw {" <CRTL+r> " "} --- the " after ctrl+r pastes the text you just cut from the " register.

teohz
Автор

Didn't know about o for switching direction of selection

VinitNeogi
Автор

I like automatic session saving, that's the big one I've learned recently. Didn't get into it until it was automatic in some neovim config I was using. It always saves your session on exit, and when starting vim there's an *option* to resume the session by pressing a keybinding - and it knows which session based on which directory you are in.

nahblue
Автор

You can use i/a with a lot of stuff:
f = function
p = paragraph
t = HTML tag
And probably a ton I don't know about

zyriab
Автор

Windows users - reading the friendly manual: "Since CTRL-V is used to paste, you can't use it to start a blockwise Visual selection. You can use CTRL-Q instead."

MrPolyphonicpoi
Автор

2:59 Mapping escape to caps lock is pretty easy on every major operating system. Under MacOS its under Settings/Keyboard/Modifier Keys and under Windows you can install PowerToys by Microsoft and do it under Keyboard manager/Remap a key. I highly recommend doing this.

catfan
Автор

17:16 neovim already comes with a ":sort' command, in case you didn't already know.

justcorsin
Автор

Fantastic video, Sebastian! Really interesting with some great tips!

lasombra_br
Автор

Loved this! Thank you Sebastian, awesome content

phaberest_
Автор

I needed these tips, thanks for sharing!

roryhendrickson