Neovim - how to do project-wide find and replace?

  Рет қаралды 2,545

Ben Frain

Ben Frain

Күн бұрын

Пікірлер: 27
@nikensss
@nikensss 6 ай бұрын
I recently learned about `cdo` and I was just wondering `what's the difference between that and cdo?` haha and you just exaplained that in a very easy to understand approach. Thanks!
@benfrainuk
@benfrainuk 6 ай бұрын
Excellent. Some good extra nuance in the gist by Integralist that’s linked in the description 👍
@leiswatch8589
@leiswatch8589 6 ай бұрын
Thanks for this video, great tutorial! I didn't know about cfdo, I have been using cdo, but it's time to change that :)
@dominykasbartkus1033
@dominykasbartkus1033 3 ай бұрын
Thanks, that's very comprehensive.
@adheusrangel
@adheusrangel 3 ай бұрын
Thank you! I've been postponing this learning for ages.
@michaelkastner3611
@michaelkastner3611 3 ай бұрын
You're not alone. Been using (Neo)Vim for many years but never found a good explanation for global search. I'll frame this one.
@driden1987
@driden1987 6 ай бұрын
TIL update command exists. Thanks Ben.
@OmGdoob
@OmGdoob 3 ай бұрын
Thank you! Impressive tip!
@BhargavaMan
@BhargavaMan 6 ай бұрын
Ben you're a legend
@colin7270
@colin7270 6 ай бұрын
Hi Ben, I saw your dotfiles repo is empty. Any plans to share your config? Looks clean!
@benfrainuk
@benfrainuk 6 ай бұрын
Ah! Just added a link to the description. They are in a gist here: gist.github.com/benfrain/97f2b91087121b2d4ba0dcc4202d252f (ones that start x are unused plugins currently)
@colin7270
@colin7270 6 ай бұрын
@@benfrainuk Thanks a lot! I appreciate this very much. Subscribed. :)
@vext01
@vext01 25 күн бұрын
I tend to use ambr for this kind of thing. Little unix utility written in rust.
@user-ot1dv6ri4f
@user-ot1dv6ri4f 4 ай бұрын
does refactor in coc.vim not work in php?
@benfrainuk
@benfrainuk 4 ай бұрын
Don’t use CoC. But LSP replace (assuming that is the kind of thing you mean) only works in certain languages, and of those, the ones you have an LSP installed for.
@norlock
@norlock 6 ай бұрын
Why won't you use the LSP rename functionality? You basically use the LSP function to rename and don't have to worry about references that are not part of whatever you are renaming. Meaning if a local object has a similar name inside a function that needs to keep its name it won't change that. And LSP refactor is similar to a regular IDE rename function. I have the following keybinding: `vim.keymap.set('n', 'r', vim.lsp.buf.rename, {})` and then you do `:wa` to write to all the buffers
@benfrainuk
@benfrainuk 6 ай бұрын
You don’t always have an LSP.
@norlock
@norlock 6 ай бұрын
​@@benfrainuk I do appreciate your time and effort, so keep up the good work 👍. But for most languages you have one (including PHP). The description + intro makes it sound that this is the way to do it in Neovim which is not really true, only in cases where you don't have a LSP for that project (obscure languages). Anyway still think this is interesting, but I just wanted to post this because the LSP rename function is much more convenient for most users.
@benfrainuk
@benfrainuk 6 ай бұрын
@@norlockI use LSP rename plenty too but there are often occasions when I am working on a bunch of JSON and text files or just some random string that doesn’t sit well with LSP so need to do this on occasions where LSP won’t help
@Danielo515
@Danielo515 6 ай бұрын
Is location list only for one file? So that is the difference...
@benfrainuk
@benfrainuk 6 ай бұрын
One window as opposed to whole session. Here is a good overview with more info: freshman.tech/vim-quickfix-and-location-list/
@adriansrfr
@adriansrfr 2 ай бұрын
Instead of cfdo, why not bufdo?
@benfrainuk
@benfrainuk 2 ай бұрын
Because the files are in the QuickFix list when I want to make changes to them
@EpsilonKu
@EpsilonKu 6 ай бұрын
I'm one of the devs of nvim-spectre (after inactivity of windwp). It's hard to keep it up. Maybe better people make replace and find without plugins tho. Let spectre rest, lmao.
@benfrainuk
@benfrainuk 6 ай бұрын
I can imagine it’s often a thankless task, so thanks 🙏
@MagicDuckify
@MagicDuckify 6 ай бұрын
Thanks for the work you do! Spectre can be a little buggy sometimes but its worlds better than the quickfix workflow. I think the idea of the search and replace ui as a buffer and seeing how your changes will look live is genius.
@Manmanolo115
@Manmanolo115 4 ай бұрын
Cool and all, but typing the search term again is.. not so good
Neovim: Replacing Telescope with FZF-LUA
6:56
Ben Frain
Рет қаралды 7 М.
Don't look down on anyone#devil  #lilith  #funny  #shorts
00:12
Devil Lilith
Рет қаралды 46 МЛН
Всё пошло не по плану 😮
00:36
Miracle
Рет қаралды 1,6 МЛН
Good teacher wows kids with practical examples #shorts
00:32
I migliori trucchetti di Fabiosa
Рет қаралды 12 МЛН
My Forever Dev Workflow
16:02
typecraft
Рет қаралды 98 М.
My Neovim & Tmux Terminal Dev Workflow As A Principal Engineer
9:22
DevOps Toolbox
Рет қаралды 50 М.
Godot Ocean Waves
6:40
AntzGames
Рет қаралды 9 М.
How I animate 3Blue1Brown | A Manim demo with Ben Sparks
53:41
3Blue1Brown
Рет қаралды 602 М.
Why Neovim nerds are so obsessed with the terminal
6:44
Joshua Morony
Рет қаралды 98 М.
Why I Switched From NEOVIM To VSCODE
13:45
Anthony GG
Рет қаралды 24 М.
The Holy Grail of Neovim Note Taking
14:38
DevOps Toolbox
Рет қаралды 342 М.
Turn VIM into a full featured IDE with only one command
11:55
Dreams of Code
Рет қаралды 682 М.
Effective Neovim: Instant IDE
16:16
TJ DeVries
Рет қаралды 815 М.
Don't look down on anyone#devil  #lilith  #funny  #shorts
00:12
Devil Lilith
Рет қаралды 46 МЛН