Code Monkey home page Code Monkey logo

Comments (5)

gbprod avatar gbprod commented on May 28, 2024 1

For the integration with yanky (I'm enjoying it BTW), what exactly are we trying to achieve? I mean you mention "to enable yanky swap when doing substitution", what is the "swap" here that we're enabling?

It means that you can cycle throught yank-ring after a substitution, this will replace substituted text with previous items of your yank ring (maybe I should be more precise about this in the readme).

After reading the README, I learned about vim-abolish, which seems very nice as well, but I was wondering about the "integration" with it (again in the README):

* It's mentioned to set `range.prefix` to `S` to use `vim-abolish` by default, but I'm a bit confused: seems to me that `vim-abolish` is not a replacement for this plugin (I may be wrong, but I think it's basically replacing a word with some variants of it?), so what are we trying to achieve here by this integration?

* Another thing I'm confused about: what's the effect of setting `range.prefix` to a key (still in the context of `vim-abolish`)? It's mentioned in the `README` that this plugin provides no default mappings, so even if we set `range.prefix` to something, wouldn't it be "overwritten" by what we set in the mappings?

Abolish introduce a new substitution operator that you can use in command line (Subvert or just S) as you can see in the documentation : https://github.com/tpope/vim-abolish#substitution
(It also exists in text-case.nvim as Subs). This allows to substitute text keeping the same text case.
When using substitute over range motion, it basicly generate a command to substitute text in the selected range motion, range.prefix allows to choose the substitution method.
Eg. By default, this will create a substitution like :'[,']s/search/replace/g, but if you set range.prefix to Subvert, this will create :'[,']Subvert/search/replace/g (and use the power of vim-abolish :) )

Is that any clearer to you?

from substitute.nvim.

gbprod avatar gbprod commented on May 28, 2024

Hey @farzadmf !
Thanks for giving a try to my plugins, any feedback are welcome.

About the integration, both works but it's betterto use the one from Yanky documentation:

require("substitute").setup({
  on_substitute = require("yanky.integration").substitute(),
})

(The last character is the <c-v> char, using yanky.integration avoid copy/paste problem)

I should update substitute readme, thanks for your feedback!

from substitute.nvim.

gbprod avatar gbprod commented on May 28, 2024

README updated :)

from substitute.nvim.

farzadmf avatar farzadmf commented on May 28, 2024

Hey @gbprod , really appreciate the quick action and sorry for the late reply

Now that I see you're a nice person 😆, can I ask a few questions (they'll probably be stupid because in my [neo]vim years, I haven't used a substitute plugin), so please answer if they make sense and you have the time, and ignore if either is not the case


For the integration with yanky (I'm enjoying it BTW), what exactly are we trying to achieve? I mean you mention "to enable yanky swap when doing substitution", what is the "swap" here that we're enabling?


After reading the README, I learned about vim-abolish, which seems very nice as well, but I was wondering about the "integration" with it (again in the README):

  • It's mentioned to set range.prefix to S to use vim-abolish by default, but I'm a bit confused: seems to me that vim-abolish is not a replacement for this plugin (I may be wrong, but I think it's basically replacing a word with some variants of it?), so what are we trying to achieve here by this integration?

  • Another thing I'm confused about: what's the effect of setting range.prefix to a key (still in the context of vim-abolish)? It's mentioned in the README that this plugin provides no default mappings, so even if we set range.prefix to something, wouldn't it be "overwritten" by what we set in the mappings?


Needless to mention again that you have no obligation whatsoever to explain these things to me, but I think this plugins is one of those that will deeply affect my workflow; I feel that's gonna happen, but I haven't yet figured out the full potential

from substitute.nvim.

lilianchisca avatar lilianchisca commented on May 28, 2024

@gbprod thank you for answering these mate, had the exact same questions and you explained it perfectly... I think it might be great if these were added in the docs as it's definitely confusing for noobs like me  🙈

from substitute.nvim.

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.