Git Product home page Git Product logo

casual-isearch's Introduction

https://melpa.org/packages/casual-isearch-badge.svg

Casual I-Search - A Transient menu for I-Search

This package contains a Transient menu for I-Search. When in basic I-Search mode, this menu can be raised by pressing the C-o key. A menu of different isearch commands will be offered as shown below:

docs/images/casual-isearch-tmenu.png

Install

Use the following lines to install casual-isearch-tmenu.

(require 'casual-isearch)
(keymap-set isearch-mode-map "C-o" #'casual-isearch-tmenu)

Alternately install with use-package using the following initialization:

(use-package casual-isearch
  :ensure t
  :bind (:map isearch-mode-map ("C-o" . casual-isearch-tmenu)))

The keybinding to casual-isearch-tmenu can be changed to user preference.

Menu Commands

The following I-Search commands are grouped as follows in the Transient menu casual-isearch-tmenu. Keys associated with each command are shown enclosed in parentheses.

Edit Search String

  • isearch-edit-string (e)
  • isearch-yank-word-or-char (w)
  • isearch-yank-symbol-or-char (s)
  • isearch-yank-line (l)
  • isearch-yank-kill (y)
  • isearch-forward-thing-at-point (t)

Replace

  • isearch-query-replace (r)
  • isearch-query-replace-regexp (x)

Toggle

  • isearch-toggle-regexp (X)
  • isearch-toggle-symbol (S)
  • isearch-toggle-word (W)
  • isearch-toggle-case-fold (F)
  • isearch-toggle-lax-whitespace (L)

Misc

  • isearch-occur (o)
  • isearch-highlight-regexp (h)
  • isearch-highlight-lines-matching-regexp (H)

Navigation

  • isearch-repeat-forward (n)
  • isearch-repeat-backward (p)

Dismiss

The Transient key C-q will dismiss the menu.

Usage

When in search mode (typically via the keybinding C-s or C-r), pressing the keybinding C-o (or binding of your preference) will raise the Transient menu casual-isearch-tmenu. Once raised, only the I-Search commands in the Replace and Misc sections will automatically dismiss the menu when selected. All other I-Search commands will not dismiss the menu.

Note that editing the search text via isearch-edit-string will enter a recursive editing mode that is normally exited when pressing the return key.

Use C-g to dismiss this Transient menu.

See Also

Casual I-Search is part of a suite of porcelains for different Emacs packages.

To get all current and future Casual porcelains, please install Casual Suite from MELPA.

User Interfaces currently supported by Casual are listed below:

Users who prefer finer grained control over package installation can install each user interface above individually.

Sponsorship

If you enjoy using Casual I-Search, consider making a modest financial contribution to help support its development and maintenance.

docs/images/default-yellow.png

casual-isearch's People

Contributors

kickingvegas avatar

Stargazers

Taylor Schmidt avatar Struan Robertson avatar Mitchel Humpherys avatar Giulio Pietroiusti avatar  avatar Dilip avatar Denys Mentiei avatar Sergey Sudakov avatar  avatar Siavash Askari Nasr avatar Tomohiro Matsuyama avatar Zachary Romero avatar Rusty avatar yx avatar David Wright avatar paramtapm.ai avatar  avatar Fabrizio Contigiani avatar Tyler Smith avatar  avatar Marco Craveiro avatar Matthew Campbell avatar Ravioli avatar  avatar Marc Zonzon avatar Xavier Capaldi avatar Romain Leroux avatar Chmouel Boudjnah avatar Binbin avatar  avatar Mark Kusper avatar Daniel Molina avatar Mir Behroz Noor avatar J.P avatar Abdelhak Bougouffa avatar Bruno Bigras avatar  avatar stardiviner avatar Mr Unhappy avatar JunghanKim avatar

Watchers

 avatar  avatar

casual-isearch's Issues

converting search to highlight-regexp

I like M-s h r for highlighting a regexp throughout my buffer: I can, for example, do that, type in foo.*bar and it highlights what you'd expect.

I'd like cc-isearch-menu to become my go-to interface for search-related stuff, and indeed the h option seems like it should be able to replace the above M-s h r. But it doesn't seem to work: if I do C-s, enter foo.*bar, then F2 to invoke the menu, and do h, it doesn't highlight that regexp.

It seems that in the above workflow, the string passed along isn't interpreted as a regexp, but as a literal string.

Is this a bug, or is there some nice way to do this kind of regexp highlighting?

Change toggle behavior to "toggle and edit"

Here's a workflow that gives a "this should never happen" error:

  1. I start a search with C-s.

  2. I realize I actually want regexp searching. I hit F2 to get a lovely menu :) I then do X.

  3. I see the Regexp I-search prompt in the minibuffer -- but the first character I type results in showing the Warning buffer:

    ⛔ Error (transient): Inconsistent transient state detected.
    This should never happen.
    Please open an issue and post the shown command log.

The messages buffer shows this, which I think is related:

Unbound suffix: ‘f’ (Use ‘C-g’ to abort, ‘?’ for help) [isearch-printing-char]

Not sure if this is related, but after step (1), if I type in some text, then do F2 and X, I expected to see my currently-entered text -- since the menu says "toggle". But I get a blank prompt. It would be nice if the menu, when toggling, would pull in the existing search string.

add isearch keybindings to descriptions?

For the "pull..." items, you can use those keys multiple times to pull in multiple things. It would be nice if your lovely transient menu showed the keybinding to make it easier for the user to do those more than once.

Example workflow:

  1. I do C-s to start isearch and want to search for the word at point
  2. I do F2 to show your menu, see "Pull next word or character from buffer" and do w.
  3. That pulls in the word. But now I want the next word.
  4. I could do F2 then w again, but I know there's some easy keybinding I can just repeatedly use. What is that?

Idea; just add the isearch keybinding to your description, so for example, the menu would show

w Pull next word or character from buffer (C-w)

...or similar, so that after seeing that once, I know I can just keep hitting C-w to pull in more words.

Keep menu displayed regardless of type of text pulled in

UX Change

When pulling in search text (symbol, thing, line, word), keep the menu displayed rather than having it dismiss when the next word is selected.

This way the user still has the option to query replace without having to raise the dialog again.

UI change so that "q" dismisses, "r" replaces

Rebind keys so that:

  • "r" is bound to isearch-query-replace
  • "q" is bound to dismissing the menu

Currently "q" is bound to isearch-query-replace which upon reflection is idiosyncratic:

  • the original menu binding fixated too much on "query" rather than "replace".
  • "q" is often used to quit or dismiss a window in Emacs.

Given the above, make a UI change.

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.