one-key

Homepage: http://www.emacswiki.org/emacs/download/one-key.el

Author: Andy Stewart, rubikitch

Updated:

Summary

Easy access configurable popup menus to display keybindings and other things

Commentary

Bitcoin donations gratefully accepted: 1HnSqGHrVenb1t2V2aijyocWyZcd7qt1k

With so many Emacs extensions, you have a lot of keystrokes to remember, and you probably forget most of them.

This package fixes that problem, and helps new users to learn the common keybindings.

One Key provides a single keystroke that when pressed presents you with a menu of choices in a popup window
for commands to execute with a further keystroke. By default menus for common prefix keys and commands are defined.

Just type one of the listed keystrokes to execute the corresponding command.

You can delete, edit, sort, highlight and filter the menu items, add new menu items and even add new menus.
You can have access to several different menus from the same window which can be navigated with the arrow keys.
Such a collection of menus is called a menu set and you can define several different menu sets containing different
types of menus.
Several different types of menus are defined (and more may be added) for holding different types of menu items.
For example the "major-mode" type opens the menu corresponding to the current major-mode.
More different types are defined by one-key extension libraries (e.g. `one-key-dir' for fast directory
tree navigation), or you can create your own types. See "Creating menus" below.

The *One-Key* buffer:

Running the command `one-key-open-associated-menu-set' or `one-key-open-menu-set' opens the *One-Key* buffer.
(these commands may be bound to keys - see "Installation" below).

Within the *One-Key* buffer you will see a list of command descriptions each with a corresponding key in square
brackets to its left. Pressing the key executes the command.
Along the top of the buffer in the header line you will see a list of menu names. One of these names will be
highlighted and indicates the current menu. You can navigate between the different menus by pressing the left/right
arrow keys (unless these have been redefined to other keys in `one-key-special-keybindings', see below).

You can toggle the size of the window holding the *One-Key* buffer by pressing the appropriate special key (see below).
The window size is toggled between default size, large size (so that all items fit in the window), and hidden (window
is closed, but one-key is still active). This is useful if there are a large number of items in the menu, or when you
need to see part of the buffer that is obscured by the *One-Key* window.

By default one-key will quit and the *One-Key* window will close after pressing a key corresponding to one of the
menu items. If you want one-key to stay active after pressing an item key you should toggle the menu persistence
by pressing the appropriate special key (C-menu by default, see "Special keybindings" below).
To quit one-key and close the *One-Key* window press ESC. If you want to quit but keep the window open (e.g. to see
the keybindings for a major mode), press C-ESC.

Special keybindings:

For each different type of menu certain "special" keybindings are defined which activate menu specific commands,
such as sorting or editing the menu items, adding new menus, etc.
These special keybindings are specific to each menu type, though many of them will be the same for all menu types.
For example the arrow keys are defined as special keybindings for navigating around menus.

Pressing the f1 key displays a help message listing all the special keybindings for the current menu.

By default, when a menu is created one-key will ensure that the keys corresponding to menu items do not clash with
the special keybindings for that menu type. However, if for some reason there is a clash then the menu item gets
priority over the special keybinding unless the help window is displayed (by pressing f1), in which case the special
keybinding gets priority.

You can alter or add new special keybindings by customizing `one-key-special-keybindings',
and `one-key-default-special-keybindings'.
Extension libraries (such as `one-key-dir' or `one-key-regs') may also define customizable special keys specific
to the menu type defined in the library.

By default the following special keybindings are defined:

ESC        : Quit and close menu window                       
 : Quit, but keep menu window open                  
   : Toggle menu persistence                          
     : Toggle menu display                              
     : Change to next menu                              
    : Change to previous menu                          
       : Scroll/move up one line                          
     : Scroll/move down one line                        
    : Scroll menu down one page                        
     : Scroll menu up one page                          
C-h        : Show help for next item chosen                   
C-s        : Save current state of menu                       
       : Toggle this help buffer                          
       : Toggle column/row ordering of items              
       : Sort items by next method
     : Sort items by previous method          
       : Reverse order of items                 
/          : Limit items to those matching regexp   
C-/        : Highlight items matching regexp        
       : Edit a menu item                       
       : Delete a menu item                     
       : Copy/kill coloured items               
     : Yank copied items                      
       : Swap menu item keys                    
       : Add a menu item                        
     : Add a menu                             
   : Remove this menu                       
      : Reposition item (with arrow keys)      
      : Donate to support further development  
    : Report a bug                           

Creating menus:

All of the menus are stored in the file `one-key-menus-save-file' (customizable), but you should never need to
edit this file. Instead you can create and edit menus from within the *One-Key* buffer.
If you press the special key corresponding to "Add a menu" you will be prompted for the type of menu to add.
By default the following menu types are defined, but more may be added with extension libraries, or by creating
them yourself (see `one-key-menu-types-alist'):

Default menu types:

top-level         : contains items defined in `one-key-menu-toplevel-alist', which by default contains common prefix key
                    menus, and menus for common commands to help new users learn emacs
blank menu        : creates a blank menu with no items
major-mode        : contains items corresponding to the current major mode (keybindings and menu-bar items)
existing menu     : prompts for an existing menu to use
existing keymap   : contains items in a given keymap (prompted for)
prefix key keymap : contains items whose usual keybindings begin with a given prefix key (prompted for)
menu-sets         : contains items for opening menu sets (see below)

Saving menus:

If `one-key-autosave-menus' is non-nil then any new menus or menus that have been changed will be saved
on Emacs exit, unless they are listed in `one-key-exclude-from-save'
Alternatively you may save individual menus by pressing the special key for "Save the current state of menu"
(C-s by default).

Dependencies

Reverse dependencies