top | item 45746875

(no title)

wuhhh | 4 months ago

I have a similar story but with neovim (and for the same reason as the author; growing unease with big tech). Tried and failed to make the switch a few times but made a concerted effort to stick with it throughout a specific project and now it’s second nature. I found it useful to research idiomatic (n)vim ways of doing things whenever I’d get frustrated or feel I’d be doing something more quickly in VSCode and commit them to memory by using new commands a few times over. Right now I’d say search/replace is the only thing that’s still not as ergonomic for me in vim as it is in Code. What I do is visually highlight my search phrase, hit asterisk then :%s//replaced - I learned that you can omit the search pattern using this technique.

Anyway nvim and helix are both amazing and terminal editors are both cool and sexy, so why wouldn’t you? ;)

discuss

order

pigcat|4 months ago

Woah, how did I not know about that tip about omitting the search pattern? Love it and will be using that lots!

As a thank you, I'll leave you with the way I learned to search/replace, just to give you a slightly different flavour: asterisk, cgn ([c]hange [g]o [n]ext), type replaced, then . (period, to repeat) until I'm done.

wuhhh|4 months ago

Right back at you, that’s super neat!

bloppe|4 months ago

Huh. I forgot about %s. I just search for a pattern and replace the first one manually. If there are fewer than ~5 occurrences, I'll just hit `n.` ~5 times and get them all. If there are more, I'll record a macro with `qqn.q`, then look at the occurence count in the bottom right corner (e.g. 50) and hit `50@q` to get them all. Sometimes the replacement text is non-constant, and this method allows for more flexibility with the recorded macro.

Sometimes it's funny to look around and see the strange local minimum of effort you've settled into.