correct errors in README
This commit is contained in:
parent
0ba8f4ba74
commit
482d4145c5
95
README.org
95
README.org
|
@ -12,7 +12,6 @@
|
||||||
- [[#configuration-file-example][Configuration file example]]
|
- [[#configuration-file-example][Configuration file example]]
|
||||||
|
|
||||||
* Introduction
|
* Introduction
|
||||||
|
|
||||||
Window numbers for Emacs: Navigate your windows and frames using numbers !
|
Window numbers for Emacs: Navigate your windows and frames using numbers !
|
||||||
|
|
||||||
This package is an extended and actively maintained version of the
|
This package is an extended and actively maintained version of the
|
||||||
|
@ -22,9 +21,7 @@ with some ideas and code taken from https://github.com/abo-abo/ace-window.
|
||||||
This version brings, among other things, support for number sets across multiple
|
This version brings, among other things, support for number sets across multiple
|
||||||
frames, giving the user a smoother experience of multi-screen Emacs.
|
frames, giving the user a smoother experience of multi-screen Emacs.
|
||||||
|
|
||||||
|
|
||||||
* Installation
|
* Installation
|
||||||
|
|
||||||
- Clone the repo:
|
- Clone the repo:
|
||||||
|
|
||||||
#+BEGIN_SRC shell
|
#+BEGIN_SRC shell
|
||||||
|
@ -42,9 +39,7 @@ frames, giving the user a smoother experience of multi-screen Emacs.
|
||||||
(winum-mode)
|
(winum-mode)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
* How to use
|
* How to use
|
||||||
|
|
||||||
| Key binding | Description |
|
| Key binding | Description |
|
||||||
|-------------+---------------------------------------------------------------------------------------------|
|
|-------------+---------------------------------------------------------------------------------------------|
|
||||||
| ~C-x w <n>~ | select window <n>, where <n> ranges from 0 to 9. A negative argument deletes the window. |
|
| ~C-x w <n>~ | select window <n>, where <n> ranges from 0 to 9. A negative argument deletes the window. |
|
||||||
|
@ -76,49 +71,50 @@ frames, giving the user a smoother experience of multi-screen Emacs.
|
||||||
- If no prefix argument ig given, a number is read from minibuffer. A negative
|
- If no prefix argument ig given, a number is read from minibuffer. A negative
|
||||||
input will delete the window instead of selecting it.
|
input will delete the window instead of selecting it.
|
||||||
|
|
||||||
|
|
||||||
* Configuration
|
* Configuration
|
||||||
|
|
||||||
** Keybindings
|
** Keybindings
|
||||||
|
|
||||||
By default, all key bindings are prefixed with a value stored in
|
By default, all key bindings are prefixed with a value stored in
|
||||||
=winum-keymap-prefix=, by default ~C-x w~. See [[Customize options][Customize options]].
|
=winum-keymap-prefix=, by default ~C-x w~. See [[Customize options][Customize options]].
|
||||||
|
|
||||||
The default prefix is ~C-x w~ for compatibility with common Emacs bindings. If
|
The default prefix is ~C-x w~ for compatibility with native Emacs bindings.
|
||||||
you prefer no to use a prefix and have shorter key bindings, you can also
|
However, it gives long key bindings and can be incomfortable to use.
|
||||||
override =winum-keymap= before activating =winum-mode=:
|
|
||||||
|
For instance, you can replace the native prefix with ~C-c~ or ~M-m~.
|
||||||
|
|
||||||
|
If you prefer no to use a prefix to have even shorter bindings, you can also
|
||||||
|
directly override =winum-keymap=:
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(require 'winum)
|
(require 'winum)
|
||||||
|
|
||||||
(setq winum-keymap
|
(setcdr (assoc 'winum-mode minor-mode-map-alist)
|
||||||
(let ((map (make-sparse-keymap)))
|
(let ((map (make-sparse-keymap)))
|
||||||
(define-key map (kbd "C-`") 'winum-select-window-by-number)
|
(define-key map (kbd "C-`") 'winum-select-window-by-number)
|
||||||
(define-key map (kbd "M-0") 'winum-select-window-0-or-10)
|
(define-key map (kbd "M-0") 'winum-select-window-0-or-10)
|
||||||
(define-key map (kbd "M-1") 'winum-select-window-1)
|
(define-key map (kbd "M-1") 'winum-select-window-1)
|
||||||
(define-key map (kbd "M-2") 'winum-select-window-2)
|
(define-key map (kbd "M-2") 'winum-select-window-2)
|
||||||
(define-key map (kbd "M-3") 'winum-select-window-3)
|
(define-key map (kbd "M-3") 'winum-select-window-3)
|
||||||
(define-key map (kbd "M-4") 'winum-select-window-4)
|
(define-key map (kbd "M-4") 'winum-select-window-4)
|
||||||
(define-key map (kbd "M-5") 'winum-select-window-5)
|
(define-key map (kbd "M-5") 'winum-select-window-5)
|
||||||
(define-key map (kbd "M-6") 'winum-select-window-6)
|
(define-key map (kbd "M-6") 'winum-select-window-6)
|
||||||
(define-key map (kbd "M-7") 'winum-select-window-7)
|
(define-key map (kbd "M-7") 'winum-select-window-7)
|
||||||
(define-key map (kbd "M-8") 'winum-select-window-8)
|
(define-key map (kbd "M-8") 'winum-select-window-8)
|
||||||
map))
|
map))
|
||||||
|
|
||||||
(winum-mode)
|
(winum-mode)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Customize options
|
This is a little bit hacky but is less code than using =define-key=, and will
|
||||||
|
also shadow the old bindings.
|
||||||
|
|
||||||
|
**NB:** the ~`~ key is convenient on qwerty keyboards, however if you are using
|
||||||
|
a different keyboard you should replace it with the key beside ~1~.
|
||||||
|
For instance, ~²~ on an azerty keyboard.
|
||||||
|
|
||||||
|
** Customize options
|
||||||
Several options are available through Emacs' Customize interface under
|
Several options are available through Emacs' Customize interface under
|
||||||
=convenience= > =winum=:
|
=convenience= > =winum=:
|
||||||
|
|
||||||
- =winum-keymap-prefix=
|
|
||||||
|
|
||||||
Prefix key sequence for keybindings.
|
|
||||||
|
|
||||||
Default: (kbd "C-x w")
|
|
||||||
|
|
||||||
- =winum-scope=
|
- =winum-scope=
|
||||||
|
|
||||||
Frames affected by a number set. Choices are ='frame-local= ='visible= or
|
Frames affected by a number set. Choices are ='frame-local= ='visible= or
|
||||||
|
@ -182,12 +178,17 @@ Several options are available through Emacs' Customize interface under
|
||||||
|
|
||||||
Default: '(" *which-key*")
|
Default: '(" *which-key*")
|
||||||
|
|
||||||
|
- =winum-keymap-prefix=
|
||||||
|
|
||||||
|
Prefix key sequence for keybindings.
|
||||||
|
|
||||||
|
Default: (kbd "C-x w")
|
||||||
|
|
||||||
- face: =winum-face=
|
- face: =winum-face=
|
||||||
|
|
||||||
Face used for the number in the mode-line.
|
Face used for the number in the mode-line.
|
||||||
|
|
||||||
** Configuration file example
|
** Configuration file example
|
||||||
|
|
||||||
Here is an example that you could put in your =.emacs=, which includes all
|
Here is an example that you could put in your =.emacs=, which includes all
|
||||||
available winum options.
|
available winum options.
|
||||||
|
|
||||||
|
@ -196,6 +197,20 @@ available winum options.
|
||||||
|
|
||||||
(require 'winum)
|
(require 'winum)
|
||||||
|
|
||||||
|
(setcdr (assoc 'winum-mode minor-mode-map-alist)
|
||||||
|
(let ((map (make-sparse-keymap)))
|
||||||
|
(define-key map (kbd "C-`") 'winum-select-window-by-number)
|
||||||
|
(define-key map (kbd "M-0") 'winum-select-window-0-or-10)
|
||||||
|
(define-key map (kbd "M-1") 'winum-select-window-1)
|
||||||
|
(define-key map (kbd "M-2") 'winum-select-window-2)
|
||||||
|
(define-key map (kbd "M-3") 'winum-select-window-3)
|
||||||
|
(define-key map (kbd "M-4") 'winum-select-window-4)
|
||||||
|
(define-key map (kbd "M-5") 'winum-select-window-5)
|
||||||
|
(define-key map (kbd "M-6") 'winum-select-window-6)
|
||||||
|
(define-key map (kbd "M-7") 'winum-select-window-7)
|
||||||
|
(define-key map (kbd "M-8") 'winum-select-window-8)
|
||||||
|
map))
|
||||||
|
|
||||||
(defun my-winum-assign-func ()
|
(defun my-winum-assign-func ()
|
||||||
(cond
|
(cond
|
||||||
((equal (buffer-name) "*Calculator*")
|
((equal (buffer-name) "*Calculator*")
|
||||||
|
@ -205,7 +220,7 @@ available winum options.
|
||||||
(t
|
(t
|
||||||
nil)))
|
nil)))
|
||||||
|
|
||||||
(set-face-property 'winum-face :weight 'bold)
|
(set-face-attribute 'winum-face nil :weight 'bold)
|
||||||
|
|
||||||
(setq window-numbering-scope 'global
|
(setq window-numbering-scope 'global
|
||||||
winum-reverse-frame-list nil
|
winum-reverse-frame-list nil
|
||||||
|
@ -214,19 +229,7 @@ available winum options.
|
||||||
winum-auto-setup-mode-line t
|
winum-auto-setup-mode-line t
|
||||||
winum-mode-line-position 1
|
winum-mode-line-position 1
|
||||||
winum-ignored-buffers '(" *which-key*")
|
winum-ignored-buffers '(" *which-key*")
|
||||||
winum-keymap (let ((map (make-sparse-keymap)))
|
winum-keymap-prefix nil)
|
||||||
(define-key map (kbd "C-`") 'select-window-by-number)
|
|
||||||
(define-key map (kbd "M-0") 'select-window-0-or-10)
|
|
||||||
(define-key map (kbd "M-1") 'select-window-1)
|
|
||||||
(define-key map (kbd "M-2") 'select-window-2)
|
|
||||||
(define-key map (kbd "M-3") 'select-window-3)
|
|
||||||
(define-key map (kbd "M-4") 'select-window-4)
|
|
||||||
(define-key map (kbd "M-5") 'select-window-5)
|
|
||||||
(define-key map (kbd "M-6") 'select-window-6)
|
|
||||||
(define-key map (kbd "M-7") 'select-window-7)
|
|
||||||
(define-key map (kbd "M-8") 'select-window-8)
|
|
||||||
(define-key map (kbd "M-9") 'select-window-9)
|
|
||||||
map))
|
|
||||||
|
|
||||||
(winum-mode)
|
(winum-mode)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
Loading…
Reference in a new issue