Coder Social home page Coder Social logo

Comments (4)

AmaiKinono avatar AmaiKinono commented on July 25, 2024 1

I think we can close this issue for now, since most things mentioned were implemented, except the grep thing, which may not happen at least in the near future.

from ctrlf.

raxod502 avatar raxod502 commented on July 25, 2024

No. My motivation for creating CTRLF was to replace Swiper, but I wanted to consider carefully what would be the best interface rather than simply re-creating what already existed. On reflection, I decided that the best interface would be a version of Isearch that fixes its idiosyncrasies, rather than something based on Selectrum. This is because I realized that I never actually looked at the matches shown in the minibuffer, because they lacked enough context. The only information I actually got from the minibuffer was the number of matches and my relative position within them. So why not go for a more streamlined approach based on the Isearch paradigm, with a count and index reported in the minibuffer?

The design is based on the function of the ctrl-F binding in most programs, since this has been well-established as an effective and intuitive interface for text search. However, the bindings are remapped from Isearch for consistency with Emacs.

My main goal for development is to reduce the fragility of the Isearch interface; you should only exit a search by intentional keystroke. Also, wraparound should be automatic and information about wraparound should be communicated to the user by means of the index and match count indicator.

I would advise trying the package. It does not require setup beyond straight-use-package and M-x ctrlf-mode. Then you can see what you think.

from ctrlf.

AmaiKinono avatar AmaiKinono commented on July 25, 2024

This is because I realized that I never actually looked at the matches shown in the minibuffer, because they lacked enough context.

You are right. I rethought why I prefer swiper over isearch, and found it's not because I can do filtering in the minibuffer, but various small things:

  • It feels easy to break an isearch session.
  • Swiper highlights the whole line, so I know where I am immediately.
  • I can type M-n to input the symbol under point.
  • The regex builder.
  • I can do grep using commands like counsel-git-grep, and it has a similar experience.

About the regex builder: I think it is both convenient and confusing:

  • When I want to quickly search and jump to a line, for example where some-symbol is defined (without knowing if it's a function/symbol/etc..), I would search for def some-symbol. It feels convenient.

  • When I want to do a regexp search & replace, sometimes it feels not easy to look at the input, guess what the regexp built by ivy is, and write the regexp for replacing (especially with group related stuff). It's better to use regexp to search & replace directly. Though I need to type more this way, it feels better on the mental side.

So I think maybe ctrlf can do some basic regex rebuild thing in regexp search commands. Just translating a single space into .*, and n spaces into n-1 is good enough.

About grep: Seems ctrlf focuses on single buffer search, but I'll just say some of my thoughts. When I'm just grepping and jumping to places, I really don't like bringing in another grep buffer. I think the UI of ctrlf can be slightly modified to do grepping: Show the matched files in minibuffer (maybe horizontally), and add 2 commands to jump between files. When a file is selected, it's still like single buffer searching. I guess this may be some huge amount of works, and of course, it's up to you to whether do it or not.

from ctrlf.

raxod502 avatar raxod502 commented on July 25, 2024

It feels easy to break an isearch session.

Yes, and I intended to solve that problem with the CTRLF implementation.

Swiper highlights the whole line, so I know where I am immediately.

I would be fine with this being added as a user option.

I can type M-n to input the symbol under point.

I don't know if we want this keybinding by default (after all, Isearch provides similar functionality under a different binding), but that is a good feature to add.

The regex builder.

I guess I would be fine with adding this as an option, as long as it supports arbitrary regexps correctly unlike Ivy. Not enabled by default.

About grep

This seems mostly out of scope, but perhaps I could be convinced by a sufficiently elegant implementation. I would definitely be fine with this functionality being implemented in a third package using both CTRLF and Selectrum simultaneously, and the necessary hooks/options being added to both dependencies.

from ctrlf.

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.