Giter Club home page Giter Club logo

ctrlf's Introduction

CTRLF

CTRLF (pronounced "control F") is an intuitive and efficient solution for single-buffer text search in Emacs, replacing packages such as Isearch, Swiper, and helm-swoop.

Installation

CTRLF is available as a package on MELPA. The easiest way to install this package is using straight.el:

(straight-use-package 'ctrlf)

However, you may install using any other package manager if you prefer.

Usage

To enable CTRLF, simply add to your init-file:

(ctrlf-mode +1)

Note that the autoloading has been configured so that enabling ctrlf-mode will not actually load CTRLF until you use one of its commands.

Now the usual Isearch bindings will use CTRLF instead:

  • C-s: ctrlf-forward-default (originally isearch-forward)
  • C-r: ctrlf-backward-default (originally isearch-backward)
  • C-M-s: ctrlf-forward-alternate (originally isearch-forward-regexp)
  • C-M-r: ctrlf-backward-alternate (originally isearch-backward-regexp)
  • M-s _: ctrlf-forward-symbol (originally isearch-forward-symbol)
  • M-s .: ctrlf-forward-symbol-at-point (originally isearch-forward-symbol-at-point)

See Customization to customize the default and alternative search styles.

User guide

The design philosophy of CTRLF is to:

  • replicate the user experience that users expect from text search based on widespread implementations of ctrl+F functionality
  • re-use the flow and keybindings of Isearch
  • emphasize reliability and consistency

As such, if you are familiar with Isearch then you will probably be at home in CTRLF.

Search flow

First you must start a search using one of the following keybindings:

  • C-s: Search forward for a literal string.
  • C-r: Search backward for a literal string.
  • C-M-s: Search forward for a regexp.
  • C-M-r: Search backward for a regexp.
  • M-s _: Search forward for a symbol.
  • M-s .: Search forward for the symbol at point.

During a search, the following core keybindings are available:

  • C-s: Move to next match. With prefix argument, also convert a regexp search back to a literal search. If there is no search query, insert the previous one, as if you had typed M-p. This allows you to resume a search with C-s C-s.
  • C-r: Move to previous match. With prefix argument, also convert a regexp search back to a literal search. If there is no search query, insert the previous one, as if you had typed M-p. This allows you to resume a search with C-r C-r.
  • C-M-s: Move to next match and convert a literal search to a regexp search.
  • C-M-r: Move to previous match and convert a literal search to a regexp search.
  • RET: Finish search, leaving point at the currently selected match.
  • C-g: Abort search, returning point to its original location.

The following additional keybindings are available, emulating standard Emacs bindings:

  • M-<: Move to first match.
  • M->: Move to last match.
  • C-v: Move to first match that appears below the currently visible part of the buffer. In other words, move down by a page.
  • M-v: Move to first match that appears above the currently visible part of the buffer. In other words, move up by a page.
  • C-l: Scroll so that the currently selected match is at the center of the window. Typing C-l multiple successive times, or providing a prefix argument, has the same effect as usual (see the docstring of the recenter-top-bottom command).

CTRLF behavior toggles use the same bindings as in Isearch:

  • M-c and M-s c: Toggle case-sensitive search. By default, search is case-sensitive only if your search contains uppercase letters, like in Isearch (following the logic in isearch-no-upper-case-p).
  • M-s s: Change the search style, e.g. between literal, regexp, symbol, fuzzy, or fuzzy-regexp. Search styles are explained thoroughly later in this documentation. There is no equivalent to this in Isearch, but the binding should feel familiar.
  • M-r and M-s r: Toggle between regexp and literal search style.
  • M-s _: Toggle between symbol and literal search style.
  • M-s .: Change the search input to the symbol at point, and change the search style to symbol.
  • M-s o: Open an Occur buffer with the existing search input.

Other than this, keybindings are completely standard. For example, to delete the last word in your search query, use M-DEL, or to retrieve the previous search query in the minibuffer history, use M-p.

It is standard in Emacs for typing M-n after entering the minibuffer to insert a default value into the minibuffer. In CTRLF, this default value is the symbol at point.

Customization

You can customize the search styles of CTRLF:

  • User option ctrlf-default-search-style specifies the default search style (default: 'literal) that ctrlf-forward-default (bound to C-s by default) and ctrlf-backward-default (bound to C-r by default) use.
  • Similarly, user option ctrlf-alternate-search-style specifies the alternative search style (default: 'regex) that ctrlf-forward-alternate (bound to C-M-s by default) and ctrlf-backward-alternate (bound to C-M-r by default).

You can customize the visual appearance of CTRLF:

  • Face ctrlf-highlight-active is used to highlight the currently selected match.
  • Face ctrlf-highlight-passive is used to highlight the other currently visible matches.
  • Face ctrlf-highlight-line is used to highlight the entire line on which the currently selected match resides, if ctrlf-highlight-current-line is non-nil (the default).
  • If ctrlf-auto-recenter is non-nil, then the currently selected match is always kept vertically centered in the window, as if you typed C-l each time you moved to a new match. This feature is disabled by default.
  • The index of the currently selected match and the total number of matches are displayed at the end of the minibuffer (using face ctrlf-minibuffer-message-face). If ctrlf-show-match-count-at-eol is non-nil (the default), then this information is also shown at the end of the current line in the buffer being searched (using face ctrlf-in-buffer-message-face), which alleviates the problem of needing to look back and forth between the minibuffer and the buffer being searched. Both of the mentioned faces inherit from ctrlf-message-face, as will future faces used by CTRLF to display messages.
  • Zero-length matches (for example, in a regexp search for ^$ which would identify all blank lines the buffer) are displayed as thin vertical rectangles with a solid color since there is no text to highlight. The width of these rectangles relative to the width of a normal character is defined by ctrlf-zero-length-match-width.

You can also customize the keybindings:

  • ctrlf-mode-map lists keybindings that are made globally available in Emacs when ctrlf-mode is enabled.
  • ctrlf-minibuffer-mode-map lists keybindings that are made available in the minibuffer during a CTRLF search session. (Note: Customising this variable needs to happen after ctrlf is loaded, use (with-eval-after-load 'ctrlf ...))

In addition to the functions already bound in ctrlf-minibuffer-mode-map, you can choose to bind ctrlf-next-match and ctrlf-previous-match. These functions are the same as ctrlf-forward and ctrlf-backward, but they do not have the special features of inserting the previous search, changing to a literal search, or starting a new search when not already in a search session.

You can customize the behavior:

  • If ctrlf-go-to-end-of-match is nil, then the cursor will move to the beginning of the match instead of the end.

Search styles

CTRLF implements support for literal and regexp using an extensible search style system. This functionality is configured using the ctrlf-style-alist user option. End users need not touch this option unless they wish to do advanced customization or are developing a package which integrates with CTRLF.

The keys of ctrlf-style-alist define the available search styles. These styles appear in two places:

  • As options in the ctrlf-change-search-style command bound by default to C-o s.
  • As possible values for the STYLE argument to the ctrlf-forward and ctrlf-backward functions.

Basically, a search style defines a way to transform the user's search query into a regexp which can be passed to search-forward-regexp or search-backward-regexp. Here are the built-in search styles:

  • literal: Search for an exact match to the query string, subject to case folding (C-o c). This is implemented using regexp-quote.
  • regexp: Search for a regexp provided by the user. If the regexp is invalid, CTRLF will display an error message in the minibuffer until the problem is corrected.
  • fuzzy: Split the query string on spaces and search for an occurrence of all the sub-parts separated by arbitrary text. To include a literal space, or more than one, simply add an additional space. For example, foo $42 baz quux is turned into foo.*\$42.*baz quux.
  • fuzzy-regexp: Same as fuzzy except that the individual sub-parts are interpreted directly as regexps, so that foo $42 baz quux is turned into foo.*$42.*baz quux.

To define a custom search style, you should proceed according to the following steps:

  • Add an entry to ctrlf-style-alist with:
    • The name of the search style as a symbol.
    • The string to display in the prompt when using this search style (:prompt).
    • A function that will take the user input and return a regexp (:translator).
    • A function that will take the user input and guess whether case-folding should be enabled by default.
  • Define wrapper functions after the fashion of ctrlf-forward-literal and ctrlf-backward-literal that use ctrlf-forward and ctrlf-backward, respectively, as subroutines.
  • Bind these functions in ctrlf-mode-bindings.

Disabling CTRLF locally

ctrlf-mode is a globalized minor mode that enables the buffer-local minor mode ctrlf-local-mode. This makes it possible to disable it when there is a conflict, for example with pdf-isearch-minor-mode from pdf-tools:

(add-hook 'pdf-isearch-minor-mode-hook (lambda () (ctrlf-local-mode -1)))

Miscellaneous

The minibuffer history for CTRLF is stored in the variable ctrlf-search-history. You can access it during a search session using M-p and M-n. Typing M-n at the beginning of a session will perform a search for the symbol at point. Furthermore, typing C-s or C-r without any search query is a synonym for M-p.

CTRLF integrates with evil-mode's jump-list and search history features. You will be able to jump with C-o and C-i and continue a search with n and N based on your CTRLF searches.

Why use CTRLF?

This section documents why I decided to write CTRLF instead of using any of the numerous existing solutions in Emacs.

Why not Isearch?

Isearch has the right idea for buffer search, but it has serious usability problems. The main issue, for me, is that it feels extremely fragile. If you type any command that is not bound in Isearch, then you exit your search and run that command. This means editing your search query is awkward and unintuitive. Another issue is predictability. The behavior of C-g is hard to predict because it depends on not only what you have typed in what order, but also on the buffer contents and the state of the current search. The handling of wraparound exacerbates problems of predictability: the number of times you must type C-s to move to the next match is unpredictable and the minibuffer prompt changes in several different and confusing ways during this process.

CTRLF takes the basic idea of Isearch, together with most of its keybindings, but emulates the more reliable user experience of web browser text search. For example: all editing commands can be used during a search as usual; C-g always has the effect of canceling the search; and C-s always moves to the next candidate, with wraparound signaled by an overlay which indicates the current match index and the total number of matches (another UI paradigm borrowed from other programs).

Why not Swiper?

The selling point of Swiper is that it shows you an overview of the matches. Ask yourself: when was the last time you actually got anything useful out of that overview? Since all the matches are crammed together, one per line, there is not enough context for meaningful information to be communicated. Furthermore, Swiper constrains itself almost exclusively to line-based search by design, which makes it unsuitable to the task of quick movement within a line or movement to a commonly occurring search string.

Why not helm-swoop?

For basically the same reason that Swiper is not a good solution, with the added complaint that Helm is extraordinarily complex and in-your-face about this complexity. Single-buffer text search is not a terribly difficult problem, and given that CTRLF is only about 1,100 lines of code, I think that the 1,700 lines of code of helm-swoop plus the 10,600 that come with Helm is a bit overkill.

Why not M-x occur?

M-x occur implements noninteractive search, and therefore unsuitable as a tool for quickly jumping to other parts of the buffer.

Why not Avy?

It does not usefully support text search outside the currently visible window.

Contributing

Please see the contributor guide for my projects.

ctrlf's People

Contributors

alexander-miller avatar amaikinono avatar andersjohansson avatar andyleejordan avatar atemu avatar dawranliou avatar haji-ali avatar irigone avatar irrenwirr avatar nicholasbhubbard avatar raphus-cucullatus avatar raxod502 avatar rgrinberg avatar save-buffer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ctrlf's Issues

Curious behaviors with zero-length matches

Using regexp search for ^ in following sample file, including trailing newline:

ff
ergergjeg
egr
hst
sth
tshr
g
gre
ergs
  • No match is displayed on the first or last line although it is possible to select those matches interactively.
  • When the match on the last line is selected, no other matches are reported.
  • When starting from the beginning of the buffer and advancing using C-s, the first match is selected after the fourth one, so the fifth and following matches are only selectable using M-> or by moving point manually.

What is minibuffer-beginning-of-buffer?

CTRLF remaps minibuffer-beginning-of-buffer to ctrlf-first-match, but that doesn't work on my setup, and I didn't find such a command. I changed it to beginning-of-buffer and it works. Should this be done?

Additional keybindings

Bind C-l to recenter, C-v and M-v to move a page's worth of matches forward or backward.

ctrlf-mode is not active on startup

Snippet of my config:

(use-package ctrlf
  :straight (ctrlf
             :type git
             :host github
             :repo "raxod502/ctrlf")
  :config (ctrlf-mode +1)
  :bind (:map minibuffer-local-map
              ("C-r" . ctrlf-backward-literal)))
;; Not sure why
(ctrlf-mode +1)

Notice I have to activate ctrlf-mode twice to get it to stay active. Also, another issue I had was having to define "C-r" keybind again even though i-search appeared to be overridden by ctrlf, but only to get C-r's to work in the minibuffer.

Make translator functions public

It's not good to have a public user option (ctrlf-style-alist) whose default value includes private symbols (e.g. ctrlf--fuzzy-translate). This should be fixed.

Incompatibility with package mini-frame

Hi!

Really nice package here, it feels very snappy and is simple to use, thank you for your work!

Unfortunately it seems that it's not really compatible with mini-frame. For instance, C-s keeps moving the cursor back to the beginning of the prompt and then input is reversed.

To reproduce, evaluate code below in an emacs -Q and try C-s

(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(straight-use-package 'mini-frame)
(straight-use-package 'ctrlf)

(ctrlf-mode +1)
(mini-frame-mode +1)

Keep current match in the middle of the window?

Sometimes we are just searching to peek things. When the match is on the beginning/end of the window, we have to search backward/forward again and then move back to show its surroundings. So how about keeping current match in the middle of the window?

[BUG] CTRLF does not work in the emacs startup loaded buffer

Starting with an empty config, and adding the following lines

(setq initial-buffer-choice "buffer1")
(setq straight-repository-branch "develop")
(defvar bootstrap-version)

(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(straight-use-package 'ctrlf)
(ctrlf-mode +1)

If I start Emacs, write something in the buffer and then and press C-s or C-r once, I get in the mini buffer

CTRLF ↑ literal:

but after I write some text and re-press C-s or C-r to search for it, instead of navigating through the occurrences I get a message in the mini-buffer:
I-search backward: [No previous search string]

and in the *Messages* buffer:
isearch-edit-string: Command attempted to use minibuffer while in minibuffer

I then have to cancel the command with C-g and if I try to use CTRLF again, this time it works in the expected way.

This also happens if the user does not suppress the default splash screen.

False error when searching closing parenthesis

When searching ), ] or }, CTRLF says "No matching parenthesis found", but the search actually success, I can call ctrlf-next/prev-match to browse the result.

This happens in all search styles.

"Smart" case fold?

In isearch, the default behavior is do case insensitive search when the user input is all lower case, and do case sensitive search otherwise. This is neat.

I once thought this behavior is controled by case-fold-search, but then I found it controls case sensitivity directly. If there's no built-in mechanism for this, we may need to invent our own.

ctrlf-mode breaks search in find-file and switch-buffer

I frequently use find-file history search (C-x C-f followed by C-r). That errors out with ctrlf-mode enabled. I'm not sure if there's a recursive minibuffer in play when isearch is used from find-file or switch-buffer, but maybe you could detect this situation and fall back to vanilla isearch.

Entire current line is not highlighted

Currently, only the text content of the current line is highlighted when ctrlf-highlight-current-line is non-nil. However, it is possible in Emacs to highlight the entire line, all the way to the right margin. We should do this instead.

Reverse search should be consistent with forward search

Currently if you use C-s to jump to a match, then press C-r C-r, you jump to the previous match. However, if you do the same sequence of actions with the roles of C-s and C-r interchanged, you stay at your current match. The latter behavior should be used in both cases.

Point displayed in wrong place with multiple messages

If the match count overlay is active and you trigger a message (e.g. by trying to use a recursive minibuffer), point shows up between the two messages rather than in its usual place at the end of the user input.

Display zero-length matches visibly

Currently, zero-length matches are invisible, which is bad user experience. They should be displayed as some sort of (preferably effectively zero-width) vertical bar.

Show current match index and count directly in buffer

When navigating between matches, it is difficult to keep track of the match index and count because they are in the minibuffer but you are looking at the main buffer. One way to address this problem is to additionally add an overlay to the right margin of the buffer being searched which duplicates the match index and count information.

Perform multiple searches in parallel when multiple-cursors is active

Currently, I'm using phi-search for its integration with multiple-cursors. Is there an easy way to extend ctrlf to also support multiple cursors? For now, I've employed this hack:

(defmacro ctrlf-or-phi (key phi-version ctrlf-version)
  "Call ctrlf unless multiple cursors are active, in which case call phi"
  `(global-set-key (kbd ,key)
                   #'(lambda () (interactive)
                       (if multiple-cursors-mode
                           (,phi-version) (,ctrlf-version)))))
(ctrlf-or-phi "C-s" phi-search ctrlf-forward)
(ctrlf-or-phi "C-r" phi-search-backward ctrlf-backward)

Overview feature, as in Swiper

Hi, I know that you list the Overview feature of Swiper as maybe not that useful. However, I really like being able to see occurances (and some context) throughout the buffer, even those that are not visible yet. Any chance there will be a similar feature in Ctrlf?

I'm loving Selectrum and am looking to get rid of the Swiper/Ivy/Counsel suite.

Thanks!

CTRLF stuck when searching symbol

When searching for a symbol, we use this regexp:

\_<symbol-name\_>

This works fine in isearch-foward-regexp, but when typing it in CTRLF, Emacs stucks like forever. Typing C-g can recover it, but I can't search anything after that in the current CTRLF session.

I can paste it directly and make CTRLF do the search, so this should be a problem when handling user input.

Remember search minibuf text input after C-g aborting search

This is a QoL issue, a potential user enabled customization, but I find myself needing to search with the same input, not having hit enter to commit the previous search but having typed C-g to exit the search prematurely. I have to type the word again after a subsequent C-s because it is not saved in C-r or s i-search results. I do notice I typically type C-s, C-r, C-l again after an initial C-s or C-r so maybe capturing the searched text somehow during those events would help?

Interferes with search in pdf-view buffers (pdf-isearch-mode)

When using pdf-tools and its pdf-isearch-minor-mode to search in pdfs this works by pdf-isearch-minor-mode setting variables like isearch-search-fun-function to suitable functions that work on the pdf. This doesn't work at all when ctrlf-mode overrides the keys for isearch.

A simple solution would be to make it possible to disable ctrlf-mode locally.
Then we could just do:

(add-hook 'pdf-isearch-minor-mode-hook (lambda () (ctrlf-mode -1)))

A more complex and more awesome solution would be to implement all the things that isearch does with these redefined functions. pdf-isearch-minor-modesets:
isearch-search-fun-function, isearch-push-state-function, isearch-wrap-function and some other options.

Odd behavior when setting mark with empty search input

If you start CTRLF and then press C-SPC immediately, you end up with a rather odd result:

image

In particular the minibuffer prompt has been selected, and if I type M-w then the prompt is copied to my kill ring.

Mark behavior is otherwise unremarkable. It's just when the search input is empty.

[End of buffer] issue

I'm trying to get rid of ivy and swiper. When using ctrlf to find next search using, my muscle memory make me press C-n and I get

Screen Shot 2020-05-16 at 7 27 37 PM

Not a really big issue, and I may forget C-n and use C-s instead.

Allow toggling case-fold during CTRLF session

In Isearch, it is possible to toggle case-fold-search by pressing M-c or M-s c during an active search. I don't think binding M-c is a good idea given that CTRLF (unlike Isearch) actually allows you to edit the query at any time, but binding M-s c would be great. Implementing this feature will require updating the search results automatically when case-folding is toggled. See also #22.

The autoload of CTRLF breaks Emacs startup

I updated to the latest version, then I got this when Emacs startup:

Symbol's function definition is void: map-apply

The weird thing is even I remove the use-package code of CTRLF, this still happens. I looked into it and found it may be caused by this in the autoload:

(define-minor-mode ctrlf-mode "Minor mode to use CTRLF in place of Isearch.
See `ctrlf-mode-bindings' to customize." :global t :keymap ctrlf--keymap (when ctrlf-mode (setcdr ctrlf--keymap nil) (map-apply (lambda (key cmd) (when (stringp key) (setq key (kbd key))) (define-key ctrlf--keymap key cmd)) ctrlf-mode-bindings)) (with-eval-after-load (quote ctrlf) (if ctrlf-mode (advice-add (function minibuffer-message) :around (function ctrlf--minibuffer-message-condense)) (advice-remove (function minibuffer-message) (function ctrlf--minibuffer-message-condense)))))

When I delete straight/build-cache.el, Emacs could startup correctly, but when I open Emacs again, it fails. Notice that the use-package code of CTRLF is already removed, but I think straight still builds it since it's in straight/repos.

A simple fix is add ;;;###autoload on (require 'map), but I'm not sure if this is a good fix.

Use M-s prefix and `search-map` bindings when using ctrlf

Hi,

I really want to like this package, especially because of this design principle:

re-use the flow and keybindings of Isearch

I could never stick with swiper et. al. because, as an old Emacs user, all the semantics of isearch and search-map are embedded in my fingers.

The first thing I noticed was that I had a ctrlf search going, and then wanted to pull up my Occur buffer (to go use the handy occur-edit-mode). From an ongoing isearch, this is just M-s o:

M-s o runs the command isearch-occur (found in overriding-terminal-local-map)

Which runs occur from isearch. Outside of an isearch, this same binding just runs occur.

A lot of the toggles listed under the core keybindings I think ought to exist under the (overriden) search-map bindings, to really uphold the stated design principle. Right now, M-s runs the command next-matching-history-element, which is completely unexpected as Emacs/isearch user when running a search.

Some others I can think of:

  • M-s o to switch to occur (as above)
  • M-s r to toggle regexp/literal (currently on C-M-s and C-M-r, which are fine to keep too, but also on C-o s which isn't Emacsy)
  • M-s . runs the command isearch-forward-symbol-at-point (this works both in and out of an isearch), should run ctrlf with the symbol at point (currently on M-n, which also seems fine, but different from isearch)
  • M-s c toggles case sensitivity (currently on C-o c which also isn't Emacsy)
  • M-s e doesn't need to exist, since it enters isearch edit mode, but ctrlf appears to always be editable

It seems like adding the prefix C-o was just a choice made during development, but it's inconsistent with the design principle of re-using the flow and keybindings of isearch. The search-map is really handy, and already bound to M-s, which a lot of Old Emacs Users already use (and some of us add a lot of other things to the normal search-map, like bindings to rgrep and equivalents).

Anyway, ctrlf looks really promising, thanks for the work on it. I just found the lack of M-s very jarring as an isearch user.

Support zero-length matches

Although searching for the empty string is not interesting, it is interesting to search for something like %* which matches not only the empty string but also other strings. Therefore we should support this use case.

(Currently, if you change the regexp to something that matches the empty string, the previous search results remain onscreen, which is also bad and should be fixed.)

Support char folding

Hello,

It seems that ctrlf doesn't support char-fold-to-regexp search mode (see search-default-mode). It would be lovely to get support of this feature as it helps searching text with diacritical marks. For example, consider the following buffer:

Bună dimineața
Buna dimineata

With isearch typing buna matches both variants, while ctrlf matches only the last one.

You can read more about this feature in the documentation of char-fold-to-regexp function or in pretty old post by Artur Malabarba.

Thanks in advance :)

Will this package have a similar experience like swiper?

I'm migrating from ivy to selectrum (as you know). Now what I miss most is swiper and counsel-git-grep. I can do search & replace with the built in tools from Emacs, but when I'm just searching and jumping to places (without replace), I would like to have an ivy/selectrum like UI. When I was just thinking about implementing it using selectrum, I saw this package. I haven't tried it mainly because I didn't get an impression from the README. So, what will it be like? Could you talk a little about your blueprint or design?

Find-and-replace interface

I think we need replacing functionalities to make this package complete. Do you already have some thoughts or design on this?

Helm-minibuffer-history interferes with backward search: simple solution

When using helm and loading the default keybindings in helm-config, helm-minibuffer-history is bound to C-r in minibuffer-local-map, which the minibuffer keymap used in ctrlf inherits from. Pressing C-rwill then call helm-minibuffer-history instead of the remapped isearch-backward from ctrlf-mode-bindings.

I solved this simply for my case by:

(add-to-list 'ctrlf-minibuffer-bindings '("C-r" . nil))

I don’t know if anything should be done on the side of ctrlf to prevent this, or if it should be left to the user (perhaps with a note in the readme?). One idea otherwise is to bind C-r to isearch-backward and C-s to isearch-forward in ctrlf-minibuffer-bindings to prevent any other command from overriding it, but I suppose that's not a very good idea either as we can’t assume those are the keys the user wants to use.

What we would like to do is unbind (or bind correctly) any bindings for the keys used for isearch-forward/backward when the minibuffer keymap is created, but I don’t know if this is possible

Does not make org-mode folds with matches visible

isearch opens invisible org-mode sections if there are matches within them. ctrlf does not do this. It finds the matches and you can cycle between them, but they are invisible if the section is invisible.

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.