All Projects → zk-phi → Phi Search

zk-phi / Phi Search

Another incremental search command, compatible with “multiple-cursors”

Labels

Projects that are alternatives of or similar to Phi Search

Exwm Edit
Edit mode for EXWM
Stars: ✭ 92 (-11.54%)
Mutual labels:  emacs
Ox Rst
reStructuredText Back-End for Org-Mode Export Engine
Stars: ✭ 94 (-9.62%)
Mutual labels:  emacs
Srcery Emacs
Dark colorscheme for Emacs/Spacemacs. GUI and terminal support
Stars: ✭ 102 (-1.92%)
Mutual labels:  emacs
Helm System Packages
A Helm interface to the package manager of your operating system
Stars: ✭ 93 (-10.58%)
Mutual labels:  emacs
Emacs Config
Personal Emacs configuration files
Stars: ✭ 94 (-9.62%)
Mutual labels:  emacs
Dotfiles
💻 Use command line interface manager for macOS configuration.
Stars: ✭ 97 (-6.73%)
Mutual labels:  emacs
Emacs.sexy
Emacs.sexy
Stars: ✭ 90 (-13.46%)
Mutual labels:  emacs
Restart Emacs
A simple emacs package to restart emacs from within emacs
Stars: ✭ 104 (+0%)
Mutual labels:  emacs
Organice
An implementation of Org mode without the dependency of Emacs - built for mobile and desktop browsers
Stars: ✭ 1,327 (+1175.96%)
Mutual labels:  emacs
.personal Emacs.d
😈 My opinionated Emacs configuration
Stars: ✭ 101 (-2.88%)
Mutual labels:  emacs
Auth Source Pass
Integrate Emacs' auth-source with password-store
Stars: ✭ 93 (-10.58%)
Mutual labels:  emacs
Eless
A Better 'less' - A bash script that loads emacs with minimal view-mode config - Created with Org mode
Stars: ✭ 94 (-9.62%)
Mutual labels:  emacs
Dte
A small, configurable console text editor (moved to https://gitlab.com/craigbarnes/dte)
Stars: ✭ 98 (-5.77%)
Mutual labels:  emacs
Gscholar Bibtex
Retrieve BibTeX entries from Google Scholar, ACM Digital Library, IEEE Xplore and DBLP
Stars: ✭ 92 (-11.54%)
Mutual labels:  emacs
Nimbus Theme
The best dark theme for Emacs
Stars: ✭ 102 (-1.92%)
Mutual labels:  emacs
Dotfiles
👾 ~/
Stars: ✭ 91 (-12.5%)
Mutual labels:  emacs
Frames Only Mode
Make emacs play nicely with tiling window managers by setting it up to use frames rather than windows
Stars: ✭ 96 (-7.69%)
Mutual labels:  emacs
Logview
Emacs mode for viewing log files.
Stars: ✭ 104 (+0%)
Mutual labels:  emacs
Binder
Emacs global minor mode facilitating multi-file writing projects
Stars: ✭ 104 (+0%)
Mutual labels:  emacs
Parrot
A package to rotate text and party with parrots at the same time
Stars: ✭ 99 (-4.81%)
Mutual labels:  emacs
  • phi-search.el

multiple-cursors.el対応のインクリメンタルサーチ

another incremental search & replace, compatible with "multiple-cursors"

** Screencast

[[img/search.gif]]

** Usage

Require this script

: (require 'phi-search)

then command "phi-search" and "phi-search-backward" are available. You may bind a key to the command.

: (global-set-key (kbd "C-s") 'phi-search) : (global-set-key (kbd "C-r") 'phi-search-backward)

While searching, following commands are available.

  • [C-s] phi-search-again-or-next

    Move to the next matching item. If query is blank, use the last query.

  • [C-r] phi-search-again-or-previous

    Similar to phi-search-again-or-next, but move to the previous item.

  • [C-v] phi-search-scroll-up

    Scroll the target window up, to check candidates.

  • [M-v] phi-search-scroll-down

    Scroll the target window down.

  • [C-l] phi-search-recenter

    Recenter the target window.

  • [M-c] phi-search-case-toggle

    Toggle phi-search-case-sensitive on-the-fly.

  • [C-w] phi-search-yank-word

    Expand query by yanking one word from the target buffer.

  • [RET] phi-search-complete

    Finish searching.

  • [C-RET] phi-search-complete-at-beginning

    Finish searching at the beginning of the match.

  • [C-c C-c] phi-search-unlimit

    Force update results regardless of "phi-search-limit"

  • [C-g] phi-search-abort

    Finish searching, and move back to the original position.

** Working with Regions

(in following examples, assume "[" as mark, and "|" as point)

When phi-search is called with an active region, then the substring is used as the default query.

: [region| another region |region another region region another |region : _______________________ ______________________ ______________________ : query: region query: region

Or, if phi-search is called with an active mark but no region there, mark stays active until phi-search ends. So you may use this command to expand region.

: [|mark me ! [|mark me ! [mark |me ! : ___________ ___________ ___________ : query: query: me

** Working with multiple-cursors.el

phi-search is available even when multiple-cursors-mode is active. Here are some examples.

: |foo bar baz |foo bar baz foo bar |baz : |foo bar baz |foo bar baz foo bar |baz : ____________ ____________ ____________ : query: query: baz

: [|mark us ! [|mark us ! [mark |us ! : [|mark us with a region ! [|mark us with a region ! [mark |us with a region ! : _________________________ _________________________ _________________________ : query: query: us

: [foo| ABC foo |foo ABC foo foo ABC |foo : [bar| EFGHIJK bar |bar EFGHIJK bar bar EFGHIJK |bar : _________________ ________________ ________________ : query: foo query: foo

** phi-replace.el

"phi-replace" and "phi-replace-query" in "phi-replace.el" are interactive replace commands, that use the same interface as "phi-search".

[[img/replace.gif]]

To use these commands, require

: (require 'phi-replace)

and bind a key.

: (global-set-key (kbd "M-%") 'phi-replace-query)

Keybinds are basically the same as phi-search, by default.

** Customization *** Keybinds

You may change keybindings by changing "phi-search-default-map".

: (define-key phi-search-default-map (kbd "<") 'phi-search-again-or-previous) : (define-key phi-search-default-map (kbd ">") 'phi-search-again-or-next)

This will affect all commands based on phi-search. If you want to add commands only for a specific command, you may use variables below.

  • phi-search-default-map :: the phi-search common keymap

  • phi-search-additional-keybinds :: list of (KEY . COMMAND) used in "phi-search(-backward)" command

  • phi-replace-additional-keybinds :: list of (KEY . COMMAND) used in "phi-replace(-query)" command

: (push '((kbd "") . 'phi-search-complete-at-beginning) : phi-search-additional-keybinds)

*** Searching

You may change limit of search by setting "phi-search-limit", and case-sensitivity by "phi-search(replace)-case-sensitive".

: (setq phi-search-limit 10000 : phi-search-case-sensitive t)

You may also set "phi-search-case-sensitive" to 'guess, to make phi-search case sensitive only when some upcase letters are in the query.

*** Hooks

Hooks "phi-search-init-hook" and "phi-replace-init-hook" are hooks run after initializing the minibuffer.

*** Faces

Matching items are propertized with "phi-search-match-face", and the selected item is propertized with "phi-search-selection-face". If they look not pretty in your colorscheme, you may modify them.

: (set-face-attribute 'phi-search-selection-face nil : :background "orange")

** Notes

This command uses "multiple-cursors" variables and behavior that are not documented. Therefore, after you update "multiple-cursors", it is good idea to test if this command works still correctly, before you actually use this command.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].