Skip to content

kostafey/popup-switcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 

Repository files navigation

License GPL 2 MELPA

popup-switcher

popup-switcher provides (yet another) convenient way to switch buffers, navigation possibility through functions/methods and any other kind of switching you like. It's easy to use and extend for custom purposes. It uses popup lib for better sense.

Installation

Add MELPA (if not yet) to your package-archives list:

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "http://melpa.milkbox.net/packages/"))
(package-initialize)

Then you can install popup-switcher with the following command:

M-x package-install [RET] popup-switcher [RET]

Load popup-switcher:

(require 'popup-switcher)

Configuration

Keybindings

Add a hotkey to psw-switch-<X> to you taste (for the full list of predefined switching functions see Usage section), e.g.:

(global-set-key [f2] 'psw-switch-buffer)

Functions/methods navigation

Uses imenu to navigate through functions/methods names via psw-switch-function.

(global-set-key [f3] 'psw-switch-function)

Maximum number of visible items

Set maximum number of visible items in popup menus

(setq psw-popup-menu-max-length 15)

Menu position

Menu opens centered with respect to fill-column by default. Set psw-popup-position variable to change horizontal positioning.

Possible values are:

  • fill-column - center relative to fill-column (default setting)
  • center - center relative to window borders
  • point - open popup at point
(setq psw-popup-position 'center)

Fuzzy matching

Non-nil psw-use-flx enables flx fuzzy matching engine for isearch in popup menus. flx-ido is required in this case, it can be installed by your favorite approach. E.g. by MEPLA: M-x package-install [RET] flx-ido [RET]

(setq psw-use-flx t)

Modified buffers marker

Non-nil psw-mark-modified-buffers means mark modified buffers with star char (*) expect special beffers like *Messages* any time you call psw-switch-buffer.

Enter to dired-mode via psw-navigate-files

(setq psw-enable-single-dot-to-navigate-files t)

Any time you run psw-navigate-files fn you can select dot . item, which opens dired-mode for current directory.

Highlight previous buffer for psw-switch-buffer

If you want to highlight previous buffer for psw-switch-buffer fn set psw-highlight-previous-buffer to t:

(setq psw-highlight-previous-buffer t)

Usage

List of interactive functions:

Command Description
psw-switch-buffer switch buffers through popup menu
psw-switch-recentf switch recent files
psw-navigate-files simple file navigator
psw-switch-function switch (navigate) through functions in the current buffer (optional)
psw-switch-projectile-files switch among projectile project files list (optional)
psw-switch-projectile-projects switch among projectile projects list and it's files (optional)

Run M-x psw-switch-buffer [RET] (or your selected key). Type some letters from the name of buffer of interest (since isearch is enabled on start) to filter buffers list, use arrow keys and [RET] or mouse to select buffer.

When you are in menu created by psw-switch-buffer, you can kill selected buffer by pressing C-d or C-k.

Screenshots

Switch buffer (psw-switch-buffer)

Switch function (psw-switch-function)

Fuzzy matching for switch function

File navigator (psw-navigate-files)

Requirements:

License

Copyright © 2013-2020 Kostafey kostafey@gmail.com and contributors

Distributed under the General Public License 2.0+

About

Switch to other buffers, files and functions in emacs via popup

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6