Find And Replace

preview_player
Показать описание

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

Step 1: Find
Step 2: ":s"
Step 3: ???
Step 4: Replace

TechJoltd
Автор

I need 20 minutes to understand every single step he made in this short.

MarcCastellsBallesta
Автор

regular expressions are like magic, it's amazing how much time you can save once you understand them

ReptilianLaserbeam
Автор

Thank you. I have needed this shortcut for SO MANY things. I feel like I wasted hours... No. DAYS of my life doing refactors without this.

halotroop
Автор

Vim makes me love regexes. I have 3 years commercial experience but just recently I realised how awesome named groups are

pavloburyanov
Автор

if you like multicursor, here's how i personally do it in helix. it's not necessarily better or worse, just sharing:

C a bunch of times to select the first char of each line. now all further operations happen for all lines at once, so you can work like it's just one line.
wdwd to delete pub const.
e to skip the var name.
t<ret>d to select until before newline, and delete.
use insert mode to type everything around the var names.

option 2:
after C, instead wwwd to delete just the var name.
then X i believe selects one line. if not then you'll have to do ght<ret> to select from line start until newline.
A-C puts you in replace mode without yanking.
in insert, type out the first part, then C-r" to paste inline when needed.
basically like regex replace without the regex.

raffimolero
Автор

I've fought a one-eyed Kirby before. I learned a lot about skill issues us Quiche Eaters never knew we had.

supdawg
Автор

This is also possible using vscode
1. ctrl+alt+down at start of line to duplicate carets
2. ctrl+right x2 (move caret to word)
3. ctrl+shift+right (select whole word)
4. ctrl+c (copy word)
5. home, shift+end, delete (delete everything)
3. Write the test { ... code
4. paste accordingly
4. ???
5. Profit

farisfaikar_r
Автор

I have no idea what I just watched, but I fervently believe it must be correct; it includes Kirby

TreborKoor
Автор

I love doing this for onlookers. I get so many "what did you just do?!" reactions

Feynt
Автор

Just wanna say using multi cursor in vscode is also pretty effective, and you don't have to mess with complicated regexs

sxmourai
Автор

I just don't think we should trust someone with that mustache.

askholia
Автор

Cool. I read the doc on substitution in neovim after watching this. Realised just how simple it is. Thanks. I learned quite a lot today. I'll try to implement this in my work flow. Seems really useful.

mangierockz
Автор

This is the craziest thing I saw. Man knows things.

mohammadqamruddin
Автор

This is the most intense and confusion thing I've ever seen from *THE* Prime

khalil_holmes
Автор

It took me hours to learn this when I watched it first, when I look back at this now, seems so easy.

priyanshukatuwal
Автор

"One-eyed fightin' Kirby." 😂😂

EnigmaXx
Автор

Little confused about the backslashes before the opening and closing brackets. Shouldnt that escape those brackets to make them regular characters therefore they should have been in the text and would not behave as a capture group wrapper?

coolcodingcat
Автор

This seems a little complex. You can do the same with multiple cursors and alt in any editor.

gawwad
Автор

Holy crap, I understood what he did but I can say that I need more than a literal day to think about that solution myself lol

parkuuu