Comments (10)
Personally, I think "very magic" makes the most sense (Vim's idiosyncratic regular expressions drive me up the wall), but I am reluctant to tamper with manipulate people's defaults too much. I do that in the Loupe plugin, for example, but it is gated behind an option.
It's true that we could make the mapping prepend it by default, but I would probably want it to have an option for it.
from ferret.
You need a trailing slash. ie. :Acks /foo|bar/baz/
Surprised it didn't show an error.
from ferret.
Depending on your 'magic'
Vim setting you may need to escape the |
too (\|
). Whatever you write gets passed through as-is to Vim as though you had written a :s
command.
from ferret.
hey @wincent big fan here! Thanks for checking, but yeah, I just forgot to add a slash on the comment, but when I tried it it won't work.
from ferret.
@wincent I've added an asciinema recording:
from ferret.
sorry @wincent I didn't see your comment about magic setting
So my Acks should be like this? (need to add \v) ?
:Acks /\vfoo|bar/baz/
Also I was wondering, if Acks is using :cfdo under the hood, isn't
"very magic" mode for vim is the most compatible with perl compatible and should be the default? That way it's a better partner for ag,ack,rg's regex since they more or less share the similar regex engine? Would you be open for a PR to make it default for <Leader>r
?
I guess this is where we set that?
https://github.com/wincent/ferret/blob/master/plugin/ferret.vim#L676-L677
from ferret.
I'm pro for making very magic
default as well. I'm coming from from a vimgrep workflow where I can test my regex in search do a :cfdo s/<C-r>//
after.
I wish vim plugins have semver, that way you can iterate over major versions and won't need to worry about breaking other people's workflow.
However, using very magic
actually makes it closer to perl compatibility and would actually be an improvement rather than a regression.
But I do respect your reluctance. Perhaps some compromise of having a gated option as well? So that people can opt-in for the very magic? (If making it a default is a non option). We could also have a gate where users can use legacy bindings too?
from ferret.
I think it's probably ok to change the default even though people tend not to pay attention to semver, for a couple reasons:
- We will have an escape hatch (an option).
- The behavior change will be obvious (because when you hit the mapping, you'll see
:Acks /\v...//
instead of:Acks /...//
).
from ferret.
I pushed a draft implementation of this to the "next" branch. I'll test it for a while there and if all looks good will merge that into "master".
from ferret.
sweet thanks for the update @wincent!
from ferret.
Related Issues (20)
- Implement :Lacks, analogous to :Acks but applying to the location-list HOT 3
- ferret make <cword> not working. HOT 4
- allow umap key as feature HOT 1
- FerretAckWord should pass -w option by default HOT 2
- Add a binding to reload the quickfix window
- Autocompleting a directory does not include trailing slash HOT 2
- how to show full path ? HOT 4
- Add a function that prompts for a search query HOT 2
- Port to Lua HOT 3
- Individual overrides HOT 2
- :Black command shadows vim-black :Black (main command) HOT 2
- Case insensitvie search HOT 4
- ripgrep 13.0.0 breaks search in neovim HOT 2
- key mapping HOT 7
- Ferret fails to search string using non ascii character HOT 3
- Ripgrep 13 search stuck when using options in neovim HOT 4
- Delete quickfix/loclist to empty will cause ferret#private#qf_delete error HOT 3
- nvim v0.7.0 error HOT 4
- Tons of duplicate results that don't show up in `rg` HOT 6
- Async not used in Vim 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 ferret.