Comments (5)
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 aboutvim-abolish
, which seems very nice as well, but I was wondering about the "integration" with it (again in theREADME
):* 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.
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.
README updated :)
from substitute.nvim.
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
toS
to usevim-abolish
by default, but I'm a bit confused: seems to me thatvim-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 ofvim-abolish
)? It's mentioned in theREADME
that this plugin provides no default mappings, so even if we setrange.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.
@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)
- Feature Suggestion: Duplication Operator HOT 2
- keep cursor at positon before operation HOT 2
- Issue with ` key remapped HOT 3
- `motion2` isn't working with `substitute.range` HOT 2
- trim when substituting into not-linewise text object HOT 5
- For substitute.range, is there a way to provide a register or even a lua callback to replace motion1 or motion2? HOT 4
- Broken install/Substitute over range HOT 2
- Error 'start' is higher than 'end' HOT 13
- attempt to index field 'highlight_substituted_text' (a nil value) HOT 2
- [substitute.range] Replace occurence with register in ... <some motion> HOT 4
- [substitute.range] Quickly prefix text HOT 3
- Highlighting the subject works only when cursor position is at the start of the subject HOT 2
- Update documentation
- unicode handling does not work correctly HOT 4
- `highlight_substituted_text` doesn't seem to play nice with `vim.highlight.on_yank()` HOT 2
- getting HOT 2
- Duplicate operator ?
- How to keep default settings and define keys table on lazy.nvim HOT 1
- [Feature Request] substitute/exchange operator provides 2 motion calls. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from substitute.nvim.