cdo: Vim commands you NEED TO KNOW #5

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

You need to refactor across an entire project and want a quick an easy way to do it WITH confirmation. Telescope + cdo makes this quick work — by leveraging this with the substitute command, you'll be done in no time.
Рекомендации по теме
Комментарии
Автор

These shorts are a great help to use nvim as an IDE, thnx!

fliplucky
Автор

I’m loving these shorts. I tried to learn it all before and just got frustrated. Learning a trick at a time is a lot more reasonable!

robertbeene
Автор

Technically you could do less if you have your lsp setup but I think this is very useful for things that are not variable and when you don't have your lsp setup.

tranquangthang
Автор

I've just used it and saved half an hour at work. Thank you!

PetrenkoAndrii
Автор

for a moment i thought that tattoo was real

a_maxed_out_handle_of__chars
Автор

Specifically for s//g this may have had the same behavior, but it is good to be careful to use the correct command depending on whether you need it too run once per item found (cdo) or once per file where an item was found (cfdo if I'm not mistaken).
Example: if you want to add an import clause at the start of the file for every file where there is an item in the quickfix list you could do `:cfdo norm ggOimport foo` (may need to escape the spacebar). If you use cdo in this case, files with multiple of term found would add multiple of the same import to the top of the file.

Gokuroro
Автор

Wow... loving this pill of knowledge. Keep publish more, more and more.

WaldirBorbaJunior
Автор

Does it rename every instance of that string, or does it "know" if it's just a specific variable, or part of a function name?
Sorry, I know essentially nothing about vim

matthewdev
Автор

lsp renaming would be better but this is cool, gna use it from now

emptytextfield
Автор

Is there any plugin that allow me to move the file and it will update the imported path for me?

s-xatya
Автор

How do you learn that? Reading the documentation?

saulleal
Автор

@typecraft_dev

I am proficient in vim handling but after a long day spending on coding in vim I feel a little bit tired.
I figured it out it's because of not using a mouse. Hands are almost always on a keybord - there are no arms movements.

So in my case I like to work: one day in vim, an other day in goland ide.

Do you feel the same?

slawtul
Автор

Did Anyone Notice a Telescope on his neck when he tells about telescope🤣❤️

abhishekranaa
Автор

Oh wow thanks, this is really neat! I didn't know about the quickfix list or cdo, this'll be useful next time when the LSP doesn't detect it ^^

friendliness
Автор

Is there a way to do it like in visual studio?....In VS I can right click -> rename variable and it renames variable across whole project automatically and pretty safe because it is based on language symbol....is it possible to do it in vim by LSP???

sunyfilip
Автор

What's the differenze betweeen this and "%s/oldname/newname/gc"?

eliacortesi
Автор

Wtf is that thing that appeared under your ear among the shots?

howesteve
Автор

The thing about vim is that you cant actually exit it.

hephestosthalays
Автор

i'll do a word search using * and then cgn and type the new variable name and then use the dot operator until i rename all the variables

nivethan_me
Автор

Did you give yourself a telescope tattoo lol

grahamhughes