Coder Social home page Coder Social logo

Comments (4)

dmerejkowsky avatar dmerejkowsky commented on July 23, 2024 1

You may want to try sad - it's a bit different from ruplacer, but you may prefer it

from ruplacer.

dmerejkowsky avatar dmerejkowsky commented on July 23, 2024

Not sure I understand what you want. fzf can only select one candidate from a list of lines, no?

Can you give me more details?

from ruplacer.

sucrecacao avatar sucrecacao commented on July 23, 2024

No fzf can select multiple choices with the -m option.

The idea it to select a subset of the proposed patches. If you are a vim user, the idea is a bit like as using the c (confirm) option when doing a search an replace : s/old/new/c. But implemented differently ( with a selector like fzf )

Let's say I want to replace my old variable with new. But I also have word like behold oldish and Freeholder that also match the old regex. I dont want to bother finding a complex regex that will only match my old variable, I just want to select on the fly the right patches.

from ruplacer.

sucrecacao avatar sucrecacao commented on July 23, 2024

Maybe an interesting feature that could solve this is the following two options:
--writes-patches-to-folder that put all the patches into a folder, one patch per file. The use would be
ruplacer old new . --writes-patches-to-folder /tmp/mypatches

Now it is possible manually ( or with a fzf script ) to remove the unwanted replacement in the /tmp/mypatches folder.

And then a second option --apply-from-folder that could be using instead of the regex for the --go option:
ruplacer --go --apply-from-foler /tmp/mypatches
Actually I don't think I would have to ruplacer for this part. It could be done simply with the patch command. So I guess only the first feature would be interesting heh

from ruplacer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.