Giter VIP home page Giter VIP logo

Comments (10)

wincent avatar wincent commented on July 17, 2024 1

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.

wincent avatar wincent commented on July 17, 2024

You need a trailing slash. ie. :Acks /foo|bar/baz/

Surprised it didn't show an error.

from ferret.

wincent avatar wincent commented on July 17, 2024

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.

chiefjester avatar chiefjester commented on July 17, 2024

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.

chiefjester avatar chiefjester commented on July 17, 2024

@wincent I've added an asciinema recording:
asciicast

from ferret.

chiefjester avatar chiefjester commented on July 17, 2024

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.

chiefjester avatar chiefjester commented on July 17, 2024

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.

wincent avatar wincent commented on July 17, 2024

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.

wincent avatar wincent commented on July 17, 2024

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.

chiefjester avatar chiefjester commented on July 17, 2024

sweet thanks for the update @wincent!

from ferret.

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.