thet,
@thet@graz.social avatar

tip of the day: to replace text wrapping around some other, you can use regex groups and backreferences like this:

:%s/some(.*)text/other\1string/gc

For example:

Screencast of a regex replacement in vim with groups and backreferences.

tshirtman,
@tshirtman@mas.to avatar

@thet do you have a plugin to make that preview? I only have the highlighting when doing the match part, using vim 9.1.

thet,
@thet@graz.social avatar

@tshirtman I was surprised about the search highlight including replacement preview too :)
Try:
set hlsearch

FWIW, I'm using neovim and this is my config: https://github.com/thet/dotfiles-vim

tshirtman,
@tshirtman@mas.to avatar

@thet i do have hls set, but it only does the first part of that, not the replacement preview, that’s apparently a neovim feature (inccommand), and it’s quite enticing, there are apparently some old plugins in the same directions for vim for it, i’ll probably give them a shot, but i might also try (again) to move to neovim in the near future. My config is large and depends on many plugins, so it feels like it’ll be a whole project 😅 .

tshirtman, (edited )
@tshirtman@mas.to avatar

@thet I can confirm that the traces.vim plugin https://github.com/markonm/traces.vim/ works great :)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • vim
  • ethstaker
  • DreamBathrooms
  • osvaldo12
  • InstantRegret
  • ngwrru68w68
  • magazineikmin
  • mdbf
  • thenastyranch
  • Youngstown
  • slotface
  • everett
  • kavyap
  • Durango
  • tester
  • JUstTest
  • GTA5RPClips
  • tacticalgear
  • modclub
  • khanakhh
  • rosin
  • cisconetworking
  • normalnudes
  • provamag3
  • Leos
  • cubers
  • anitta
  • megavids
  • lostlight
  • All magazines