List match lines to another buffer, which is able to squeeze by any words you input. At the same time, the original buffer's cursor is jumping line to line according to moving up and down the line list.
- Culling all lines in buffer with your input
- Highlight multiple matched pattern
- Jumping line to line according to list buffer's move
- Cache result until modifies the buffer
- Go back to the last line
- Multi separated line culling
- Culling lines are editable
Now helm-swoop has several ways.
M-x helm-swoopwhen region active
M-x helm-swoopwhen the cursor is at any symbol
M-x helm-swoopwhen the cursor is not at any symbol
M-3 M-x helm-swoopor
C-u 5 M-x helm-swoopmulti separated line culling
M-x helm-multi-swoopmulti-occur like feature
M-x helm-multi-swoop-allapply all buffers
C-u M-x helm-multi-swoopapply last selected buffers from the second time
M-x helm-multi-swoop-orgapply to all org-mode buffers
M-x helm-multi-swoop-current-modeapply to all buffers with the same major-mode as the current buffer
M-x helm-multi-swoop-projectileApply to all opened buffers of the current project
M-x helm-swoop-same-face-at-pointlist lines have the same face at the cursor is on
- During isearch
M-ito hand the word over to helm-swoop
- During helm-swoop
M-ito hand the word over to helm-multi-swoop-all
- While doing
C-c C-eto edit mode, apply changes to original buffer by
It's able to use words within a region or a word at symbol as search query when it called. Also use a keybind you set just type like M-i instead of
C-c C-e to enter the edit mode.
Before enter the edit mode, you can choose some lines marked by
M-SPC to edit.
Apply changes to original buffer type
Across multiple buffers
- Select any buffers by [C-SPC] or [M-SPC]
- Press [RET] to start helm-multi-swoop
Skip select phase and apply all buffers.
C-u M-x helm-multi-swoop
Skip select phase and apply last selected buffers, if you have done helm-multi-swoop before.
Skip the select phase and apply to all org-mode buffers
Skip the select phase and apply to all buffers with the same major mode as the current buffer
Skip the select phase and apply to all opened buffers of the current project.
It requires projectile to be installed.
You may specify a filter that will be used for buffers
by setting variable
By default its value is
M-4 M-x helm-swoop or
C-u 4 M-x helm-swoop
;; helm from https://github.com/emacs-helm/helm (require 'helm) ;; Locate the helm-swoop folder to your path (add-to-list 'load-path "~/.emacs.d/elisp/helm-swoop") (require 'helm-swoop) ;; Change the keybinds to whatever you like :) (global-set-key (kbd "M-i") 'helm-swoop) (global-set-key (kbd "M-I") 'helm-swoop-back-to-last-point) (global-set-key (kbd "C-c M-i") 'helm-multi-swoop) (global-set-key (kbd "C-x M-i") 'helm-multi-swoop-all) ;; When doing isearch, hand the word over to helm-swoop (define-key isearch-mode-map (kbd "M-i") 'helm-swoop-from-isearch) ;; From helm-swoop to helm-multi-swoop-all (define-key helm-swoop-map (kbd "M-i") 'helm-multi-swoop-all-from-helm-swoop) ;; When doing evil-search, hand the word over to helm-swoop ;; (define-key evil-motion-state-map (kbd "M-i") 'helm-swoop-from-evil-search) ;; Instead of helm-multi-swoop-all, you can also use helm-multi-swoop-current-mode (define-key helm-swoop-map (kbd "M-m") 'helm-multi-swoop-current-mode-from-helm-swoop) ;; Move up and down like isearch (define-key helm-swoop-map (kbd "C-r") 'helm-previous-line) (define-key helm-swoop-map (kbd "C-s") 'helm-next-line) (define-key helm-multi-swoop-map (kbd "C-r") 'helm-previous-line) (define-key helm-multi-swoop-map (kbd "C-s") 'helm-next-line) ;; Save buffer when helm-multi-swoop-edit complete (setq helm-multi-swoop-edit-save t) ;; If this value is t, split window inside the current window (setq helm-swoop-split-with-multiple-windows nil) ;; Split direcion. 'split-window-vertically or 'split-window-horizontally (setq helm-swoop-split-direction 'split-window-vertically) ;; If nil, you can slightly boost invoke speed in exchange for text color (setq helm-swoop-speed-or-color nil) ;; ;; Go to the opposite side of line from the end or beginning of line (setq helm-swoop-move-to-line-cycle t) ;; Optional face for line numbers ;; Face name is `helm-swoop-line-number-face` (setq helm-swoop-use-line-number-face t) ;; If you prefer fuzzy matching (setq helm-swoop-use-fuzzy-match t) ;; If you would like to use migemo, enable helm's migemo feature (helm-migemo-mode 1)
Configure pre-input search query
By default, helm-swoop uses search query at the cursor.
You can configure this behavior by setting
helm-swoop-pre-input-function on your own.
;; Use search query at the cursor (default) (setq helm-swoop-pre-input-function (lambda () (thing-at-point 'symbol))) ;; Disable pre-input (setq helm-swoop-pre-input-function (lambda () "")) ;; Or, just use M-x helm-swoop-without-pre-input ;; Match only for symbol (setq helm-swoop-pre-input-function (lambda () (format "\\_<%s\\_> " (thing-at-point 'symbol)))) ;; Always use the previous search for helm. Remember C-<backspace> will delete entire line (setq helm-swoop-pre-input-function (lambda () (if (boundp 'helm-swoop-pattern) helm-swoop-pattern ""))) ;; If there is no symbol at the cursor, use the last used words instead. (setq helm-swoop-pre-input-function (lambda () (let (($pre-input (thing-at-point 'symbol))) (if (eq (length $pre-input) 0) helm-swoop-pattern ;; this variable keeps the last used words $pre-input)))) ;; If a symbol or phrase is selected, use it as the initial query. (setq helm-swoop-pre-input-function (lambda () (if mark-active (buffer-substring-no-properties (mark) (point)) "")))
We welcome PR!
Require tools for testing
install via brew
brew install cask
cd ~/ hub clone cask/cask export PATH="$HOME/.cask/bin:$PATH"