The following tables summarizes the key bindings found in Psimacs. The key bindings of original Emacs are mostly unaltered. The most useful and important bindings are also listed below. In order to get proficient, it is important to learn about the help system that let you discover commands and bindings.
I am trying to setup keybinding in a mnemonics way so it’s easy to remember (and use). I am staying with the standard emacs keybinding as much as possible.
Emacs’s keybindings has well-defined conventions listed at Emacs Key Bindings Convention. In summary, the general rules are:
C-x
reserved for Emacs native essential keybindings: buffer, window, frame, file, directory, etc.F5
…F9
without modifier keys are reserved for users to define.C-c
C-c C-letter
,C-c digit
are reserved for major modes.C-c punctuation
with punctuation in { } < > : ; are also reserved for major modes.C-c punctuation
with any other punctuation are allocated for minor modes.C-c letter
are reserved for users. In practice most third-party packages don’t give a hoot and will gladly stuff their own key binds in there.
- Don’t rebind
C-g
,C-h
andESC
. <hyper>
and<super>
are two prefix keys reserved to you. They are remnants from ancient keyboards used in the 80s, but live on today in Emacs. Most PC-compatible keyboards won’t have a<super>
or<hyper>
key so we rebind the<lwindow>
and<rwindow>
Windows keys and the<apps>
Application Context key to be the<super>
and<hyper>
prefix keys instead.
Psimacs uses the <super>
and <hyper>
key prefixes for all of its own key bindings.
Key | Mnemonic | Keyboard |
---|---|---|
<hyper> | H- | <Menu> or <Prnt-Scrn> in case of Lenovo notebook. |
<super> | s- | <Left-Window> and <Right-Window> |
<meta> | M- | <Alt> |
<ctrl> | C- | <Strg> |
Worth readings about Emacs keybindings:
- UOMF: My Emacs Key Binding Strategy
- Mastering Key Bindings in Emacs
- Keyboard Usage on MS-Windows
- The Emacs Guru Guide to Key Bindings
- Emacs: How to Bind Super Hyper Keys
I remap the Left-Ctrl
to the Capslock
key and the original Capslock
key to the Prnt Scrn
key.
This way I lose the original Prnt Scrn
functionality, but I don’t bother. The reason that I do not simply
exchange the Left-Ctrl
and Capslock
keys is that after years I’m used to the Left-Ctrl
key and I still
press this key often automatically. This however, is disruptive when I have changed the meaning of the Left-Ctrl
key. So basically, now I have two Left-Ctrl
keys and no Prnt Scrn
:-).
In case of a minimal Lenovo ThinkPad keyboad that does not have a <Menu>
, i.e. <Hyper>
key, but that have
the <Prnt-Scrn>
key positioned between the <Alt Gr>
and the <Right-Ctrl>
keys the following layout is used by me.
In this layout, the <Left-Ctrl>
key is mapped to the <Capslock>
key and the <Menu>
, i.e. <Hyper>
key is mapped
to the <Prnt-Scrn>
key.
Attention: This remapping is not performed automatically, but must be performed explicitely by the user as described
in the init.html
documentation file.
The major help commands and their key bindings.
Key binding | Command | Description |
---|---|---|
C-h ? C-h C-h | M-x help-for-help | Help command. |
C-h t | M-x help-with-tutorial | Select the Emacs learn-by-doing tutorial. |
C-h C-s | M-x search-forward-help-for-help | Search forward in the help-for-help window. |
C-h C-a | M-x about-emacs | Display the **About GNU Emacs** buffer. |
C-h C-q | M-x help-quick-toggle | Toggle display of a window showing popular commands and their bindings. |
H-h | Help prefix, giving fast access to the help functions. | |
H-SPC h | M-x psimacs/hydra/help/body | Hydra Help… |
H-SPC H | M-x psimacs/hydra/helpful/body | Hydra Helpful… |
C-h e | M-x view-echo-area-messages | View the log of recent echo-area messages: the **Messages** buffer. |
C-h b | M-x counsel-descbinds | Show a list of all defined key bindings and their definitions. |
C-h c | M-x describe-key-briefly | Print the name of the function called by key binding. |
C-h k | M-x describe-key | Display documentation of the function invoked by key binding. |
H-h H-h b | M-x helm-descbinds | Create a listing of all key bindings of current major mode. |
C-h w | M-x where-is | Print message listing key sequences that invoke the command DEFINITION. |
C-h f | M-x counsel-describe-function | Describe a function in detail incl. key binding and source code. Replacement of M-x describe-function . |
C-h x | M-x describe-command | Only describes commands, and not functions like its sibling below. |
C-h F | M-x Info-goto-emacs-command-node | Go to the Info node in the Emacs manual for a command. |
C-h a | M-x apropos-command | List only the commands. |
C-h v | M-x counsel-describe-variable | Display the full documentation of variable. Replacement of M-x describe-variable . |
C-h j | M-x counsel-set-variable | Allows the setting of variable values. |
C-h m | M-x describe-mode | Display documentation of current major mode and minor modes. |
H-h H-h m | M-x helm-describe-modes | Create a listing of all modes of current major mode. |
H-h C-d m | M-x discover-my-major | Create a listing of all major-mode keys with their description. |
H-h C-d M | M-x discover-my-mode | Create a listing of all MODE keys with their description. |
C-h l | M-x counsel-find-library | Visit a selected library elisp code. |
C-h s | M-x describe-syntax | Describe the syntax specifications in the syntax table of BUFFER. |
C-h P | M-x describe-package | Display the full documentation of a package. |
C-h p | M-x finder-by-keyword | Find packages matching a given keyworkd. |
M-x info | Enter Info the documentation browser. | |
C-h r | M-x info-manual | Display a manual in Info mode - by default, the Emacs manual. |
C-x R | M-x info-display-manual | Display an Info buffer displaying MANUAL. |
C-h i | M-x counsel-info-lookup-symbol | Open info reader and lookup a symbol. |
C-h o | M-x counsel-describe-symbol | Display the full documentation of symbol. |
M-x apropos | This command will display all symbols that match a given pattern. | |
C-x c a | M-x helm-apropos | Helm to describe commands, function, variables and faces. |
C-h d | M-x apropos-documentation | Searches just the documentation. |
M-x apropos-library | Lists all variables and functions defined in a library. | |
M-x apropos-user-option | Shows user options available through the Customize interface. | |
M-x apropos-value | Searches ll symbols with a particular value. | |
M-x info-apropos | Search indexes of known Info files on your system for apropos PATTERN. | |
M-x counsel-describe-face | Display the properties of face FACE on FRAME. | |
C-h C | M-x describe-coding-system | Display information about CODING-SYSTEM. |
C-h I | M-x describe-input-method | Describe input method. |
C-h L | M-x describe-language-environment | Describe how Emacs supports language environment. |
C-h u | M-x counsel-unicode-char | Insert COUNT copies of a Unicode character at point. |
H-<f1> | M-x (lambda() (interactive) (browse-url psimacs/config/keybindings-html-file))) | Open Psimacs keybindings as Html in default browser. |
H-<f2> | M-x (lambda() (interactive) (browse-url psimacs/config/init-html-file))) | Open Psimacs configuration as Html in default browser. |
H-S-<f1> | M-x (lambda() (interactive) (eww-open-file psimacs/config/keybindings-html-file))) | Open Psimacs keybindings as Html in eww . |
H-S-<f2> | M-x (lambda() (interactive) (eww-open-file psimacs/config/init-html-file))) | Open Psimacs configuration as Html in eww . |
Prefix command | Description |
---|---|
H-SPC | Hydras |
H-h | Help |
H-c | common user commands |
H-x | common execution commands |
H-m | special user commands |
All the hydras defined by Psimacs.
Key binding | Command | Description |
---|---|---|
H-SPC H-SPC | M-x psimacs/hydra/hydra/body | Hydras… |
H-SPC SPC | M-x psimacs/hydra/toggle/body | Toggles… |
H-SPC a | M-x psimacs/hydra/apropos/body | Apropos… |
H-SPC d | M-x dap-hydra | DAP-Mode hydra… |
H-SPC e | M-x psimacs/hydra/else/body | ELSE mode hydra… |
H-SPC h | M-x psimacs/hydra/help/body | Help… |
H-SPC H | M-x psimacs/hydra/helpful/body | Helpful… |
H-SPC i | M-x hydra-ivy/body | Ivy… |
H-SPC j | M-x psimacs/hydra/jupyter/open-hydra | Jupyter Notebook hydra… |
H-SPC l | M-x psimacs/hydra/lsp/body | LSP Mode hydra… |
H-SPC m | M-x major-mode-hydra | Major Mode’s hydra… |
H-SPC p | M-x psimacs/hydra/projectile/body | Projectile… |
H-SPC t | M-x psimacs/hydra/avy/body | Fast Jumping in Text… |
H-SPC T | M-x psimacs/hydra/transpose/body | Transposing… |
H-SPC w | M-x psimacs/hydra/window/body | Window… |
H-SPC y | M-x psimacs/hydra/yasnippet/body | YASnippet… |
H-SPC C-c | M-x psimacs/hydra/multiple-cursors/body | Multiple Cursors… |
H-SPC C-f | M-x psimacs/hydra/flycheck/body | Flycheck… |
H-SPC C-i | M-x psimacs/hydra/image+/body | Image… |
H-SPC C-l | M-x psimacs/hydra/vlf-large-files/body | Large Files… |
H-SPC C-m | M-x psimacs/hydra/word-modes/body | CamelCase… |
H-SPC C-o | M-x psimacs/hydra/org/body | Org-Mode… |
H-SPC C-p | M-x hydra-projectile-cmake/body | Projectile CMake… |
H-SPC C-r | M-x psimacs/hydra/rectangle/body | Rectangle… |
H-SPC C-s | M-x psimacs/hydra/straight/body | Straight… |
H-SPC H-m | M-x psimacs/hydra/navigation/body | Navigation… |
C-u
or H-u
runs the command universal-argument
.
It is bound to C-u
and H-u
and it begin a numeric argument for the following command.
Digits or minus sign following C-u
make up the numeric argument.
C-u
following the digits or minus sign ends the argument.
C-u
without digits or minus sign provides 4 as argument.
Repeating C-u
without digits or minus sign multiplies the argument by 4 each time.
For some commands, just C-u
by itself serves as a flag that is different in effect from
any particular numeric argument.
Key binding | Command | Description |
---|---|---|
C-u H-u | M-x universal-argument | Begin a numeric argument for the following command. Digits or minus sign following C-u make up the numeric argument. |
C-u H-u | C-u 4 | |
C-u C-u H-u H-u | C-u 16 | |
C-0 M-0 C-M-0 H-0 | C-u 0 | Runs the command digit-argument . |
C-1 M-1 C-M-1 H-1 | C-u 1 | Runs the command digit-argument . |
C-2 M-2 C-M-2 H-2 | C-u 2 | Runs the command digit-argument . |
C-3 M-3 C-M-3 H-3 | C-u 3 | Runs the command digit-argument . |
C-4 M-4 C-M-4 H-4 | C-u 4 | Runs the command digit-argument . |
C-5 M-5 C-M-5 H-5 | C-u 5 | Runs the command digit-argument . |
C-6 M-6 C-M-6 H-6 | C-u 6 | Runs the command digit-argument . |
C-7 M-7 C-M-7 H-7 | C-u 7 | Runs the command digit-argument . |
C-8 M-8 C-M-8 H-8 | C-u 8 | Runs the command digit-argument . |
C-9 M-9 C-M-9 H-9 | C-u 9 | Runs the command digit-argument . |
C-- M-- C-M-- H-- | C-u - | Runs the command negative-argument . |
The table that follows contain the basic movement commands with their corresponding key binding. In case that Psimacs has a differing binding, the Psimacs binding is provided but the standard binding is given in the second column.
References:
Key binding | Standard | Command | Description |
---|---|---|---|
C-f | M-x forward-char | Move point forward by one character. | |
C-b | M-x backward-char | Move point backward by one character. | |
C-n | M-x next-line | Move point forward by one line, keeping horizontal position. | |
C-p | M-x previous-line | Move point backward by one line, keeping horizontal position. | |
<Left> | M-x left-char | Properly respect the right-to-left text. | |
<Rigth> | M-x right-char | Dito. | |
C-a | M-x move-beginning-of-line | Goto the beginning of the line. | |
C-e | M-x move-end-of-line | Goto the end of the line. | |
M-< | M-x beginning-of-buffer | Goto the beginning of the buffer. | |
M-> | M-x end-of-buffer | Goto the end of the buffer. | |
C-<Home> | M-x beginning-of-buffer | Goto the beginning of the buffer. | |
C-<End> | M-x end-of-buffer | Goto the end of the buffer. | |
M-g M-g M-g g | M-x goto-line | Goto line number N | |
M-g <Tab> | M-x move-to-column | Move point to column number N | |
M-f | M-x forward-word | Move point forward by one word. | |
M-b | M-x backward-word | Move point backward by one word. | |
M-{ | M-x forward-paragraph | Move point forward by one paragraph. | |
M-} | M-x backward-paragraph | Move point backward by one paragrah. | |
C-<Down> | M-x forward-paragraph | Move point forward by one paragraph. | |
C-<Up> | M-x backward-paragraph | Move point backward by one paragrah. | |
C-M-f | M-x forward-sexp | Move point forward across one balanced expression. | |
C-M-b | M-x backward-sexp | Move point backward across one balanced expression. | |
M-e | M-x forward-sentence | Move point forward by one sentence. | |
M-a | M-x backward-sentence | Move point backward by one sentence. | |
C-v | M-x scroll-up-command | Move the window to the next page. Disable cua-mode for that by pressing <f12> in Psimacs. | |
M-v | M-x scroll-down-command | Move the window to the previous page. | |
<PageDown> | M-x scroll-up-command | Move the window to the next page. Disable cua-mode for that by pressing <f12> in Psimacs. | |
<PageUp> | M-x scroll-down-command | Move the window to the previous page. | |
C-l | M-x recenter-top-bottom | Center line of point to the middle of the buffer window. Pressing it repeatedly cycles throug top, bottom and center. | |
C-M-l | M-x reposition-window | Attempt to scroll the screen to fit as much as possible in the window. | |
H-m C-s s | C-s | M-x isearch-forward | Search term forward and places point after the occurence. |
H-m C-s r | C-r | M-x isearch-backward | Search term backward and places point before the occurence. |
H-s | M-x psimacs/config/isearch-menu | In isearch mode, opens an isearch menu, allowing to easily utilize the functionality. | |
C-s | M-x swiper-isearch | Isearch enhanced by Ivy Swiper. | |
M-m | M-x back-to-indentation | Move point to the first non-whitespace character in the current line. | |
C-x C-n | M-x set-goal-column | Set the current horizontal position as a goal column. | |
C-u C-x C-n | C-u M-x set-goal-column | Cleas out the goal column and resume to normal operation. |
The fundamental selection commands with their corresponding key bindings are listed in the next table.
References:
- Efficient Text Selection with Emacs Key Bindings - Emacs Essentials #3
- Read also GNU Emacs’ Transient Mark mode
Key binding | Command | Description |
---|---|---|
C-SPC | M-x cua-set-mark M-x set-mark-command | Set mark where point is, clear mark, or jump to mark. With no prefix argument, clear mark if already set. Otherwise, mark, and push old mark position on local mark ring; also push mark on global mark ring if last mark was set in another buffer. |
C-@ | ||
C-u C-SPC | M-x pop-to-mark-command | Jump to mark, and pop a new position for mark off the local mark ring (this does not affect the global mark ring). |
C-u C-@ | ||
H-x p | ||
C-x C-SPC | M-x pop-global-mark | Jump to a mark off the global mark ring. |
C-x C-@ | ||
H-x q | ||
C-SPC C-SPC | Jumps to the next position off the local (or global) mark ring. Set the mark, pushing it onto the mark ring, without activating it. | |
C-u C-u C-SPC | Unconditionally set mark. | |
C-x C-x | M-x exchange-point-and-mark | Set mark where point is, and move point to last deactivated mark if any. Transient mark mode modifies the behaviour. |
S-C-f | M-x forward-char S-<Ret> | Set mark where point is, and move point forward by one character, thereby creating a selection. |
S-... | M-x ... S-<Ret> | Set mark where point is, and move point …, thereby creating a selection. Attention, this does not work for all movement command. |
C-w | M-x kill-region | Deletes text in region and copies it to kill ring. |
M-w | M-x kill-ring-save | Copies text in region to the kill ring. |
C-y | M-x yank | Paste the most recently added text to the kill-ring at point. |
M-y | M-x counsel-yank-pop | Replace just-yanked text with former copied or killed text. |
C-x C-u | M-x upcase-region | Convert all charcters in region to upper case. Disable cua-mode for that by pressing <f12> in Psimacs. |
C-x C-l | M-x downcase-region | Convert all charcters in region to lower case. Disable cua-mode for that by pressing <f12> in Psimacs. |
H-x H-x C-x C-u | M-x crux-upcase-region | Convert all charcters in region to upper case when transient-mark-mode is on and region is active. |
H-x H-x C-x C-l | M-x crux-downcase-region | Convert all charcters in region to lower case when transient-mark-mode is on and region is active. |
C-g | M-x psimacs/config/keyboard-quit-dwim | When the region is active, disable it. When a minibuffer is open, but not focused, close the minibuffer. When the Completions buffer is selected, close it. |
M-@ | M-x mark-word | Sets mark at end of next word without moving point. |
C-M-@ | M-x mark-sexp | Sets mark at end of next s-expression without moving point. |
M-h | M-x mark-paragraph | Sets mark at end of next paragraph without moving point. |
C-M-h | M-x mark-defun | Marks the whole defun under point. |
C-x C-p | M-x mark-page | Sets mark at end of page/buffer without moving point, i.e. selecting from point to the end of the page/buffer. |
C-x h | M-x mark-whole-buffer | Move point at the beginning of buffer, sets mark at end of buffer, i.e. selecting the whole buffer. In every other case use the regular `keyboard-quit’.” |
H-x e | M-x er/expand-region | Expand region intelligently. |
Following table with the most important commands and keybindings for working with other windows.
References:
Key binding | Command | Description |
---|---|---|
C-x 4 . | M-x xref-find-definitions-other-window | Like M-. (M-x xref-find-definitions ) but switch to the other window. Find the definition of the identifier at point. |
C-x 4 0 | M-x kill-buffer-and-window | Kill the current buffer and delete the selected window. |
C-x 4 1 | M-x same-window-prefix | Execute command in same window. Display the buffer of the next command in the same window. The next buffer is the buffer displayed by the next command invoked immediately after this command |
C-x 4 4 | M-x other-window-prefix | Execute command in new window. Display the buffer of the next command in a new window. The next buffer is the buffer displayed by the next command invoked immediately after this command |
C-x 4 a | M-x add-change-log-entry-other-window | Find change log file in other window and add entry and item. This is just like add-change-log-entry except that it displays the change log file in another window. |
C-x 4 b | M-x switch-to-buffer-other-window | Switch to another buffer in another window. |
C-x 4 c | M-x clone-indirect-buffer-other-window | Create an indirect buffer that is a twin copy of the current buffer in other window. |
C-x 4 d | M-x dired-other-window | Edit directory DIRNAME (M-x dired ) – delete, rename, print, etc. some files in it, but in other window. |
C-x 4 f | M-x find-file-other-window | Edit file FILENAME, in another window. |
C-x 4 m | M-x compose-mail-other-window | Like C-x m (M-x compose-mail ). Start composing a mail message to send, but edit the outgoing message in another window. |
C-x 4 p | M-x project-other-window-command | Run project command, displaying resultant buffer in another window. |
C-x 4 r | M-x find-file-read-only-other-window | Edit file FILENAME, in another window, but don’t allow changes. |
C-x 4 C-f | M-x find-file-other-window | Edit file FILENAME, in another window. |
C-x 4 C-j | M-x dired-jump-other-window | Jump to Dired buffer, in other window, corresponding to current buffer. If in a buffer visiting a file, Dired that file’s directory and move to that file’s line in the directory listing. |
C-x 4 C-o | M-x display-buffer | Display BUFFER-OR-NAME in some window, without selecting it. |
Following table with the most important commands and keybindings for working with other frames.
References:
Key binding | Command | Description |
---|---|---|
C-x 5 . | M-x xref-find-definitions-other-frame | Like M-. (M-x xref-find-definitions ) but switch to the other frame. Find the definition of the identifier at point. |
C-x 5 0 | M-x delete-frame | Delete FRAME, eliminating it from use. See also undelete-frame-mode . |
C-x 5 1 | M-x delete-other-frame | Delete all frames except FRAME (default: selected frame). |
C-x 5 2 | M-x make-frame-command | Make a new frame, on the same terminal as the selected frame. |
C-x 5 5 | M-x other-frame-prefix | Execute command in other frame. Display the buffer of the next command in a new frame. The next buffer is the buffer displayed by the next command invoked immediately after this command. |
C-x 5 b | M-x switch-to-buffer-other-frame | Switch to another buffer in another frame. |
C-x 5 c | M-x clone-frame | Make and select a new frame with the same parameters as FRAME. |
C-x 5 d | M-x dired-other-frame | Edit directory DIRNAME (M-x dired ) – delete, rename, print, etc. some files in it, but in other frame. |
C-x 5 f | M-x find-file-other-frame | Edit file FILENAME, in another frame. |
C-x 5 m | M-x compose-mail-other-frame | Like C-x m (M-x compose-mail ). Start composing a mail message to send, but edit the outgoing message in another frame. |
C-x 5 o | M-x other-frame | Select the ARGth different visible frame on current display, and raise it. All frames are arranged in a cyclic order. |
C-x 5 p | M-x project-other-frame-command | Run project command, displaying resultant buffer in another frame. |
C-x 5 r | M-x find-file-read-only-other-frame | Edit file FILENAME, in another frame, but don’t allow changes. |
C-x 5 u | M-x undelete-frame | Undelete a frame deleted with M-x delete-frame . |
C-x 5 C-f | M-x find-file-other-frame | Edit file FILENAME, in another frame. |
C-x 4 C-o | M-x display-buffer-other-frame | Display buffer BUFFER preferably in another frame. This function attempts to look for a window displaying BUFFER, on all the frames on the current terminal, skipping the selected window; if that fails, it pops up a new frame. |
Emacs registers are compartments where you can save text, rectangles, positions, and other things for later use.
In the following table Chr
is any single key character.
Reference: Registers
Key binding | Command | Description |
---|---|---|
M-x view-register RET Chr | Display a description of what register Chr contains. | |
C-x r SPC Chr | M-x point-to-register RET Chr | Record the position of point and the current buffer in register Chr. |
C-x r SPC r Chr | M-x point-to-register RET Chr | Saves both the position of point and the current buffer in register Chr. |
C-x r j Chr | M-x jump-to-register RET Chr | Jump to the position and buffer saved in register Chr. |
C-x r s Chr | M-x copy-to-register RET Chr | Copy region into register Chr. |
C-u C-x r s Chr | C-u M-x copy-to-register RET Chr | Copies the text into register Chr and deletes the text from the buffer as well. |
C-x r i Chr | M-x insert-register RET Chr | Insert text from register Chr. |
M-x append-to-register RET Chr | Append region to text in register Chr. | |
C-u M-x append-to-register RET Chr | Append region to text in register Chr and deletes the text from the buffer as well. | |
C-x r + Chr | M-x increment-register RET Chr | When register Chr contains text, use this command to append to that register. |
M-x prepend-to-register RET Chr | Prepend region to text in register Chr. | |
C-x r r Chr | M-x copy-rectangle-to-register RET Chr | Copy the region-rectangle into register Chr. With prefix argument, delete it as well. |
C-x r i Chr | M-x insert-register RET Chr | Insert the rectangle stored in register Chr (if it contains a rectangle). |
C-x r w Chr | M-x window-configuration-to-register RET Chr | Save the state of the selected frame’s windows in register Chr. |
C-x r f Chr | M-x frameset-to-register RET Chr | Save the state of all frames, including all their windows, in register Chr. |
C-x r j Chr | M-x jump-to-register RET Chr | To restore a window or frame configuration stored in register Chr. When you restore a frame configuration, any existing frames not included in the configuration become invisible. |
C-u C-x r j Chr | C-u M-x jump-to-register RET Chr | Use Prefix to also delete pre-existing frames. |
C-x C-k x Chr | M-x kmacro-to-register RET Chr | Stores the last keyboard macro in register Chr. |
C-x r j Chr | M-x jump-to-register RET Chr | To execute the keyboard macro in register Chr. |
Bookmarks are somewhat like registers in that they record positions you can jump to. Unlike registers, they have long names, and they persist automatically.
Reference: Bookmarks
Key binding | Command | Description |
---|---|---|
C-x r m | M-x bookmark-set RET | Set the bookmark for the visited file, at point. |
C-x r m Bookmark | M-x bookmark-set Bookmark RET | Set the bookmark named Bookmark at point. |
C-x r M Bookmark | M-x bookmark-set-no-overwrite Bookmark RET | Like C-x r m , but don’t overwrite an existing bookmark. |
C-x r b Bookmark | M-x bookmark-jump Bookmark RET | Jump to the bookmark named Bookmark. |
C-x r l | M-x list-bookmarks | List all bookmarks. |
M-x bookmark-save | Save all the current bookmark values in the default bookmark file. | |
M-x bookmark-write RET Filename RET | Save all the current bookmark values in the file Filename. | |
M-x bookmark-load RET Filename RET | Load a file named Filename that contains a list of bookmark values. You can use this command, as well as bookmark-write, to work with other files of bookmark values in addition to your default bookmark file. | |
M-x bookmark-delete RET Bookmark RET | Delete the bookmark named Bookmark. | |
M-x bookmark-insert-location RET Bookmark RET | Insert in the buffer the name of the file that bookmark Bookmark points to. | |
M-x bookmark-insert RET Bookmark RET | Insert in the buffer the contents of the file that bookmark Bookmark points to. |
In the following, a table is provided that contains useful commands and their key bindings. The list is not exhaustive, but contains just bindings and commands that I did not know about beforhand or that I might forget about in the future.
Key binding | Command | Description |
---|---|---|
C-x z | M-x repeat | Repeat the most recently executed command. After first execution pressing key z repeats the command further. |
C-x M-: | M-x repeat-complex-command | Edit and re-evaluate last complex command, or ARGth from last. A complex command is one that used the minibuffer. |
M-x view-lossage | Display last few input keystrokes and the commands run. | |
C-x C-- | C-u -1 M-x zoom-out | Decrease the default face height by one step. |
C-x C-+ | C-u +1 M-x zoom-in | Increase the default face height by one step. |
C-x C-0 | C-u 0 M-x zoom-frm-unzoom | Reset the default face height to the global default. |
Psimacs defines some buffer toggle commands of its own.
Key binding | Command | Description |
---|---|---|
C-TAB | M-x psimacs/buffer/next-user-buffer | Switch to the next user buffer. Buffer name starts with *, it’s not considered a user buffer. |
C-S-TAB | M-x psimacs/buffer/previous-user-buffer | Switch to the previous user buffer. Buffer name starts with *, it’s not considered a user buffer. |
H-TAB | M-x psimacs/buffer/next-emacs-buffer | Switch to the next emacs buffer, i.e. that starts with *. |
H-S-TAB | M-x psimacs/buffer/previous-emacs-buffer | Switch to the previous emacs buffer, i.e. that starts with *. |
C-x <right> | M-x next-buffer | Switch to the next buffer. |
C-x <left> | M-x previous-buffer | Switch to the previous buffer. |
A tab is a window configuration. In Emacs, a window configuration is a collection of windows – size, location, the buffer, and so on – that captures the layout of your Emacs frame.
Remarks:
With option tab-bar-show
it is possible to hide the tab-bar, but still benefit from all the capabilitties of the tab bar.
References:
Key binding | Command | Description |
---|---|---|
M-x tab-bar-mode | Toggle the tab bar in all graphical frames. | |
C-x t RET | M-x tab-switch | Switch to the tab by NAME. |
C-x t 0 | M-x tab-close | Close the current tab. |
C-x t 1 | M-x tab-close-other | Close all tabs on the selected frame, except the tab TAB-NUMBER. |
C-x t 2 | M-x tab-new | Create a new tab ARG positions to the right. |
C-x t ^ f | M-x tab-detach | Move tab number FROM-NUMBER to a new frame. |
C-x t b | M-x switch-to-buffer-other-tab | Switch to buffer BUFFER-OR-NAME in another tab. |
C-x t d | M-x dired-other-tab | Edit directory DIRNAME. Like M-x dired but make a new tab. |
C-x t f | M-x find-file-other-tab | Edit file FILENAME, in another tab. |
C-x t G | M-x tab-group | Add the tab specified by its absolute position TAB-NUMBER to GROUP-NAME. If no TAB-NUMBER is specified, then set the GROUP-NAME for the current tab. Interactively, TAB-NUMBER is the prefix numeric argument, and the command prompts for GROUP-NAME. |
C-x t M | M-x tab-move-to | Move tab from FROM-NUMBER position to new position at TO-NUMBER. |
C-x t m | M-x tab-move | Move the current tab ARG positions to the right. |
C-x t N | M-x tab-new-to | Add a new tab at the absolute position TAB-NUMBER. |
C-x t n | M-x tab-duplicate | Clone the current tab to ARG positions to the right. |
C-x t O | M-x tab-previous | Switch to ARGth previous tab. |
C-x t o | M-x tab-next | Switch to ARGth next tab. |
C-x t p | M-x project-other-tab-command | Run project command, displaying resultant buffer in a new tab. |
C-x t r | M-x tab-rename | Give the tab specified by its absolute position TAB-NUMBER a new NAME. |
C-x t t | M-x other-tab-prefix | Execute command in other tab. Display the buffer of the next command in a new tab. The next buffer is the buffer displayed by the next command invoked immediately after this command. |
C-x t u | M-x tab-undo | Restore the most recently closed tab. |
C-x t C-f | M-x find-file-other-tab | Edit file FILENAME, in another tab. |
C-x t C-r | M-x find-file-read-only-other-tab | Edit file FILENAME, in another tab, but don’t allow changes. |
M-x tab-list | Display a list of named window configurations. | |
M-x tab-recent | Switch to ARGth most recently visited tab. |
This is just a brief overview over the most important Info commands:
Key binding | Command | Description |
---|---|---|
H-SPC h i | M-x info | Enter Info the documentation browser. |
Inside Info the following commands are useful:
Key binding | Command | Description |
---|---|---|
? | Provide brief list of commands in Info. | |
q | Quit info. | |
C-l | Redisplay | |
M-x visible-mode | Show or hide invisible text. | |
b e | Jump to beginning or end of node text | |
g | Go to node if node’s name is given, e.g. gGo to Node<ret> , g(dir)Top<ret> , g(emacs)Top<ret> , g*<ret> , g(FILENAME)*<ret> . | |
n p | Go to next or previous node at same level. | |
SPC BACKSPC | Move forward or backward in node and might move to next or previous logical node. | |
] [ | Move to next or previous logical node. | |
d | M-x Info-directory | Go to directory node. |
t | M-x Info-top-node | Go to current manual top node, i.e. gTop<ret> |
m | Go to subnode found in node’s menu. | |
1 … 9 | Go to N-th subnode found in node’s menu. | |
0 | Go to last subnode found in node’s menu. | |
u | Go to parent node. | |
<tab> S-<tab> | Go to next or previous node menu entry or cross reference. | |
f | Follow cross reference. | |
l r | Move backward or forward in the node and cross reference history list. | |
L | Create a virtual node with menu of all nodes visited. | |
s | Search info file text for string. | |
C-s C-r | Incremental search forward or backward info file text. | |
i | Searches the index for string. | |
, | After i , visit additional index entries which match. | |
I | M-x Info-virtual-index | Construct a virtual info node displaying results of an index search. |
M-x index-apropos | Search in all the indices of all the Info documents known by the system. | |
M-n | M-x clone-buffer | Create and return a twin copy of the current buffer, i.e. a new Info-buffer from the current node. |
C-u m C-u g | Go to new Info-buffer in another window. | |
M-x info-display-manual | Show the Info manual by name. | |
C-u M-x info-display-manual | Show the Info manual by name, but limits the completion alternatives to currently visited info files. |
Emacs has two debuggers, Debug and Edebug. The first is built into the internals of Emacs and is always with you; the second requires that you instrument a function before you can use it.
You can enter the debugger when you call the function by calling debug-on-entry
, e.g. M-x debug-on-entry RET my-function RET
.
To cancel the effect of debug-on-entry
, call cancel-debug-on-entry
with the same function name.
Since a break is a recursive edit, all the usual editing facilities of Emacs are available; you can even run programs that will enter the debugger recursively.
If you want errors to enter the debugger, set the variable debug-on-error
to non-nil
. However, if variable
eval-expression-debug-on-error
is non-nil
, then debug-on-error
is set to t
in case of running command eval-expression
.
The most used commads are the following. For more detail see Debugger Commands.
Key binding | Description |
---|---|
c | Exit the debugger and continue execution. |
q | Terminate the program being debugged; return to top-level Emacs command execution. |
d | Continue execution, but enter the debugger the next time any Lisp function is called. |
l | Display a list of functions that will invoke the debugger when called. This is a list of functions that are set to break on entry by means of debug-on-entry. |
e | Read a Lisp expression in the minibuffer, evaluate it. |
Edebug is a source-level debugger for Emacs Lisp programs that is very useful developing Lisp code. In the following you can find some useful commands and settings for debugging with Edebug:
- Using Edebug:
To debug a Lisp program with Edebug, you must first instrument the Lisp code that you want to debug.
A simple way to do this is to first move point into the definition of a function or macro and then do
C-u C-M-x
. - Embedding a breakpoint into source code:
(edebug)
References:
- Debugging
- Edebug
- Debugging Elisp Part 1: Earn your independence
- Debugging Elisp Part 2: Advanced topics
- My work flow to debug emacs plugin from Chen Bin
- Debugging basics
Key binding | Command | Description |
---|---|---|
H-m C-f C-f | M-x find-function | Find the definition of function near point |
C-u C-M-x | M-x edebug-defun | Instrument the Lisp code at point. Any call to the function activates Edebug. |
C-M-x | M-x eval-defun | Undo instrumentation. |
h | M-x edebug-goto-here | Proceed to the stop point near where point is. |
f | M-x edebug-forward-sexp | Run the program for one expression. |
o | M-x edebug-step-out | Run the program until the end of the containing sexp. |
i | M-x edebug-step-in | Step into the function or macro called by the form after point. |
b | M-x edebug-set-breakpoint | Set a breakpoint at the stop point at or after point. If you use a prefix argument, the breakpoint is temporary – it turns off the first time it stops the program. |
u | M-x edebug-unset-breakpoint | Unset the breakpoint (if any) at the stop point at or after point. |
U | M-x edebug-unset-breakpoints | Unset any breakpoints in the current form. |
D | M-x edebug-toggle-disable-breakpoint | Toggle whether to disable the breakpoint near point. |
x condition RET | M-x edebug-set-conditional-breakpoint | Set a conditional breakpoint which stops the program only if evaluating condition produces a non-nil value. |
B | M-x edebug-next-breakpoint | Move point to the next breakpoint in the current definition. |
S | M-x edebug-stop | Stop: don’t execute any more of the program, but wait for more Edebug commands |
SPC | M-x edebug-step-mode | Step: stop at the next stop point encountered. |
n | M-x edebug-next-mode | Next: stop at the next stop point encountered after an expression. |
t | M-x edebug-trace-mode | Trace: pause (normally one second) at each Edebug stop point. |
T | M-x edebug-Trace-fast-mode | Rapid trace: update the display at each stop point, but don’t actually pause. |
g | M-x edebug-go-mode | Go: run until the next breakpoint. |
c | M-x edebug-continue-mode | Continue: pause one second at each breakpoint, and then continue. |
C | M-x edebug-Continue-fast-mode | Rapid continue: move point to each breakpoint, but don’t pause. |
G | M-x edebug-Go-nonstop-mode | Go non-stop: ignore breakpoints. You can still stop the program by typing S, or any editing command. |
? | M-x edebug-help | Display the help message for Edebug. |
C-] | M-x abort-recursive-edit | Abort one level back to the previous command level |
q | M-x top-level | Return to the top level editor command loop. This exits all recursive editing levels, including all levels of Edebug activity. |
Q | M-x edebug-top-level-nonstop | Like q, but don’t stop even for protected code. Like q, but don’t stop even for protected code. |
r | M-x edebug-previous-result | Redisplay the most recently known expression result in the echo area. |
d | M-x edebug-pop-to-backtrace | Display the current backtrace in a backtrace-mode window |
v | M-x edebug-view-outside | Switch to viewing the outside window configuration. Type C-x X w to return to Edebug. |
p | M-x edebug-bounce-point | Temporarily display the outside current buffer with point at its outside position, pausing for one second before returning to Edebug. With a prefix argument n, pause for n seconds instead. |
w | M-x edebug-where | Move point back to the current stop point in the source code buffer. |
W | M-x edebug-toggle-save-windows | Toggle whether Edebug saves and restores the outside window configuration. |
e exp RET | M-x edebug-eval-expression | Evaluate expression exp in the context outside of Edebug. That is, Edebug tries to minimize its interference with the evaluation. |
M-: exp RET | M-x eval-expression | Evaluate expression exp in the context of Edebug itself. |
C-x C-e | M-x edebug-eval-last-sexp | Evaluate the expression before point, in the context outside of Edebug. |
C-u 0 C-x C-e | C-u 0 M-x edebug-eval-last-sexp | Dito, but don’t shorten long items (like strings and lists). |
E | M-x edebug-visit-eval-list | Switch to the evaluation list buffer edebug |
C-j | M-x edebug-eval-print-last-sexp | Evaluate the expression before point, in the outside context, and insert the value in the buffer. |
C-u 0 C-j | C-u 0 M-x edebug-eval-print-last-sexp | Dito, but don’t shorten long items (like strings and lists). |
C-c C-u | M-x edebug-update-eval-list | Build a new evaluation list from the contents of the buffer. |
C-c C-d | M-x edebug-delete-eval-item | Delete the evaluation list group that point is in. |
C-c C-w | M-x edebug-where | Switch back to the source code buffer at the current stop point. |
The following links might be useful for diving deeper into Elisp:
- Introduction to Programming in Emacs Lisp
- EmacsWiki: Lisp Cookbook
- WikEmacs: Emacs Lisp Cookbook
- Emacs Lisp Guide
- Evaluating Elisp in Emacs
- Practical Emacs Lisp
Psimacs provides three simple strategies for positioning and sizing new frames. These strategies can be activated by the following functions.
Key binding | Command | Description |
---|---|---|
H-m C-w C-x 5 l | M-x psimacs/window/set-frame-creation-strategy-layout | Place and size new frames left and right to the main frame. This is the default strategy. |
H-m C-w C-x 5 m | M-x psimacs/window/set-frame-creation-strategy-main | Always use the same placement and size as the initial main frame. |
H-m C-w C-x 5 s | M-x psimacs/window/set-frame-creation-strategy-system | Let Emacs and the operating system decide. |
Pacman queries the local package database with the -Q
flag, the sync database with the -S
flag and the files
database with the -F
flag. See pacman -Q --help
, pacman -S --help
and pacman -F --help
for the respective
suboptions of each flag.
Most important commands taken from
Command | Description |
---|---|
pacman -Syu | Synchronizes the repository databases and updates the system’s packages, excluding “local” packages that are not in the configured repositories. |
pacman -Syuu | Synchronizes the repository databases and updates packages. Repeat this step until it says there are no packages to update. |
pacman -S <name> | Install package. |
pacman -R <name> | Uninstall package. |
pacman -Q --help | Get help about the sub options for local package database access. |
pacman -S --help | Get help about the sub options for sync database access. |
pacman -F --help | Get help about the sub options for files database access. |
pacman -Ss <string> | Search for packages in the database, searching both in packages’ names and descriptions. |
pacman -Qs <string> | To search for already installed packages. |
pacman -F <string> | To search for package file names in remote packages |
pacman -Si <package> | To display extensive information about a given package. |
pacman -Qi <package> | For locally installed packages. |
pacman -Qe <package> | To retrieve a list of all installed packages. |
pacman -Ql <package> | To retrieve a list of the files installed by a package. |
This is a simple benchmark of calls to Emacs require and load functions. It can be used to keep track of where time is being spent during Emacs startup in order to optimize startup times.
Usage: The following commands and functions can be used to govern the benchmarking.
Command |
---|
M-x benchmark-init/show-durations-tabulated |
M-x benchmark-init/show-durations-tree |
M-x benchmark-init/activate |
M-x benchmark-init/deactivate |
References to benchmarking:
C-g
should behave more then expected:
- When the region is active, disable it.
- When a minibuffer is open, but not focused, close the minibuffer.
- When the Completions buffer is selected, close it.
- In every other case use the regular `keyboard-quit’.”
Key binding | Command | Description |
---|---|---|
C-g | M-x psimacs/config/keyboard-quit-dwim | Quit or abort. |
Call command keyboard-escape-quit
immediately on pressing key H-g
.
See also:
Key binding | Command | Description |
---|---|---|
H-g | M-x keyboard-escape-quit | Quit or abort. |
Provide keybindings for conveniently access of the Psimacs HTML documentation and keybindings.
Key binding | Command | Description |
---|---|---|
H-<f1> | M-x (lambda() (interactive) (browse-url psimacs/config/keybindings-html-file))) | Open Psimacs keybindings as Html in default browser. |
H-<f2> | M-x (lambda() (interactive) (browse-url psimacs/config/init-html-file))) | Open Psimacs configuration as Html in default browser. |
H-S-<f1> | M-x (lambda() (interactive) (eww-open-file psimacs/config/keybindings-html-file))) | Open Psimacs keybindings as Html in eww . |
H-S-<f2> | M-x (lambda() (interactive) (eww-open-file psimacs/config/init-html-file))) | Open Psimacs configuration as Html in eww . |
Psimacs currently supports two sets of commands for printing on windows:
Key binding | Command | Description |
---|---|---|
H-m C-p C-p b | M-x print-buffer | B/W print hardcopy of buffer on default printer |
H-m C-p C-p r | M-x print-region | B/W print hardcopy of region on default printer |
H-m C-p C-q p | M-x ps-print-buffer | B/W print buffer via Ghostscript |
H-m C-p C-q r | M-x ps-print-region | B/W print region via Ghostscript |
H-m C-p C-f p | M-x ps-print-buffer-with-faces | Color print buffer via Ghostscript |
H-m C-p C-f r | M-x ps-print-region-with-faces | Color print region via Ghosts |
Key binding | Command | Description |
---|---|---|
M-x revert-buffer-with-coding-system | ||
M-x set-buffer-file-coding-system | ||
M-x describe-coding-system | Information about coding system. | |
M-x list-coding-systems | ||
M-x find-file-literally | Open file without any conversion. | |
C-x RET c | M-x universal-coding-system-argument= | Ttakes as an argument the coding system you want to use, and a command to execute it with. That makes it possible to open files, shells or run Emacs commands as though you were using a different coding system. |
The smooth-scrolling package offers a minor mode which make emacs scroll smoothly. It keeps the point away from the top and bottom of the current buffer’s window in order to keep lines of context around the point visible as much as possible, whilst minimising the frequency of sudden scroll jumps which are visually confusing.
You can toggle the smooth-scrolling-mode with the following command.
Key binding | Command | Description |
---|---|---|
H-m C-w C-s s | M-x smooth-scrolling-mode | Enable or disable the smooth scrolling mode. |
Handy way of getting back to previous places.
Immediately after you type C-u C-SPC
, you can type C-SPC
instead of C-u C-SPC
to
cycle through the mark ring.
From the Emacs Manual: The Mark Ring:
Each buffer remembers previous locations of the mark, in the mark ring. Commands that set the mark also push the old mark onto this ring. One of the uses of the mark ring is to remember spots that you may want to go back to.
Key binding | Command | Description |
---|---|---|
C-SPC C-@ | M-x cua-set-mark M-x set-mark-command | Set mark where point is, clear mark, or jump to mark. With no prefix argument, clear mark if already set. Otherwise, mark, and push old mark position on local mark ring; also push mark on global mark ring if last mark was set in another buffer. |
C-u C-SPC C-u C-@ H-x p | M-x pop-to-mark-command | Jump to mark, and pop a new position for mark off the local mark ring (this does not affect the global mark ring). |
C-x C-SPC C-x C-@ H-x q | M-x pop-global-mark | Jump to a mark off the global mark ring. |
C-SPC C-SPC | Jumps to the next position off the local (or global) mark ring. Set the mark, pushing it onto the mark ring, without activating it. | |
C-u C-u C-SPC | Unconditionally set mark. |
If you set set-mark-command-repeat-pop
to non-nil, then immediately after you type C-u C-SPC
, you can type C-SPC
instead of C-u C-SPC
to cycle through the mark ring.
Electric Indent mode is a global minor mode that automatically indents the line after every RET
you type.
This mode is enabled by default, which we turn off.
Use instead:
Key binding | Command | Description |
---|---|---|
C-j | M-x newline-and-indent | Indent current line |
Do not use tab characters -> fill spaces instead.
Insert a real tab character with C-q TAB
.
Key binding | Command | Description |
---|---|---|
C-q TAB | M-x quoted-insert | Read next input character (TAB) and insert it. This is useful for inserting control characters. |
Emacs allows to display boundaries. Psimacs uses this to show an indicator at the fill column position. The default fill column is set to 120 characters because huge displays are now commonly in use.
Key binding | Command | Description |
---|---|---|
H-m C-m C-v f | M-x global-display-fill-column-indicator-mode | Toggle the display of the fill column indicator. |
The package Symbol Overlay highlight symbols with overlays while providing a keymap for
various operations about highlighted symbols. It was originally inspired by the package highlight-symbol
. The fundamental difference
is that in symbol-overlay
every symbol is highlighted by the Emacs built-in function overlay-put
rather than the font-lock
mechanism
used in highlight-symbol
. On start up the symbol-overlay-mode
is not activated.
Additionally, the package symbol-overlay-mc is a tiny Emacs package enabling multiple cursors on symbol overlays.
Key binding | Command | Description |
---|---|---|
H-x H-s m | M-x symbol-overlay-mode | Toggle the automatic symbol highlight. This is disabled on default. |
H-x H-s i | M-x symbol-overlay-put | Toggle all overlays of symbol at point. |
H-x H-s a | M-x symbol-overlay-mc-mark-all | place a cursor on every symbol currently highlighted. |
H-x H-s x | M-x symbol-overlay-remove-all | Remove all highlighted symbols in the buffer. |
H-x H-s b | M-x symbol-overlay-switch-backward | Switch backward to another symbol. |
H-x H-s f | M-x symbol-overlay-switch-forward | Switch forward to another symbol. |
H-x H-s h | M-x symbol-overlay-map-help | Display the bindings in ‘symbol-overlay-map’. |
The bindings in ‘symbol-overlay-map’ that are active when the cursor points a highlighted symbol.
Key binding | Command | Description |
---|---|---|
H-x H-s i | M-x symbol-overlay-put | Toggle all overlays of symbol at point. |
H-x H-s n | M-x symbol-overlay-jump-next | Jump to the next location of symbol at point. |
H-x H-s p | M-x symbol-overlay-jump-prev | Jump to the previous location of symbol at point. |
H-x H-s < | M-x symbol-overlay-jump-first | Jump to the first location of symbol at point. |
H-x H-s > | M-x symbol-overlay-jump-last | Jump to the last location of symbol at point. |
H-x H-s w | M-x symbol-overlay-save-symbol | Copy symbol at point. |
H-x H-s t | M-x symbol-overlay-toggle-in-scope | Toggle overlays to be showed in buffer or only in scope. |
H-x H-s e | M-x symbol-overlay-echo-mark | Jump back to the mark. |
H-x H-s d | M-x symbol-overlay-jump-to-definition | Jump to the definition of symbol at point. |
H-x H-s s | M-x symbol-overlay-isearch-literally | Isearch symbol at point literally. |
H-x H-s q | M-x symbol-overlay-query-replace | Query replace symbol at point. |
H-x H-s r | M-x symbol-overlay-rename | Rename symbol at point on all its occurrences. |
Key binding | Command | Description |
---|---|---|
M-x counsel-load-theme | Allows easily switching of themes. | |
Theme | ||
ef-symbiosis | ||
modus-vivendi | ||
modus-operandi | ||
nimbus | ||
kaolin-valley-dark | ||
vscode-dark-plus | ||
alect-dark | ||
alect-light-alt | ||
sanityinc-tomorrow-eighties | ||
moe-dark |
When prettify-symbols-mode and font-locking are enabled, symbols are prettified. Psimacs defines list of symbols for various programming modes.
Currently the greek characters are supported for all programming modes and additionally some extra symbols are defined for the Python programming mode.
See also: About prettify-symbols-mode
Key binding | Command | Description |
---|---|---|
H-m C-x C-p | M-x prettify-symbols-mode | Toggle prettify-symbols-mode . |
<f8> | M-x prettify-symbols-mode | Toggle prettify-symbols-mode . |
M-<f8> | M-x global-prettify-symbols-mode | Toggle prettify-symbols-mode globally. |
The package rainbow-delimiters highlights delimiters such as parentheses, brackets or braces according to their depth. Each successive level is highlighted in a different color. This makes it easy to spot matching delimiters, orient yourself in the code, and tell which statements are at a given depth.
See also:
Key binding | Command | Description |
---|---|---|
H-m C-p C-r C-p | M-x psimacs/pair/rainbow-toggle-sized-delimiters | Toggle the size of the rainbow-delimiters. |
H-m C-p C-r M-C-p | M-x psimacs/pair/rainbow-sized-delimiters | All rainbow delimiters have various heights. |
H-m C-p C-r S-C-p | M-x psimacs/pair/rainbow-non-sized-delimiters | All rainbow delimiters have the same height. This is the default. |
M-x psimacs/pair/rainbow-toggle-theme-is-light-colored | Toggle the rainbow delimiters colors with respect to light or dark themes. |
Package savehist automatically save minibuffer, kill-ring, search-ring and regexp-search-ring histories to a file. It also deletes duplicates entries.
Package savehist.el is available on emacs-mirror.
Key binding | Command | Description |
---|---|---|
H-m C-c C-h | (find-file-read-only history-file) | Open the history file in read-only mode. |
Recentf-mode is a minor mode that builds a list of recently opened files. This list is automatically saved
across sessions on exiting Emacs - you can then access this list
through the command C-x C-r
.
Key binding | Command | Description |
---|---|---|
H-x r | M-x recentf-open-files | Show a dialog to open a recent file. |
H-x C-r | M-x recentf-open-more-files | Show a dialog to open a recent file that is not in the menu. |
H-x f | M-x counsel-recentf | Find a file on recent file list. |
H-x C-f | M-x counsel-buffer-or-recentf | Find a buffer visiting a file or file on recent file list. |
H-x C c | M-x recentf-cleanup | Cleanup the recent file list. |
H-x C C-c | M-x psimacs/config/recentf-cleanup-directory-files | Remove all files of DIR from recent file list. |
The package undo-fu provides a simple, stable linear undo with redo for Emacs.
This is a light weight wrapper for Emacs built-in undo system, adding convenient undo/redo without losing access to the full undo history, allowing you to visit all previous states of the document if you need. The changes compared Emacs undo are as follows:
- Redo will not pass the initial undo action.
- Redo will not undo (unlike Emacs redo which traverses previous undo/redo steps).
- These constraints can be temporarily disabled by pressing
C-g
before undo or redo.Note that this doesn’t interfere with Emacs internal undo data, which can be error prone.
The default Emacs undo has two limitations this package aims to resolve,
- Two actions are required to initiate redo.
- It’s easy to accidentally redo past the point where undo started making it inconvenient to restore the document to the point when undo began.
Key binding | Command | Description |
---|---|---|
C-z | M-x undo-fu-only-undo | Undo the last action. |
C-S-z | M-x undo-fu-only-redo | Redo an action until the initial undo action. |
H-m C-z | M-x undo-fu-only-redo-all | Redo all actions until the initial undo step. |
References to undo/redo packages:
Package | Remark |
---|---|
CUA mode | Provides undo/redo binding. Disabled for Psimacs. |
undo-tree | Instead of treating undo/redo as a linear sequence of changes, undo-tree-mode treats undo history as a branching tree of changes. |
undo-fu-session | Save & recover undo steps between Emacs sessions. |
The package helpful is an alternative to the built-in Emacs help that provides much more contextual information.
Psimacs do not change the default bindings for the describe-
commands. Instead the helpful commands are
provided in the additional H-h
key map for help topics.
References:
It provides the following commands:
Key binding | Command | Description |
---|---|---|
H-h f | M-x helpful-callable | Show help for function, macro or special form named SYMBOL. |
H-h F | M-x helpful-function | Show help for function named SYMBOL. |
H-h M | M-x helpful-macro | Show help for macro named SYMBOL. |
H-h c | M-x helpful-command | Show help for interactive function named SYMBOL. |
H-h k | M-x helpful-key | Show help for interactive command bound to KEY-SEQUENCE. |
H-h v | M-x helpful-variable | Show help for variable named SYMBOL. |
H-h p | M-x helpful-at-point | Show help for the symbol at point. |
The package edit-indirect is a useful enhancement for editing. It provides a command edit-indirect-region
that
allows the editing of a region in a separate buffer.
The region is copied, without text properties, to a separate buffer, called edit-indirect buffer. The major is guessed.
After finishing the editing the command edit-indirect-commit
replaces the original region with the content of
the edit-indirect buffer. Alternatively, the command edit-indirect-abort
drops the modification and leaves the
region unchanged. Very useful!
Key binding | Command | Description |
---|---|---|
H-c C-e | M-x edit-indirect-region | Edit region in separate buffer edit-indirect buffer |
C-c C-c | M-x edit-indirect-commit | Commit the modification done in edit-indirect buffer |
C-c C-k | M-x edit-indirect-abort= | Abort indirect editing; kill buffer edit-indirect buffer |
C-x C-s | M-x edit-indirect-save | Replace the original region in the parent buffer with the contents of the edit-indirect buffer. |
Some convenience functions that use the psimacs/pair/insert-bracket-pair
function.
Additionally, Psimacs provides the following key bindings:
Key binding | Command | Description |
---|---|---|
H-m ( | M-x psimacs/pair/insert-paren | Insert paranthesis (▮) . |
H-m [ | M-x psimacs/pair/insert-bracket | Insert brackets [▮] . |
H-m { | M-x psimacs/pair/insert-brace | Insert braces {▮} . |
H-m " | M-x psimacs/pair/insert-ascii-double-quote | Insert ascii double quotes "▮" . |
H-m ' | M-x psimacs/pair/insert-ascii-single-quote | Insert ascii single quotes '▮' . |
H-m e | M-x psimacs/pair/insert-emacs-quote | Insert emacs quotes `▮' . |
H-m = | M-x psimacs/pair/insert-equal | Insert equality signs ==▮==. |
H-m * | M-x psimacs/pair/insert-star | Insert stars *▮* . |
H-m / | M-x psimacs/pair/insert-slash | Insert slashes /▮/ . |
The package smartparens is minor mode for Emacs that deals with parens pairs and tries to be smart about them.
Psimacs does have the show-paren-mode active on default. With the command M-x psimacs/activate/toggle-smartparens-paren-mode
which is bound to H-m C-p C-s t
you can easily toggle between global smartparens-mode and show-paren-mode.
Documentation: Welcome to Smartparens’s documentation!
See also:
- Emacs and Pairs
- Smartparens wiki
- Smartparens 1 - smart editing of paired expressions in Emacs - part 1 of 2
- Smartparens 1 - smart editing of paired expressions in Emacs - part 2 of 2
- Smartparens 2 - On the navigation functions
- smartparens-cheatsheet
Psimacs provides the following key bindings for active smartparens-mode:
Key binding | Command | Description |
---|---|---|
H-m C-p C-s t | M-x psimacs/activate/toggle-smartparens-paren-mode | Toggle between smartparens-mode and show-paren-mode. |
H-p C-f | M-x sp-forward-sexp | Move forward across one balanced expression. |
H-p C-b | M-x sp-backward-sexp | Move backward across one balanced expression. |
H-p M-F | M-x sp-forward-symbol | Move point to the next position that is the end of a symbol. |
H-p M-B | M-x sp-backward-symbol | Move point to the next position that is the beginning of a symbol. |
H-p C-n | M-x sp-next-sexp | Move forward to the beginning of next balanced expression. |
H-p C-p | M-x sp-previous-sexp | Move backward to the end of previous balanced expression. |
H-p C-u | M-x sp-up-sexp | Move forward out of one level of parentheses. |
H-p C-d | M-x sp-down-sexp | Move forward down one level of sexp. |
H-p M-u | M-x sp-backward-up-sexp | Move backward out of one level of parentheses. |
H-p M-d | M-x sp-backward-down-sexp | Move backward down one level of sexp. |
H-p C-a | M-x sp-beginning-of-sexp | Jump to beginning of the sexp the point is in. |
H-p C-e | M-x sp-end-of-sexp | Jump to end of the sexp the point is in. |
H-p M-a | M-x sp-beginning-of-next-sexp | Jump to beginning of the next sexp on the same depth. |
H-p M-e | M-x sp-beginning-of-previous-sexp | Jump to beginning of the previous sexp on the same depth. |
H-p C-t | M-x sp-transpose-sexp | Transpose the expressions around point. |
H-p M-t | M-x sp-transpose-hybrid-sexp | Transpose the hybrid sexps around point. |
H-p C-j | M-x sp-join-sexp | Join the sexp before and after point if they are of the same depth. |
H-p C-v | M-x sp-convolute-sexp | Convolute balanced expressions. |
H-p C-i | M-x sp-indent-defun | Reindent the current defun. |
H-p C-m | M-x sp-mark-sexp | Set mark ARG balanced expressions from point. |
H-p C-k | M-x sp-kill-sexp | Kill the balanced expression following point. |
H-p M-w | M-x sp-copy-sexp | Copy the following ARG expressions to the kill-ring. |
H-p M-DEL | M-x sp-unwrap-sexp | Unwrap the following expression. |
H-p M-BCK | M-x sp-backward-unwrap-sexp | Unwrap the previous expression. |
H-p C-<right> | M-x sp-forward-slurp-sexp | Add sexp following the current list in it by moving the closing delimiter. |
H-p C-<left> | M-x sp-backward-slurp-sexp | Add the sexp preceding the current list in it by moving the opening delimiter |
H-p M-<right> | M-x sp-forward-barf-sexp | Remove the last sexp in the current list by moving the closing delimiter. |
H-p M-<left> | M-x sp-backward-barf-sexp | This is exactly like calling ‘sp-forward-barf-sexp’ with minus ARG. |
H-p M-D | M-x sp-splice-sexp | Unwrap the current list. |
H-p C-M-DEL | M-x sp-splice-sexp-killing-forward | Unwrap the current list and kill all the expressions between. |
H-p C-M-BCK | M-x sp-splice-sexp-killing-backward | Unwrap the current list and kill all the expressions. |
H-p C-S-BCK | M-x sp-splice-sexp-killing-around | Unwrap the current list and kill everything inside except next expression. |
H-p C-s N | M-x sp-select-next-thing-exchange | Just like sp-select-next-thing but run exchange-point-and-mark afterwards. |
H-p C-s n | M-x sp-select-next-thing | Set active region over next thing as recognized by ‘sp-get-thing’. |
H-p C-s p | M-x sp-select-previous-thing | Set active region over ARG previous things as recognized by ‘sp-get-thing’. |
H-p C-c i | M-x sp-change-inner | Change the inside of the next expression. |
H-p M-c e | M-x sp-change-enclosing | Change the inside of the enclosing expression. |
Use command ibuffer
instead of the default list-buffers
for C-x C-b
. The command ibuffer
is an improved
version of list-buffers
. IBuffer colors the files by type and Xah Lee introduces it in Emacs: List Buffers.
Key binding | Command | Description |
---|---|---|
C-x C-b | M-x ibuffer | Begin using IBuffer to edit a list of buffers. |
C-x b | M-x switch-to-buffer | Switch to buffer, selected from list. |
C-x k | M-x kill-buffer | Close the current buffer. |
When CUA mode is enabled, the keys C-x
, C-c
, C-v
, and C-z
invoke commands that cut (kill),
copy, paste (yank), and undo respectively.
To enter an Emacs command like C-x C-f
while the mark is active, use one of the following
methods:
- either hold Shift together with the prefix key, e.g.,
S-C-x C-f
, - or quickly type the prefix key twice, e.g.,
C-x C-x C-f
- or disable CUA mode by pressing
<f12>
orH-m c
.
CUA mode provides enhanced rectangle support with visible rectangle highlighting.
Use H-x C-RET
to start a rectangle, extend it using the movement commands, and cut or copy
it using C-x
or C-c
. RET
moves the cursor to the next (clockwise) corner of the rectangle,
so you can easily expand it in any direction. Normal text you type is inserted to the left
or right of each line in the rectangle (on the same side as the cursor).
With CUA you can easily copy text and rectangles into and out of registers by providing a
one-digit numeric prefix to the kill, copy, and yank commands, e.g., C-1 C-c
copies the
region into register 1, and C-2 C-v
yanks the contents of register 2.
CUA mode also has a global mark feature which allows easy moving and copying of text
between buffers. Use C-S-SPC
to toggle the global mark on and off. When the global
mark is on, all text that you kill or copy is automatically inserted at the global
mark, and text you type is inserted at the global mark rather than at the current
position.
By default Psimacs does not activate CUA mode on start-up, because it is to intrusive with respect to normal Emacs operation.
See also:
- Manual: Cua-Bindings,
- EmacsWiki: Cua Mode,
- What am I giving up by activating CUA mode?
- Emacs cua-mode Key Binding Problems
Key binding | Command | Description |
---|---|---|
<f12> | M-x cua-mode | Toggle CUA mode. |
H-m c | M-x cua-mode | Toggle CUA mode. |
C-x | Windows conform cut if CUA-mode is active. | |
C-c | Windows conform copy if CUA-mode is active. | |
C-v | Windows conform paste if CUA-mode is active. | |
H-x C-RET | M-x cua-set-rectangle-mark | Start a rectangle. |
<Ret> | M-x cua-rotate-rectangle | Move to next corner. |
C-1 C-c | Copy rectangle to register 1 | |
... | … | |
C-9 C-c | Copy rectangle to register 9 | |
C-1 C-x | Cut rectangle to register 1 | |
... | … | |
C-9 C-x | Cut rectangle to register 9 | |
C-1 C-v | Yank rectangle from register 1 | |
... | … | |
C-9 C-v | Yank rectangle from register 9 | |
Package Dired+ extends functionalities provided by standard Emacs library dired. The standard functions are all available, plus many more.
See also:
Important bindings in a Dired+ buffer:
Key bindings | Description |
---|---|
( | Hide/show details. |
q | Quit dired. |
g | Refresh and synch all. |
m | Mark this file or directory. |
u | Unmark this file or directory. |
U | Unmark all marked files and directories. |
* . <ext> | Mark/unmark all files with given extension. |
RET | Open file. |
b | Byte compile. |
B | Byte compile marked files or directories. |
z | Compress/uncompress file or directory. |
Z | Compress/uncompress marked file or directory. |
C-k | Delete with confirmation. |
r | Rename file or directory. |
M-c= | Capitalize name. |
M-u | Upper case name. |
M-l | Lower case name. |
=== | Ediff. |
C-S-b | Bookmark. |
M-b | Bookmark marked files and directories. |
F | Visit marked files. |
C | Copy marked files and directories. |
R | Rename of move marked files and directories. |
C-M-S-t | Touch marked files and directories. |
M | Change mode of marked files or directories. |
C-M-g | Run grep on marked files. |
L | Load Emacs lisp of marked files. |
& | Run shell command asynchronously on marked files or directories. |
! | Run shell command synchronously on marked files or directories. |
Some usefule key bindings and commands:
Key binding | Command | Description |
---|---|---|
M-x diredp-dired-plus-help | Describe dired+. | |
C-x d | M-x dired | Open dired in current window. |
C-x 4 d | M-x dired-other-window | Open dired in another window. |
C-x 5 d | M-x dired-other-frame | Open dired in another frame. |
C-x t d | M-x dired-other-tab | Open dired on an new tab. |
C-c p D | M-x projectile-dired | Open dired in current window at the root of the project. |
C-c p 4 D | M-x projectile-dired-other-window | Open dired in another window at the root of the project. |
C-c p 5 D | M-x projectile-dired-other-frame | Open dired in another frame at the root of the project. |
C-x C-j | M-x dired-jump | Jump to dired in current window corresponding to the current buffer. |
C-x 4 C-j | M-x dired-jump-other-window | Jump to dired in another window corresponding to the current buffer. |
C-c d | M-x counsel-dired-jump | Jump to directory below of current directory. |
C-x D r | M-x diredp-dired-recent-dirs | Open dired in current window showing recently visited directories. |
C-x 4 D r | M-x diredp-dired-recent-dirs-other-window | Open dired in another window showing recently visited directories. |
C-x D R | M-x diredp-dired-recent-files | Open dired in current window showing recently visited files and directories. |
C-x 4 D R | M-x diredp-dired-recent-files-other-window | Open dired in another window showing recently visited files and directories. |
C-x D F | M-x diredp-dired-for-files | Dired in current window the file names that you entered in a dired buffer that you name. |
C-x 4 D F | M-x diredp-dired-for-files-other-window | Dired in another window the file names that you entered in a dired buffer that you name. |
M-x dired-do-find-marked-files | Open marked files, each in separate window, by splitting window vertically. | |
C-u M-x dired-do-find-marked-files= | Open marked files, without splitting window. |
The perspective package provides multiple named workspaces (or “perspectives”) in Emacs, similar to multiple desktops in window managers.
Each perspective has its own buffer list and its own window layout. This makes it easy to work on many separate projects without getting lost in all the buffers. Switching to a perspective activates its window configuration, and when in a perspective, only its buffers are available (by default).
Each Emacs frame has a distinct list of perspectives.
Commands are all prefixed by C-x M-p
by default. To change the prefix key, customize persp-mode-prefix-key
.
Additionally, creating a key binding for persp-mode-map
will also activate the prefix.
Key binding | Command | Description |
---|---|---|
C-x M-p | Prefix key for all perspective commands. | |
C-x M-p s | M-x persp-switch | Query a perspective to switch to, or create |
C-x M-p k | M-x persp-remove-buffer | Query a buffer to remove from current perspective |
C-x M-p c | M-x persp-kill | Query a perspective to kill |
C-x M-p r | M-x persp-rename | Rename current perspective |
C-x M-p a | M-x persp-add-buffer | Query an open buffer to add to current perspective |
C-x M-p A | M-x persp-set-buffer | Add buffer to current perspective and remove it from all others |
C-x M-p b | M-x persp-switch-to-buffer | Like switch-to-buffer; includes all buffers from all perspectives; changes perspective if necessary |
C-x M-p i | M-x persp-import | Import a given perspective from another frame. |
C-x M-p n | M-x persp-next | Switch to next perspective |
C-x M-p p | M-x persp-prev | Switch to previous perspective |
C-x M-p <right> | M-x persp-next | Switch to next perspective |
C-x M-p <left> | M-x persp-prev | Switch to previous perspective |
C-x M-p C-s | M-x persp-state-save | Save all perspectives in all frames to a file |
C-x M-p C-l | M-x persp-state-load | Load all perspectives from a file |
Since perspective maintains distinct buffer lists for each perspective, it helps to use a Perspective-aware buffer switcher.
Buffer switcher | Support |
---|---|
Ido | Interactive Do (Ido, ido-mode), in particular its ido-switch-buffer command, is automatically Perspective-aware when persp-mode is enabled. |
bs.el | Perspective provides a wrapper for bs-show: persp-bs-show . When this function is called normally, it shows a list of buffers filtered by the current perspective. With a prefix argument, it shows a list of buffers in all perspectives. |
IBuffer | Perspective provides a wrapper for ibuffer: persp-ibuffer . When this function is called normally, it shows a list of buffers filtered by the current perspective. With a prefix argument, it shows a list of buffers in all perspectives. |
Helm | Perspective ships with buffer-listing advice for Helm, so Helm’s buffer listing code should be automatically Perspective-aware when persp-mode is enabled. |
Ivy / Counsel | Perspective provides two commands for listing buffers using Ivy and Counsel: persp-ivy-switch-buffer and persp-counsel-switch-buffer . When these functions are called normally, they show a list of buffers filtered by the current perspective. With a prefix argument, they shows a list of buffers in all perspectives. |
Emacs’s Abbrevs feature lets you type a short word and expand into a full word or code template.
Emacs has a nice feature to expand abbreviations. If for example, you wanted
an abbreviation for ‘Your Name’ to be ‘yn’, just type ‘yn’ and with your point
after the ‘n’ do C-x a i g
(mnemonic add inverse global) and enter the expansion,
in this case ‘Your Name’. In the future, whenever you type ‘yn’ your name will be
inserted. The abbrevs are automatically saved between sessions in a file.
If you don’t like an abbrev that you have set up, then do M-x edit-abbrevs
.
You can have different abbrevs for each mode (cperl, c++, Message);
the g in C-x a i g
is for global, meaning every mode.
Suppose you want to define “bg” for “background”: Type M-x add-global-abbrev
, i.e. C-x a g
and
then type “bg” in the prompt. Now, when you type “bg” followed by a space or return, it will expand
to “background”.
If you want the abbrev only
for the current major mode: Type M-x add-mode-abbrev
, i.e. C-x a l
…
If the expanded text is more than one word, for example, suppose you want to define “faq” for
“frequently asked questions”. Type “frequently asked questions”, then select the text and do
C-u C-x a g
rspl. C-u C-x a l
.
Remove an abbreviation by C-u -1 C-x a g
rspl. C-u -1 C-x a l
followed by the memnomic, e.g. “bg”.
Other commands: M-x list-abbrevs
M-x edit-abbrevs
, M-x edit-abbrevs-redefine
, M-x abbrev-edit-save-buffe
and M-x abbrev-edit-save-to-file
.
Additionally, M-x read-abbrev-file
and M-x write-abbrev-file
.
Key binding | Command | Description |
---|---|---|
H-m C-x C-a | M-x abbrev-mode | Enable/Disable abbreviation mode. |
C-x a i g | M-x inverse-add-global-abbrev | add inverse global abbreviation, i.e. ‘yn’→ C-x a i g → ‘Your Name’ |
C-x a g | M-x add-global-abbrev | add global abbreviation, i.e. ‘Name’ → C-x a g → ‘n’ |
C-u C-x a g | M-x add-global-abbrev | add region global abbreviation, i.e. ‘Your Name’ → C-x a g → ‘yn’ |
C-u -1 C-x a g | remove global abbreviation, i.e. ‘yn’ | |
C-x a i l | M-x inverse-add-mode-abbrev | add inverse mode abbreviation, i.e. ‘yn’→ C-x a i l → ‘Your Name’ |
C-x a l | M-x add-mode-abbrev | add mode abbreviation, i.e. ‘Name’ → C-x a l → ‘n’ |
C-u C-x a l | M-x add-mode-abbrev | add mode abbreviation, i.e. ‘Your Name’ → C-x a l → ‘yn’ |
C-u -1 C-x a l | remove mode abbreviation, i.e. ‘yn’ | |
M-x edit-abbrevs | ||
M-x edit-abbrevs-redefine | ||
M-x list-abbrevs | ||
M-x abbrev-edit-save-buffer | ||
M-x abbrev-edit-save-to-file |
See also:
Package Centaur tabs provides aesthetic, functional and efficient tabs for Emacs.
Key binding | Command | Description |
---|---|---|
H-<prior> | M-x centaur-tabs-backward | Select the previous available tab. |
H-<next> | M-x centaur-tabs-forward | Select the next available tab. |
The package expand-region allows you to expand a selected region by semantic units. Just keep pressing the key until it selects what you want.
See also:
Key binding | Command | Description |
---|---|---|
H-x e | M-x er/expand-region | Expand region intelligently. |
The package yafolding provides a minor mode that allows you to fold code blocks based on its indentation.
See also:
Key binding | Command | Description |
---|---|---|
H-x H-f h | M-x yafolding-hide-element | Hide element. |
H-x H-f s | M-x yafolding-show-element | Show element. |
H-x H-f t | M-x yafolding-toggle-element | Toggle element. |
H-x H-f H | M-x yafolding-hide-all | Hide all elements. |
H-x H-f S | M-x yafolding-show-all | Show all elements. |
H-x H-f T | M-x yafolding-toggle-all | Toggle all elements. |
H-x H-f p | M-x yafolding-go-parent-element | Go to parent element. |
H-x H-f P | M-x yafolding-hide-parent-element | Hide parent element. |
H-x H-f m | M-x yafolding-mode | Toggle yafolding-mode. |
Emacs’s whitespace-mode is a minor mode to visualize blanks, i.e. TAB, SPACE and NEWLINE.
See also:
Key binding | Command | Description |
---|---|---|
H-m C-m C-v w | M-x whitespace-mode | Toggle whitespace-mode. |
You can make trailing whitespace at the end of a line visible by setting the buffer-local variable
show-trailing-whitespace
to t
. Then Emacs displays trailing whitespace, using the face
trailing-whitespace
. Psimacs disables this feature on default.
Key binding | Command | Description |
---|---|---|
H-x C-w d | M-x psimacs/whitespace/delete-trailing-whitespace | Delete trailing white spaces. |
H-x C-w t | M-x psimacs/whitespace/toggle-auto-delete-trailing-whitespace-on-save | Toggle auto deletion of white spaces on buffer save. |
The package hungry-delete-mode implements hungry deletion, meaning that deleting a whitespace character will delete all whitespace until the next non-whitespace character.
Refefences:
Key binding | Command | Description |
---|---|---|
H-d | M-x hungry-delete-forward | Delete the following character or all following whitespace. |
H-<DEL> | M-x hungry-delete-backward | Delete the preceding character or all preceding whitespace. |
The package zoom-frm allows the font resize of the current buffer, the current frame or of all frames.
It is an enhancement of the build-in M-x text-adjust-scale
command.
Key binding | Command | Description |
---|---|---|
H-m C-x C-0 | M-x zoom-frm-unzoom | Cancel zoom of frame. |
Package zoom provides a minor mode that takes care of managing the window sizes by enforcing a fixed and automatic balanced layout where the currently selected window is resized according to zoom-size which can be an absolute value in lines/columns, a ratio between the selected window and frame size or even a custom callback.
Zoom is an alternative to package Golden-Ratio which does have some problems to be convenient.
Key binding | Command | Description |
---|---|---|
H-m C-w + | M-x zoom | Zoom the current window and balance the others according to zoom-size . |
H-m C-w C-z | M-x zoom-mode | Toggle automatic window resizing with zoom. |
The package ace-window allows easy window switching.
When there are two windows, ace-window will call
other-window
. If there are more, each window will have the first character of its window label highlighted at the upper left of the window. Pressing that character will either switch to that window or filter to the next character needed to select a specific window. Note that, unlike ace-jump-mode, the position of point will not be changed, i.e. the same behavior as that ofother-window
.
Key binding | Command | Description |
---|---|---|
C-x o | M-x ace-window | Either other-window or easy switching by first character of window label. Swap window with prefix C-u and delete selected window with double prefix C-u C-u . |
C-x O | M-x other-frame | Switch to the next frame in ring. |
H-m C-w C-x s | M-x psimacs/config/toggle-ace-scope | Toggle scope of ace-window between ‘global’ and ‘frame’ scope. |
If ace-window
is active the following key bindings are available:
Key binding | Command | Description |
---|---|---|
z | aw-make-frame | Create a new frame. |
x | aw-delete-window | Delete Window. |
m | aw-swap-window | Swap Windows. |
M | aw-move-window | Move Window. |
c | aw-copy-window | Copy Window. |
j | aw-switch-buffer-in-window | Select Buffer. |
n | aw-flip-window | Select the previous window. |
u | aw-switch-buffer-other-window | Switch Buffer Other Window. |
e | aw-execute-command-other-window | Execute Command Other Window. |
F | aw-split-window-fair | Split Fair Window. |
v | aw-split-window-vert | Split Vert Window. |
b | aw-split-window-horz | Split Horz Window. |
o | delete-other-windows | Delete Other Windows. |
T | aw-transpose-frame | Transpose Frame. |
? | aw-show-dispatch-help | Show this table for help. |
winner-mode lets you use
C-c <left>
and C-c <right>
to switch between window configurations. This is handy when something has popped
up a buffer that you want to look at briefly before returning to whatever you were working on.
When you’re done, press C-c <left>
.
See also:
Key binding | Command | Description |
---|---|---|
C-c <left> | M-x winner-undo | Switch back to an earlier window configuration saved by Winner mode. |
C-c <right> | M-x winner-redo | Restore a more recent window configuration saved by Winner mode. |
The Ediff package provides a comprehensive visual interface to Unix diff and patch utilities.
From the Ediff Introduction
Ediff provides a convenient way for simultaneous browsing through the differences between a pair (or a triple) of files or buffers. The files being compared, file-A, file-B, and file-C are shown in separate windows (side by side, one above the another, or in separate frames), and the differences are highlighted as you step through them. You can also copy difference regions from one buffer to another (and recover old differences if you change your mind).
Another powerful feature is the ability to merge a pair of files into a third buffer. Merging with an ancestor file, (a.k.a. 3way merges) is also supported. Furthermore, Ediff is equipped with directory-level capabilities that allow the user to conveniently launch browsing or merging sessions on groups of files in two (or three) different directories.
In addition, Ediff can apply a patch to a file and then let you step through both files, the patched and the original one, simultaneously, difference-by-difference.
Command | Description |
---|---|
M-x ediff-files | Compare two files. |
M-x ediff | dito |
M-x ediff-backup | Compare a file with its backup. If there are several numerical backups, use the latest. If the file is itself a backup, then compare it with its original. |
M-x ediff-current-file | Compare the buffer with its file on disk. This function can be used as a safe version of revert-buffer. |
M-x ediff-buffers | Compare two buffers. |
M-x ediff-files3 | Compare three files. |
M-x ediff3 | dito |
M-x ediff-buffers3 | Compare three buffers. |
M-x edirs | Compare files common to two directories. |
M-x ediff-directories | dito |
M-x edirs3 | Compare files common to three directories. |
M-x ediff-directories3 | dito |
M-x edir-revisions | Compare versions of files in a given directory. Ediff selects only the files that are under version control. |
M-x ediff-directory-revisions | dito |
M-x edir-merge-revisions | Merge versions of files in a given directory. Ediff selects only the files that are under version control. |
M-x ediff-merge-directory-revisions | dito |
M-x edir-merge-revisions-with-ancestor | Merge versions of files in a given directory using other versions as ancestors. Ediff selects only the files that are under version control. |
M-x ediff-merge-directory-revisions-with-ancestor | dito |
M-x ediff-windows-wordwise | Compare text visible in 2 windows word-by-word. |
M-x ediff-windows-linewise | Compare text visible in 2 windows line-by-line. |
M-x ediff-regions-wordwise | Compare regions word-by-word. The regions can come from the same buffer and they can even overlap. You will be asked to specify the buffers that contain the regions, which you want to compare. For each buffer, you will also be asked to mark the regions to be compared. |
M-x ediff-regions-linewise | Similar to ediff-windows-linewise, but compares the regions line-by-line. See ediff-windows-linewise for more details. |
M-x ediff-revision | Compare versions of the current buffer, if the buffer is visiting a file under version control. |
M-x ediff-patch-file | Patch a file or multiple files, then compare. Since the patch might be in a buffer or a file, you will be asked which is the case. To avoid this extra prompt, you can invoke this command with a prefix argument. With an odd prefix argument, Ediff assumes the patch is in a file; with an even argument, a buffer is assumed. |
M-x epatch | dito |
M-x ediff-patch-buffer | Patch a buffer, then compare. The buffer being patched and the file visited by that buffer (if any) is not modified. The result of the patch appears in some other buffer that has the name ending with _patched. |
M-x epatch-buffer | dito |
M-x ediff-merge-files | Merge two files. |
M-x ediff-merge | dito |
M-x ediff-merge-files-with-ancestor | Like ediff-merge, but with a third ancestor file. |
M-x ediff-merge-with-ancestor | dito |
M-x ediff-merge-buffers | Merge two buffers. |
M-x ediff-merge-buffers-with-ancestor | Same but with ancestor. |
M-x edirs-merge | Merge files common to two directories. |
M-x ediff-merge-directories | dito |
M-x edirs-merge-with-ancestor | Same but using files in a third directory as ancestors. |
M-x ediff-merge-directories-with-ancestor | dito |
M-x ediff-merge-revisions | Merge two versions of the file visited by the current buffer. |
M-x ediff-merge-revisions-with-ancestor | Same but with ancestor. |
M-x ediff-documentation | Brings up the Ediff manual. |
M-x ediff-show-registry | Brings up Ediff session registry. This feature enables you to quickly find and restart active Ediff sessions. |
M-x eregistry | dito |
Remarks:
- All Ediff commands are displayed in a Quick Help window, unless you type
?
to shrink the window to just one line. You can redisplay the help window by typing?
again. - Many Ediff commands take numeric prefix arguments.
- Some commands take negative prefix arguments as well.
- Without the prefix argument, all commands operate on the currently selected difference region.
Command | Description |
---|---|
? | Toggles the Ediff Quick Help window ON and OFF. |
E | Brings up the top node of the Ediff manual. |
v | Scrolls up buffers A and B (and buffer C where appropriate) in a coordinated fashion. |
V | Scrolls the buffers down. |
< | Scrolls the buffers to the left simultaneously. |
> | Scrolls buffers to the right. |
wd | Saves the output from the diff utility, for further reference. |
wa | Saves buffer A, if it was modified. |
wb | Saves buffer B, if it was modified. |
wc | Saves buffer C, if it was modified |
a | In comparison sessions: Copies the current difference region from buffer A to buffer B (see rb). |
a | In merge sessions: Copies the current difference region from buffer A to the merge buffer (r). |
ab | Copies the current difference region from buffer A to buffer B. |
ac | Copies the difference region from buffer A to buffer C. |
ba | Copies the difference region from buffer B to buffer A. |
bc | Copies the difference region from buffer B to buffer C. |
ca | Copies the difference region from buffer C to buffer A. |
cb | Copies the difference region from buffer C to buffer B. |
p , DEL | Makes the previous difference region current. |
n , SPC | Makes the next difference region current. |
j , -j , Nj | Makes the very first difference region current. Makes the very first difference region current. Typing a number, N, and then j makes the difference region N current. |
ga | Makes current the difference region closest to the position of the point in buffer A. |
gb | Makes current the difference region closest to the position of the point in buffer B. |
gc | Makes current the difference region closest to the position of the point in buffer C. |
! | Recomputes the difference regions, bringing them up to date. |
* | Forces refinement of the current difference region, which highlights the exact words of disagreement among the buffers |
m | Displays the current Ediff session in a frame as wide as the physical display. |
┃ | Toggles the horizontal/vertical split of the Ediff display. |
@ | Toggles auto-refinement of difference regions. |
h | Cycles between full highlighting, the mode where fine differences are not highlighted (but computed), and the mode where highlighting is done with ASCII strings. |
r | Restores the old contents of the region in the merge buffer. |
ra | Restores the old contents of the current difference region in buffer A. |
rb | Restores the old contents of the current difference region in buffer B. |
rc | Restores the old contents of the current difference region in buffer C. |
## | Tell Ediff to skip over regions that disagree among themselves only in the amount of white space and line breaks. |
#c | Toggle case sensitivity in the diff program. |
#h | Ediff prompts you to specify regular expressions for each variant. Difference regions where each variant’s region matches the corresponding regular expression will be skipped from then on. |
#f | Does dual job: it focuses on regions that match the corresponding regular expressions. All other regions will be skipped over. |
A | Toggles the read-only property in buffer A. |
B | Toggles the read-only property in buffer B. |
C | Toggles the read-only property in buffer C. |
~ | Swaps the windows where buffers A and B are displayed. |
i | Displays all kinds of useful data about the current Ediff session. |
D | Runs ediff-custom-diff-program on the variants and displays the buffer containing the output. |
R | Displays a list of currently active Ediff sessions—the Ediff Registry. |
M | Shows the session group buffer that invoked the current Ediff session. |
z | Suspends the current Ediff session. The easiest way to resume a suspended Ediff session is through the registry of active sessions. |
q | Terminates this Ediff session. |
% | Toggles narrowing in Ediff buffers. |
C-l | Restores the usual Ediff window setup. This is the quickest way to resume an Ediff session, but it works only if the control panel of that session is visible. |
$$ | Skipping the regions where only one of the variants clashes with the ancestor but the other variant agrees with it. Typing $$ again undoes this setting. |
$* | When merging files with large number of differences, it is sometimes convenient to be able to skip the difference regions for which you already decided which variant is most appropriate. Typing $* will accomplish precisely this. |
/ | Toggle to display the ancestor file in 3way merges. |
& | On merge the right course of action is not always clear, and Ediff would use a default action. The above command changes the default action. |
s | Causes the merge window shrink to its minimum size, thereby exposing as much of the variant buffers as possible. Typing s again restores the original size of that window. |
+ | Combines the difference regions from buffers A and B and copies the result into the merge buffer. |
=== | Creates a child Ediff session for comparing regions in buffers A, B or C. |
See also:
Package goto-chg allows you to jump back to the last edited places.
Key binding | Command | Description |
---|---|---|
H-x H-, | M-x goto-last-change | Go to the point where the last edit was made in the current buffer. |
H-x H-. | M-x goto-last-change-reverse | Go back to more recent changes after goto-last-change have been used. |
The package Visible bookmarks provides visible, buffer local, bookmarks and the ability to jump forward and backward to the next bookmark. They are quite similar to the MS Visual Studio bookmarks I am used to.
See also:
Key binding | Command | Description |
---|---|---|
<f2> | M-x bm-next | Jump to the next bookmark. |
S-<f2> | M-x bm-previous | Jump to the previous bookmark. |
C-<f2> | M-x bm-toggle | Set or unset bookmark. |
C-S-<f2> | M-x bm-remove-all-current-buffer | Remove all bookmarks of the current buffer. |
Avy is a GNU Emacs package for jumping to visible text using a char-based decision tree.
Key binding | Command | Description |
---|---|---|
H-m C-s C-a c | M-x avy-goto-char | Input one char, jump to it with a tree. |
H-m C-s C-a C | M-x avy-goto-char-2 | Input two consecutive chars, jump to the first one with a tree. |
H-m C-s C-a t | M-x avy-goto-char-timer | Input an arbitrary amount of consecutive chars, jump to the first one with a tree. |
H-m C-s C-a T | M-x avy-org-goto-heading-timer | Type part of an Org heading. When you stop typing it will be jumped to; if more than one matches, you can jump to a heading with Avy. |
H-m C-s C-a l | M-x avy-goto-line | Input zero chars, jump to a line start with a tree. |
H-m C-s C-a w | M-x avy-goto-word-1 | Input one char at word start, jump to a word start with a tree. |
H-m C-s C-a W | M-x avy-goto-word-0 | Input zero chars, jump to a word start with a tree. |
Mosey is a GNU Emacs package that makes it easy to mosey back and forth in your buffers.
Key binding | Command | Description |
---|---|---|
H-m C-s C-m f | M-x mosey-forward | Mosey on forward. |
H-m C-s C-m b | M-x mosey-backward | Mosey on back. |
H-m C-s C-m F | M-x mosey-forward-bounce | Bounce forward a notch when it hits the beginning. |
H-m C-s C-m B | M-x mosey-backward-bounce | Bounce back a notch when it hits the end. |
H-m C-s C-m C-f | M-x mosey-forward-cycle | Loop around when it gets to one end or the other. |
H-m C-s C-m C-b | M-x mosey-backward-cycle | Loop around when it gets to one end or the other. |
Multiple-cursors is a very nice package that lets you create several cursors that all do the same thing as you type.
See also:
Remarks:
- Notice that the number of cursors active can be seen in the modeline.
- If you get out of multiple-cursors-mode and
yank
- it willyank
only from the kill-ring of main cursor. Toyank
from the kill-rings of every cursor useyank-rectangle
, normally found atC-x r y
.
Key binding | Command | Description |
---|---|---|
H-m H-c m n | M-x mc/mark-next-like-this | Adds a cursor and region at the next part of the buffer forwards that matches the current region. If no region is selected, it will just add a cursor on the next line. |
H-m H-c m p | M-x mc/mark-previous-like-this | Adds a cursor and region at the next part of the buffer backwards that matches the current region. |
H-m H-c m a | M-x mc/mark-all-like-this | Marks all parts of the buffer that matches the current region. |
H-m H-c m w n | M-x mc/mark-next-like-this-word | Adds a cursor and region at the next part of the buffer forwards that matches the current region, if no region is selected it selects the word at the point. If no region is selected, it will mark the word and add a cursor at the next occurrence. |
H-m H-c m w p | M-x mc/mark-previous-like-this-word | Adds a cursor and region at the next part of the buffer backwards that matches the current region, if no region is selected it selects the word at the point. |
H-m H-c m W n | M-x mc/mark-next-word-like-this | Like mc/mark-next-like-this but only for whole words. |
H-m H-c m W p | M-x mc/mark-previous-word-like-this | Like mc/mark-previous-like-this but only for whole words. |
H-m H-c m w a | M-x mc/mark-all-words-like-this | Like mc/mark-all-like-this but only for whole words. |
H-m H-c m s n | M-x mc/mark-next-like-this-symbol | Adds a cursor and region at the next part of the buffer forwards that matches the current region, if no region is selected it selects the symbol at the point. If no region is selected, it will mark the symbol and add a cursor at the next occurrence. |
H-m H-c m s p | M-x mc/mark-previous-like-this-symbol | Adds a cursor and region at the next part of the buffer backwards that matches the current region, if no region is selected it selects the symbol at the point. |
H-m H-c m S n | M-x mc/mark-next-symbol-like-this | Like mc/mark-next-like-this but only for whole symbols. |
H-m H-c m S p | M-x mc/mark-previous-symbol-like-this | Like mc/mark-previous-like-this but only for whole symbols. |
H-m H-c m s a | M-x mc/mark-all-symbols-like-this | Like mc/mark-all-like-this but only for whole symbols. |
H-m H-c m f a | M-x mc/mark-all-like-this-in-defun | Marks all parts of the current defun that matches the current region. |
H-m H-c m f w a | M-x mc/mark-all-words-like-this-in-defun | Like mc/mark-all-like-this-in-defun but only for whole words. |
H-m H-c m f s a | M-x mc/mark-all-symbols-like-this-in-defun | Like mc/mark-all-like-this-in-defun but only for whole symbols. |
H-m H-c m d a | M-x mc/mark-all-dwim | Tries to be smart about marking everything you want. Can be pressed multiple times. |
H-m H-c m m e | M-x mc/mark-more-like-this-extended | Use arrow keys to quickly mark/skip next/previous occurrences. |
C-S-<mouse-1> | M-x mc/add-cursor-on-click | Add a new cursor at click position. |
H-m H-c m m | M-x mc/mark-pop | Set a cursor at the current point and move to the next (different) position on the mark stack. This allows for fine grained control over the placement of cursors. |
H-m H-c m r a | M-x mc/mark-all-in-region | Prompts for a string to match in the region, adding cursors to all of them. |
H-m H-c m t = | =M-x mc/mark-sgml-tag-pair | Mark the current opening and closing tag. | |
H-m H-c u n | M-x mc/unmark-next-like-this | Remove the next cursor furthest down in the buffer. |
H-m H-c u p | M-x mc/unmark-previous-like-this | Remove the previous cursor furthest up in the buffer. |
H-m H-c s n | M-x mc/skip-to-next-like-this | Remove the cursor furthest down, marking the next occurrence down. |
H-m H-c s p | M-x mc/skip-to-previous-like-this | Remove the cursor furthest up, marking the next occurrence up. |
H-m H-c e l | M-x mc/edit-lines | Adds one cursor to each line in the current region. You can give it a positive or negative prefix to change how it behaves on too short lines. |
H-m H-c e C-a | M-x mc/edit-beginnings-of-lines | Add one cursor to the beginning of each line in the active region. |
H-m H-c e C-e | M-x mc/edit-ends-of-lines | Add one cursor to the end of each line in the active region. |
H-m H-c i n | M-x mc/insert-numbers | Insert increasing numbers for each cursor, top to bottom. |
H-m H-c i l | M-x mc/insert-letters | Insert increasing letters for each cursor, top to bottom. |
H-m H-c r s | M-x mc/sort-regions | Sort the marked regions alphabetically. |
H-m H-c r r | M-x mc/reverse-regions | Reverse the order of the marked regions. If nothing is selected with just one cursor, it will flip the sexp at point and the one below it. |
H-m H-c a r r = | =M-x set-rectangular-region-anchor | Think of this one as set-mark except you’re marking a rectangular region. | |
H-m H-c v a | M-x mc/vertical-align | Aligns all cursors vertically with a given CHARACTER to the one with the highest column number (the rightest). (Might not behave as intended if more than one cursors are on the same line.) |
H-m H-c v A | M-x mc/vertical-align-with-space | Aligns all cursors with whitespace like mc/vertical-align does. |
<return> | Will make <return> insert a newline. | |
C-j | Insert a newline in multiple-cursors-mode. | |
C-g | To get out of multiple-cursors-mode. This will first disable multiple regions before disabling multiple cursors. | |
C-v | M-x mc/cycle-forward | Scroll the screen down to center on each cursor. |
M-v | M-x mc/cycle-backward | Scroll the screen up to center on each cursor. |
C-; | M-x mc-hide-unmatched-lines-mode | Toggle hiding all lines without a cursor. |
The package pcre2el converts between PCRE, Emacs and rx regexp syntaxes.
See also:
- Wikipedia: Regular expression
- Wikipedia: PCRE
- Official PCRE - Perl Compatible Regular Expressions
- EmacsWiki: RegularExpression
- Emacs Manual: Regular Expressions
- Emacs Manual: Syntax of Regular Expressions
- Xah Lee’s Emacs: Regex Tutorial
- pcre2el: convert between PCRE, Emacs and rx regexp syntax,
- Easy Regexp Generation With Emacs,
Do-what-I-mean” commands:
Key binding | Command | Description |
---|---|---|
C-c / / | M-x rxt-explain | Pop up a buffer with pretty-printed `rx’ syntax for the regex at point. |
C-c / c | M-x rxt-convert-syntax | Convert regex at point to other kind of syntax, depending on major mode. |
C-c / x | M-x rxt-convert-to-rx | Convert regex at point to RX syntax. Chooses Emacs or PCRE syntax by major mode. |
C-c / ' | M-x rxt-convert-to-strings | Convert regex at point to RX syntax. Chooses Emacs or PCRE syntax by major mode. |
Commands that work on a PCRE regexp:
Key binding | Command | Description |
---|---|---|
C-c / p e | M-x rxt-pcre-to-elisp | Translate PCRE, a regexp in Perl-compatible syntax, to Emacs Lisp. |
C-c / % | M-x pcre-query-replace-regexp | Perform query-replace-regexp using PCRE syntax. |
C-c / p x | M-x rxt-pcre-to-rx | Translate PCRE, a regexp in Perl-compatible syntax, to `rx’ syntax. |
C-c / p ' | M-x rxt-pcre-to-strings | Return a list of all strings matched by PCRE, a Perl-compatible regexp. |
C-c / p / | M-x rxt-explain-pcre | Insert the pretty-printed `rx’ syntax for REGEXP in a new buffer. |
Commands that work on an Emacs regexp:
Key binding | Command | Description |
---|---|---|
C-c / e / | M-x rxt-explain-elisp | Insert the pretty-printed `rx’ syntax for REGEXP in a new buffer. |
C-c / e p | M-x rxt-elisp-to-pcre | Translate REGEXP, a regexp in Emacs Lisp syntax, to Perl-compatible syntax. |
C-c / e x | M-x rxt-elisp-to-rx | Translate REGEXP, a regexp in Emacs Lisp syntax, to `rx’ syntax. |
C-c / e ' | M-x rxt-elisp-to-strings | Return a list of all strings matched by REGEXP, an Emacs Lisp regexp. |
C-c / e t | M-x rxt-toggle-elisp-rx | Toggle the regexp near point between Elisp string and rx syntax. |
C-c / t | M-x rxt-toggle-elisp-rx | Toggle the regexp near point between Elisp string and rx syntax. |
The package visual-regexp provides the same functionality
like Emacs’s command replace-regexp
, but with live visual feedback directly in the buffer
See also:
Key binding | Command | Description |
---|---|---|
H-c r | M-x vr/replace | #ERROR |
H-c q | M-x vr/query-replace | query-replace-regexp with live visual feedback. |
H-c m | M-x vr/mc-mark | Convert regexp selection to multiple cursors. |
The package visual-regexp-steroids is an extension to package visual-regexp which enables the use of modern regexp engines (no more escaped group parentheses, and other goodies!).
In addition to that, you can optionally use the better regexp syntax to power
isearch-forward-regexp
and isearch-backward-regexp
.
For now, Python and pcre2el are supported out of the box.
See also:
Key binding | Command | Description |
---|---|---|
H-c s | M-x vr/isearch-forward | Like isearch-forward but with a PCRE regular expression. |
H-c p | M-x vr/isearch-backward | Like isearch-backward but with a PCRE regular expression. |
The package rg brings support for ripgrep to Psimacs.
ripgrep is a line-oriented search tool that recursively searches the current directory for a regex pattern. It is expected to be installed on the system and availbale through the search path of the os. Personally, I have it installed with MSYS2. By default, ripgrep will respect gitignore rules and automatically skip hidden files/directories and binary files. (To disable all automatic filtering by default, use rg -uuu.)
Emacs package rg allows you to interactively create searches, doing automatic searches based on the editing context, refining and modifying search results and much more. It is also highly configurable to be able to fit different users’ needs.
See also:
Key binding | Command | Description |
---|---|---|
C-c s | M-x rg-menu | Show the rg menu. |
C-c s r (rg) | Interactive search with regex. | |
C-c s t | Interactive search with literate string. | |
C-c s p (rg-project) | Project search | |
C-c s d (rg-dwim) | DWIM in current project. | |
C-u C-c s d (rg-dwim) | DWIM in current dir. | |
C-u C-u C-c s d (rg-dwim) | DWIM in current file. | |
M-x rg-dwim-project-dir | DWIM search in the current directory. | |
M-x rg-dwim-current-file | DWIM search in the current file. | |
M-x rg-dwim-project-dir | DWIM search in the current project. |
Flyspell enables on-the-fly spell checking in Emacs by the means of a minor mode. Flyspell highlights incorrect words as soon as they are completed or as soon as the cursor hits a new word.
Basically two spell checker programs are usable. At first there is Aspell and secondly there is hunspell. Psimacs
supports both backends. You can configure which one to use with the flag variable psimacs/internal/spell-checker-use-aspell
.
If this is set to t
the Aspell program will be used.
The following key bindings are defined for the spell checking mode.
Key binding | Command | Description |
---|---|---|
H-m C-f m | M-x flyspell-mode | Minor mode performing on-the-fly spelling checking. |
H-m C-f M | M-x flyspell-prog-mode | Turn on flyspell-mode for comments and strings. |
H-m C-f r | M-x flyspell-region | Checks all words inside a region. |
H-m C-f b | M-x flyspell-buffer | Checks the whole buffer. |
H-m C-f w | M-x flyspell-word | Spell check a word. |
C-, | M-x flyspell-goto-next-error | Go to the next detected error. |
C-. | M-x flyspell-auto-correct-word | Automatically Correct the current word. This command proposes various successive corrections for the current word. |
C-: | M-x flyspell-auto-correct-previous-word | Auto correct the first mispelled word that occurs before point. |
C-; | M-x flyspell-correct-wrapper | By default jumps to the first misspelled word before the point and prompts for correction and gets you back. Calling it with C-u gives ability to correct multiple misspelled words in one run. C-u C-u changes direction. C-u C-u C-u changes direction and enables multiple corrections. |
H-m C-f a | M-x flyspell-correct-at-point | To correct word at point. |
H-m C-f p | M-x flyspell-correct-previous | To correct any visible word before the point. |
H-m C-f n | M-x flyspell-correct-next | To correct any visible word after the point. |
H-m C-f c | M-x flyspell-check-previous-highlighted-word | Correct the closer misspelled word. |
M-x flyspell-correct-word | Pop up a menu of possible corrections for a misspelled word. The word checked is the word at the mouse position. | |
M-x flyspell-correct-word-before-point | Pop up a menu of possible corrections for misspelled word before point. | |
H-m C-f d | M-x psimac/spell/add-word-to-dict | Add the word at the current location to the private dictionary without question. |
H-m C-f g | M-x psimac/spell/switch-to-german | Change to german language dictionary. |
H-m C-f e | M-x psimac/spell/switch-to-english | Change to english language dictionary. |
H-m C-f t | M-x psimac/spell/toggle-language | Toggle german and english language dictionaries. |
Some more information about spell checking can be found in the following references:
- Aspell
- hunspell
- EmacsWiki: Interactive Spell
- Mozlla Dictionaries & Language Packs
- OpenOffice Spell Checker Extensions
- flyspell
- Run flyspell-buffer automatically after emacs loads a (tex)-file
LanguageTool provides a Java based spell and grammar checking tool. The langtool.el package gives access to that tool.
Key binding | Command | Description |
---|---|---|
H-m C-l b | M-x langtool-check-buffer | To check current buffer and show warnings. With prefix C-u check with different language. |
H-m C-l p | M-x langtool-goto-previous-error | Goto previous error. Obsoleted function. Should use langtool-correct-buffer . |
H-m C-l n | M-x langtool-goto-next-error | Goto next error. Obsoleted function. Should use langtool-correct-buffer . |
H-m C-l ; | M-x langtool-correct-buffer | Execute interactive correction after langtool-check-buffer . To correct marker follow LanguageTool suggestions. |
H-m C-l t | M-x langtool-switch-default-language | Switch ‘langtool-default-language’ to LANG |
H-m C-l m | M-x langtool-show-brief-message-at-point | Show error brief message at point. |
H-m C-l M | M-x langtool-show-message-at-point | Show error details at point.. |
H-m C-l B | M-x langtool-check-done | Finish LanguageTool process and cleanup existing colorized texts. |
The package google-translate allows to translate the strings using Google Translate Service directly from Emacs.
Psimacs pre defines the query language to German and the target laguage to English in variable
google-translate-translation-directions-alist
. If you do not like that setting, change it as it pleases you.
Psimacs binds the M-x google-translate-smooth-translate
command that allows easy translation between the
language pairs provided in the google-translate-translation-directions-alist
variable. You can toggle between
these pairs with C-n
and C-p
.
On default, Psimacs outputs the result of the translation process to a separate ‘translation buffer’. It then
puts the input focus into that buffer. That can easily be changed to output directly into the current buffer
by calling function psimacs/spell/google-tanslate/toggle-output-destination
.
Key binding | Command | Description |
---|---|---|
H-m C-t ; | M-x google-translate-smooth-translate | Translate a text using translation directions. Make a prompt in minibuffer for a text to translate. Default text is word at point. |
H-m C-t o | M-x psimacs/spell/google-tanslate/toggle-output-destination | Toggle output desination between ‘current buffer’ and ‘translation buffer’. |
M-x google-translate-at-point | Translates the word at point or the active region. | |
M-x google-translate-query-translate | Translate, and shows a buffer with available translations of the text. |
The package google-this provides a set of functions and keybindings for launching google searches from within Emacs.
Key binding | Command | Description |
---|---|---|
H-m C-x G RET | M-x google-this-search | Write and do a google search. Quote argument with PREFIX C-u . |
H-m C-x G t | M-x google-this | Decide what the user wants to google (always something under point). Quote argument with PREFIX C-u . Unlike google-this-search (which presents an empty prompt with “this” as the default value), this function inserts the query in the minibuffer to be edited. |
H-m C-x G n | M-x google-this-noconfirm | Decide what the user wants to google and go without confirmation. Quote argument with PREFIX C-u . Exactly like google-this or google-this-search , but don’t ask for confirmation. |
H-m C-x G g | M-x google-this-lucky-search | Exactly like google-this-search , but use the “I’m feeling lucky” option. Quote argument with PREFIX C-u . |
H-m C-x G SPC | M-x google-this-region | Google the current region. Quote argument with PREFIX C-u . |
H-m C-x G a | M-x google-this-ray | Google text between the point and end of the line. If there is a selected region, googles the region. |
H-m C-x G l | M-x google-this-line | Google the current line. Quote argument with PREFIX C-u . |
H-m C-x G s | M-x google-this-symbol | Google the current symbol. Quote argument with PREFIX C-u . |
H-m C-x G w | M-x google-this-word | Google the current word. Quote argument with PREFIX C-u . |
H-m C-x G i | M-x google-this-lucky-and-insert-url | Fetch the url that would be visited by ‘google-this-lucky’. |
H-m C-x G r | M-x google-this-cpp-reference | Visit the most probable cppreference.com page for this word. |
H-m C-x G f | M-x google-this-forecast | Search google for “weather”. With PREFIX C-u , ask for location. |
H-m C-x G e | M-x google-this-error | Google the current error in the compilation buffer. Quote argument with PREFIX C-u . |
H-m C-x G c | M-x google-this-translate-query-or-region | If region is active google-translate-at-point , otherwise google-translate-query-translate . |
The Swiper package provides with counsel-search a command that allows you to interactively search the Web. This command is available through the following binding:
Key binding | Command | Description |
---|---|---|
H-m C-s w RET | M-x counsel-search | Interactively search the web with counsel. |
H-m C-s w t | M-x psimacs/web/counsel/toggle-search-engine | Toggle the search engine of ‘counsel-search’ between duckduckgo and google. |
The package sx provides a full-featured Stack Exchange mode for Emacs.
If you are going to be doing any asking/answering/commenting/upvoting/downvoting/ etc., you must use sx-authenticate to provide SX with an authentication token to act on your behalf.
References:
Psimacs currently only provides minimal key bindings for sx, since its author does not actively participate in the StackExchange community.
Key binding | Command | Description |
---|---|---|
H-m C-x S RET | M-x sx-tab-all-questions | Display a list of All-Questions questions for SITE. |
H-m C-x S s | M-x sx-search | Display search on SITE for question titles containing QUERY. |
H-m C-x S r | M-x sx-question-list-refresh | Update the list of questions. |
The following table shows only the key bindings important for the author. The sx site provides many more bindings and commands that comes into play when you actively participate in the StackExchange world.
Key bindings | Description |
---|---|
RET | Open question buffer. |
p | Navigate to previous entry in list. |
n | Navigate to next entry in list. |
j | Navigate to previous entry while viewing the question in a separate buffer. |
k | Navigate to next entry while viewing the question in a separate buffer. |
s s | Switch site. |
v | Visit the thing-at-point in your browser. |
w | Copy the thing-at-point (usually a link). |
The package crux is a collection of useful extensions for Emacs. Crux bundles many useful interactive commands to enhance your overall Emacs experience.
See also:
Key binding | Command | Description |
---|---|---|
H-x H-x C-c o | M-x crux-open-with | Open the currently visited file with an external program. |
H-x H-x C-k | M-x crux-smart-kill-line | First kill to end of line, then kill the whole line. |
H-x H-x C-S-RET | M-x crux-smart-open-line-above | Insert an empty line above the current line and indent it properly. |
H-x H-x S-RET | M-x crux-smart-open-line | Insert an empty line and indent it properly (as in most IDEs). |
H-x H-x C-c n | M-x crux-cleanup-buffer-or-region | Fix indentation in buffer and strip whitespace. |
H-x H-x C-c f | M-x crux-recentf-find-file | Open recently visited file. |
H-x H-x C-c u | M-x crux-view-url | Open a new buffer containing the contents of URL. |
H-x H-x C-c e | M-x crux-eval-and-replace | Eval a bit of Emacs Lisp code and replace it with its result. |
H-x H-x C-x 4 t | M-x crux-transpose-windows | Transpose the buffers between two windows. |
H-x H-x C-c D | M-x crux-delete-file-and-buffer | Delete current file and buffer. |
H-x H-x C-c c | M-x crux-copy-file-preserve-attributes | Copy current file with file attributes preserved |
H-x H-x C-c d | M-x crux-duplicate-current-line-or-region | Duplicate the current line (or region). |
H-x H-x C-c M-d | M-x crux-duplicate-and-comment-current-line-or-region | Duplicate and comment the current line (or region). |
H-x H-x C-c r | M-x crux-rename-file-and-buffer | Rename the current buffer and its visiting file if any. |
H-x H-x C-c t | M-x crux-visit-term-buffer | Open a terminal emulator (ansi-term). |
H-x H-x C-c k | M-x crux-kill-other-buffers | Kill all open buffers except the one you’re currently in. |
H-x H-x C-M z | M-x crux-indent-defun | Indent the definition at point. |
H-x H-x C-c TAB | M-x crux-indent-rigidly-and-copy-to-clipboard | Indent and copy region to clipboard |
H-x H-x C-c I | M-x crux-find-user-init-file | Open user’s init file. |
H-x H-x C-c , | M-x crux-find-user-custom-file | Open user’s custom file. |
H-x H-x C-c S | M-x crux-find-shell-init-file | Open shell’s init file. |
H-x H-x C-j | M-x crux-top-join-line | Join lines |
H-x H-x C-K | M-x crux-kill-whole-line | Kill whole line |
H-x H-x C-BCK | M-x crux-kill-line-backwards | Kill line backwards |
H-x H-x C-S-BCK | M-x crux-kill-and-join-forward | If at end of line, join with following; otherwise kill line. |
H-x H-x C-c P | M-x crux-kill-buffer-truename | Kill absolute path of file visited in current buffer. |
H-x H-x C-c i | M-x crux-ispell-word-then-abbrev | Fix word using ispell and then save to abbrev. |
H-x H-x C-x C-u | M-x crux-upcase-region | Upcase-region when transient-mark-mode is on and region is active. |
H-x H-x C-x C-l | M-x crux-downcase-region | Downcase-region when transient-mark-mode is on and region is active. |
H-x H-x C-x M-c | M-x crux-capitalize-region | Capitalize-region when transient-mark-mode is on and region is active. |
H-x H-x M-o | M-x crux-other-window-or-switch-buffer | Select other window, or switch to most recent buffer if only one windows. |
The package iedit provides two Emacs minor modes
iedit-mode
and iedit-rectangle-mode
and allows you to edit one occurrence of some text
in a buffer (possibly narrowed) or region, and simultaneously have other occurrences edited
in the same way, with visual feedback as you type.
See also:
- Iedit - Edit multiple regions in the same way simultaneously
- WikiEmacs: Duplicate Start Of Line Or Region
- Multiple Cursors
Key binding | Command | Description |
---|---|---|
H-; | M-x iedit-mode | Toggle iedit-mode. |
The package duplicate-thing provides functionality that allows you to duplicate whatever’s marked, i.e. easy duplication of line or region, with comment out.
Duplicate line or region N times.
- If it has active mark, it will expand the selection and duplicate it.
- If it doesn’t have active mark, it will select current line and duplicate it.
Key binding | Command | Description |
---|---|---|
M-c | M-x psimacs/string/duplicate-thing | Duplicate whatever’s marked, i.e. easy duplication of line or region, with comment out. |
Provide access to the HTML documentation of Psimacs.
Key binding | Command | Description |
---|---|---|
H-h H-p c | M-x psimacs/help/browse-psimacs-config | Open default browser and shows the Psimacs configuration export. |
H-h H-p k | M-x psimacs/help/browse-psimacs-keys | Open default browser and shows the Psimacs keys. |
H-h H-p b | M-x psimacs/help/browse-psimacs-key-list | Open default browser and shows the Psimacs listed keys. |
H-h H-p C | M-x psimacs/help/org-psimacs-config | Open org buffer with Psimacs configuration. |
H-h H-p K | M-x psimacs/help/org-psimacs-keys | Open org buffer and shows the Psimacs keys. |
H-h H-p B | M-x psimacs/help/org-psimacs-key-list | Open org buffer and shows the psimacs listed keys. |
Psimacs uses the Helm as well as the Ivy / Counsel framework. It is more focused towards the Ivy / Counsel tools none the less. They both can be used side by side. In Psimacs, however Ivy / Counsel takes preference.
Helm is an Emacs framework for incremental completions and narrowing selections. It provides an easy-to-use API for developers wishing to build their own Helm applications in Emacs, powerful search tools and dozens of already built-in commands providing completion to almost everything. It is a must-have for anyone using Emacs as a main work environment.
References:
See also:
- Helm vs Ivy: What are the differences, what are the advantages?
- Why do you use Helm over Ivy?
- Ido vs helm vs ivy? Which is ones are the best?
- From helm, to ivy
Key bindings that related to Helm:
Key binding | Command | Description |
---|---|---|
C-x c | M-x helm-command-prefix | Prefix key for Helm commands. |
C-x c / | M-x helm-find | Helm for find shell command. |
C-x c 8 | M-x helm-ucs | Helm for ‘usc-names’. |
C-x c @ | M-x helm-list-elisp-packages | Helm for listing and handling packages. |
C-x c F | M-x helm-select-xfont | Helm to select Xfont. |
C-x c I | M-x helm-imenu-in-all-buffers | Helm for fetching imenu entries in all buffers with similar mode as current. |
C-x c a | M-x helm-apropos | Helm to describe commands, functions, variables and faces. |
C-x c b | M-x helm-resume | Resume a previous Helm session. |
C-x c c | M-x helm-colors | Helm for colors. |
C-x c e | M-x helm-etags-select | Helm for etags. |
C-x c f | M-x helm-multi-files | Like helm-for-files but running locate only on demand. |
C-x c i | M-x helm-imenu | Helm for imenu . |
C-x c l | M-x helm-locate | Helm for ‘Locate’. |
C-x c m | M-x helm-man-woman | Helm for Man and Woman pages. |
C-x c p | M-x helm-list-emacs-process | Helm for Emacs process. |
C-x c r | M-x helm-regexp | Helm for building regexps. |
C-x c s | M-x helm-surfraw | Helm to search PATTERN with search ENGINE. |
C-x c t | M-x helm-top | Helm for top command. |
C-x c C-, | M-x helm-calcul-expression | Helm for helm-source-calculation-result . |
C-x c C-: | M-x helm-eval-expression-with-eldoc | Helm for helm-source-evaluation-result with ‘eldoc’ support. |
C-x c <tab> | M-x helm-lisp-completion-at-point | Helm for Lisp symbol completion at point. |
C-x c h g | M-x helm-info-gnus | Helm for gnus info. |
C-x c h h | M-x helm-documentation | Helm for Helm documentation. |
C-x c h i | M-x helm-info-at-point | Helm for searching info at point. |
C-x c h r | M-x helm-info-emacs | Helm for Emacs info. |
C-x c C-c C-x | M-x helm-run-external-command | Helm to run external program asynchronously from Emacs. |
C-x c C-c SPC | M-x helm-all-mark-rings | Helm for helm-source-global-mark-ring and helm-source-mark-ring . |
C-x c C-c f | M-x helm-recentf | Helm for recently used files. |
C-x c M-x | M-x helm-M-x | Helm for Emacs commands |
C-x c C-c g | M-x helm-google-suggest | Helm for Google search with Google suggest. |
C-x c M-y | M-x helm-show-kill-ring | Helm for kill-ring . |
C-x c M-s o | M-x helm-occur | Helm for searching lines matching pattern in ‘current-buffer’. |
C-x c M-g a | M-x helm-do-grep-ag | Helm for grepping with AG in default directory. |
C-x c M-g i | M-x helm-gid | Helm for gid command line of ID-Utils . |
C-x c C-x C-b | M-x helm-buffers-list | Helm to list buffers. |
C-x c C-x C-f | M-x helm-find-files | Helm implementatio of find-file . |
C-x c C-x r b | M-x helm-filtered-bookmarks | Helm for bookmarks filtered by category. |
C-x c C-x r i | M-x helm-register | Helm for Emacs registers. |
H-h H-h b | M-x helm-descbinds | Helm for describe-bindings . |
H-h H-h m | M-x helm-describe-modes | Helm for describe-mode . |
M-x helm-help | Generate Helm’s help | |
M-x helm-info | Helm for searching Info files. | |
M-x helm-mode | Toggle generic helm completion. |
Emacs is quite a complicated beast that is not easy to get acquainted with. Fortunately, few packages are available that mitigate the learning curve. The following packages let you discover key bindings, modes etc.
Package discover-my-major allows to discover key bindings and descriptions for commands defined by a buffer’s major and minor modes.
Key binding | Command | Description |
---|---|---|
H-h C-d m | M-x discover-my-major | Create a listing of all major-mode keys with their description. |
H-h C-d M | M-x discover-my-mode | Create a listing of all MODE keys with their description. |
The package helm-descbinds provides an interface to *Emacs’s describe-bindings
making the currently active key
bindings interactively searchable with helm.
Key binding | Command | Description |
---|---|---|
H-h H-h b | M-x helm-descbinds | Create a listing of all key bindings of current major mode. |
The package helm-describe-modes provides a Helm interface to Emacs’s describe-mode
. It lists the major mode,
active minor modes, and inactive minor modes using Helm, and provides actions for each mode.
Key binding | Command | Description |
---|---|---|
H-h H-h m | M-x helm-describe-modes | Create a listing of all modes of current major mode. |
Which-key is a minor mode for Emacs that displays the key bindings following your currently entered incomplete command (a prefix) in a popup. IMHO, this package is one of the most useful packages for Emacs.
Key binding | Command | Description |
---|---|---|
H-m C-u C-w t | M-x psimacs/which-key/toggle-sort-order | Toggle the which-key-mode sort order. |
H-m C-u C-w c | M-x psimacs/which-key/cycle-sort-order | Cycle through the which-key-mode sort orders. |
Swiper gives us a really efficient incremental search with regular expressions and Ivy / Counsel replace a lot of ido or helms completion functionality
See also:
Key binding | Command | Description |
---|---|---|
C-s | M-x swiper-iseach | A swiper that’s not line-based. Incrementally search with an overview. |
C-r | M-x swiper | Incrementally search with an overview. |
C-c v | M-x ivy-push-view | Push the current window tree on ivy-views |
C-c V | M-x ivy-pop-view | Delete a view to delete from ivy-views . |
H-m C-s a | M-x swiper-all | Incrementally search in all open buffers. |
H-m C-s s | M-x isearch-forward | Incrementally search forward. |
H-m C-s r | M-x isearch-backward | Incrementally search backward. |
H-s | M-x psimacs/config/isearch-menu | In isearch mode, opens an isearch menu, allowing to easily utilize the functionality. |
H-m C-s w RET | M-x counsel-search | Interactively search the web with counsel. |
H-m C-s w t | M-x psimacs/web/counsel/toggle-search-engine | Toggle the search engine of ‘counsel-search’ between duckduckgo and google. |
Ivy is for quick and easy selection from a list. When Emacs prompts for a string from a list of several possible choices, Ivy springs into action to assist in narrowing and picking the right string from a vast number of choices.
Key binding | Command | Description |
---|---|---|
C-x b | M-x ivy-switch-buffer | Switch to another buffer. |
C-c C-S-r | M-x ivy-resume | Resumes the last Ivy-based completion. |
M-y | M-x ivy-next-line | In minibuffer, Move cursor vertically down. |
H-w C-' | M-x ivy-avy | Uses avy to select one of the candidates on the current candidate page. |
See also Ivy User Manual
The package ivy-hydra provides a hydra for ivy.
Key binding | Command | Description |
---|---|---|
H-SPC i | M-x hydra-ivy/body | Ivy… |
To keep concerns separated, Ivy doesn’t have a lot of other functionality. That’s where Counsel comes in.
Ivy mode ensures that any Emacs command using completing-read-function
uses ivy for completion.
Counsel takes this further, providing versions of common Emacs commands that are customised to make
the best use of ivy.
Key binding | Command | Description |
---|---|---|
M-x | M-x counsel-M-x | Ivy version of execute-extended-command . |
C-M-i | M-x counsel-imenu | Jump to a buffer position indexed by imenu . |
C-x C-f | M-x counsel-find-file | Counsel, forward to find-file . |
C-c b | M-x counsel-bookmark | Forward to bookmark-jump or bookmark-set if bookmark does not exist. |
C-c c | M-x counsel-compile | Call compile completing with smart suggestions, optionally for DIR. |
C-c d | M-x counsel-dired-jump | Jump to a directory below the current directory. |
C-c F | M-x counsel-org-file | Browse all attachments for current Org file. |
C-c g | M-x counsel-git | Find file in the current git repository. |
C-c j | M-x counsel-git-grep | Grep for a string in the current Git repository. |
C-c L | M-x counsel-git-log | Call the git log --grep shell command. |
C-c J | M-x counsel-file-jump | Jump to a file below the current directory.. |
C-c k | M-x counsel-ag | Grep for a string in a root directory using ag . |
C-c l | M-x counsel-locate | Call a “locate” style shell command. |
M-y | M-x counsel-yank-pop | Ivy replacement for yank-pop . |
C-h f | M-x counsel-describe-function | Forward to describe-function . |
C-h i | M-x counsel-info-lookup-symbol | Forward SYMBOL to info-lookup-symbol with ivy completion. |
C-h j | M-x counsel-set-variable | Set a variable SYM with completion. |
C-h l | M-x counsel-find-library | Find Emacs Lisp source. Forward to find-library . |
C-h u | M-x counsel-unicode-char | Insert COUNT copies of a unicode char at point. |
C-h v | M-x counsel-describe-variable | Forward to describe-function . |
C-r | M-x counsel-minibuffer-history | Browse minibuffer history. |
C-r | M-x counsel-expression-history | In read-expression-map |
It provides several enhancements over the ordinary execute-extended-command
, such as prioritizing
your most-used commands in the completion list and showing keyboard shortcuts.
Key binding | Command | Description |
---|---|---|
H-m H-x x | M-x amx-major-mode-commands | Runs Amx, limited to commands that are relevant to the active major mode. |
H-m H-x m | M-x amx-mode | Toggle amx-mode. |
H-m H-x u | M-x amx-show-unbound-commands | Shows frequently used commands that have no key bindings. |
The package frog-jump-buffer is the spiritual successor to
ace-jump-buffer and is powered by avy via frog-menu. Just like ace-jump-buffer
, it allows you to hop to any
Emacs buffer in 2-3 key strokes.
Key binding | Command | Description |
---|---|---|
H-b | M-x frog-jump-buffer | Presents a frog-menu for jumping to an open buffer. |
H-B | M-x frog-jump-buffer-other-window | Presents a frog-menu for jumping to an open buffer in other window. |
Company is a text completion framework for Emacs. The name stands for “complete anything”. It uses pluggable back-ends and front-ends to retrieve and display completion candidates.
It comes with several back-ends such as Elisp, Clang, Semantic, Eclim, Ropemacs, Ispell, CMake, BBDB, YASnippet, dabbrev, etags, gtags, files, keywords and a few others.
See also:
- company-mode
- EmacsWiki: Company Mode
- Third Party Packages
- Company vs. AutoComplete
- Emacs Company Mode
Key binding | Command | Description |
---|---|---|
C-n | M-x company-select-next | Next completion. |
C-p | M-x company-select-previous | Previous completion. |
ESC | M-x company-abort | Abort completion. |
TAB | M-x company-complete-selection | Complete Selection. |
company-try-hard is a package that enhances the company-mode. It provides a company-complete
alternative
that tries much harder to find completions. If none of the current completions look good, call
the command again to try the next backend.
Key binding | Command | Description |
---|---|---|
H-m <tab> | M-x company-try-hard | Try hard to find a completion. If none of the current completions look good, call the command again to try the next backend. |
The package Yasnippet provides a template system for Emacs. It allows you to type an abbreviation and automatically expand it into function templates.
Bundled language templates include:
See also:
- EmacsWiki: Yasnippet
- Using Templates with YASnippet
- Yet another snippet extension
- Having Emacs Type for You
- Using YASnippet in Emacs
Key binding | Command | Description |
---|---|---|
H-x x | M-x yas-insert-snippet | Choose a snippet to expand, popup a list of choices according. |
C-c & C-n | M-x yas-new-snippet | Creates a new buffer with a template for making a new snippet. |
C-c & C-v | M-x yas-visit-snippet-file | Prompts you for possible snippet expansions and takes you directly to the snippet definition’s file, if it exists. |
C-c C-l | M-x yas-load-snippet-buffer | Prompts for a snippet table and loads the snippet currently being edited. |
C-c C-c | M-x yas-load-snippet-buffer-and-close | Prompts for a snippet table and loads the snippet currently being edited. Also saves the snippet and calls quit-window. The destination is decided based on the chosen snippet table and snippet collection directly. |
C-c C-t | M-x yas-tryout-snippet | When editing a snippet, this opens a new empty buffer, sets it to the appropriate major mode and inserts the snippet there, so you can see what it looks like. |
Auto-YASnippet is a hybrid of keyboard macros and YASnippet. You create the snippet on the go and it’ll be ready to use immediately. Because you’re not leaving the current buffer the workflow is very fast.
Key binding | Command | Description |
---|---|---|
H-m C-y w | M-x aya-create | Create a snippet from the text between BEG and END. |
H-m C-y TAB | M-x aya-expand | Insert the last yasnippet created by aya-create . |
H-m C-y SPC | M-x aya-expand-from-history | Select and insert a yasnippet from the aya-history . |
H-m C-y d | M-x aya-delete-from-history | Select and delete one or more snippets from aya-history . |
H-m C-y c | M-x aya-clear-history | Clear aya-history . |
H-m C-y n | M-x aya-next-in-history | Set aya-current to the next item in history. Wraps at the end of history. |
H-m C-y p | M-x aya-previous-in-history | Set aya-current to the previous item in history. Wraps around at start of history. |
H-m C-y s | M-x aya-persist-snippet | Save the current auto-snippet to a user snippets folder. The current major-mode name will be used to determine the snippets sub-directory to store the snippet. |
H-m C-y o | M-x aya-open-line | Generic expansion function. It will either expand or move to the next field depending on the context. |
Treemacs is a tree layout file explorer for Emacs.
Key bindings | Description |
---|---|
? | Summon the helpful hydra. |
n | Next item. |
p | Previous item. |
M-n | Next item on same level. |
M-p | Previous item on same level. |
u | Parent item. |
C-n | Next project. |
C-p | Previous project. |
o | Open… |
q | Quit treemacs. |
Key binding | Command | Description |
---|---|---|
H-m C-x C-t | M-x treemacs | Open treemacs. |
H-m C-x t t | M-x treemacs-select-window | Select the treemacs window. |
H-m C-x t 1 | M-x treemacs-delete-other-windows | Same as delete-other-window but does not delete the treemacs window. |
H-m C-x t B | M-x treemacs-bookmark | Find a bookmark in treemacs. |
H-m C-x t C-t | M-x treemacs-find-file | Find and focus the current file in the current treemacs window. |
H-m C-x t M-t | M-x treemacs-find-tag | Find and move the point to the tag at point in the treemacs view. |
Package Neotree provides a file tree browser for Emacs. File tree browser.
Bindings in the Neotree buffer:
Key bindings | Description |
---|---|
n | Next item. |
p | Previous item. |
SPC | Open current item if it is a file. Fold/Unfold current item if it is a directory. |
RET | Same as SPC . |
TAB | Same as SPC and RET . |
O | Recursively open a directory. |
U | Up diretory. |
g | Refresh. |
A | Maximize/Minimize Neotree window. |
H | Toggle display of hidden files. |
C-c C-n | Create a file or create a directory if filename ends with a ‘/’. |
C-c C-d | Delete a file or directory. |
C-c C-r | Rename a file or directory. |
C-c C-c | Change the root directory. |
C-c C-p | Copy a file or directory. |
Global bindings:
Key binding | Command | Description |
---|---|---|
H-m C-x C-n | M-x neotree-toggle | Open Neotree. |
Project management is important in order to be able to work with projects that consist of many files and that have special project related rules.
One of the most important thing to install at first is projectile, for manage projects in Emacs.
Projectile is a project interaction library for Emacs. Its goal is to provide a nice set of features operating on a project level without introducing external dependencies. This library provides easy project management and navigation.
The concept of a project is pretty basic - just a folder containing special file.
See also:
Only the basic commands:
Key binding | Command | Description |
---|---|---|
C-c p f | M-x projectile-find-file | Find file in current project |
C-c p p | M-x projectile-switch-project | Switch project |
C-c p s g | M-x projectile-grep | Grep in project |
C-c p r | M-x projectile-replace | Replace in project |
C-c p m | M-x projectile-commander | Invoke a command via the Projectile Commander |
All bound commands:
Key binding | Command | Description |
---|---|---|
C-c p f | M-x projectile-find-file | Display a list of all files in the project. With a prefix argument it will clear the cache first.Find file in current project. |
C-c p F | M-x projectile-find-file-in-known-projects | Display a list of all files in all known projects. |
C-c p g | M-x projectile-find-file-dwim | Display a list of all files at point in the project. With a prefix argument it will clear the cache first. |
C-c p 4 f | M-x projectile-find-file-other-window | Jump to a project’s file using completion and show it in another window. |
C-c p 4 g | M-x projectile-find-file-dwim-other-window | Jump to a project’s file based on context at point and show it in another window. |
C-c p 5 f | M-x projectile-find-file-other-frame | Jump to a project’s file using completion and show it in another frame. |
C-c p 5 g | M-x projectile-find-file-dwim-other-frame | Jump to a project’s file based on context at point and show it in another frame. |
C-c p a | M-x projectile-find-other-file | Switch between files with the same name but different extensions. |
C-c p 4 a | M-x projectile-find-other-file-other-window | Switch between files with the same name but different extensions in other window. |
C-c p 5 a | M-x projectile-find-other-file-other-frame | Switch between files with the same name but different extensions in other frame. |
C-c p l | M-x projectile-find-file-in-directory | Display a list of all files in a directory (that’s not necessarily a project). |
C-c p e | M-x projectile-recentf | Shows a list of recently visited project files. |
C-c p d | M-x projectile-find-dir | Display a list of all directories in the project. With a prefix argument it will clear the cache first. |
C-c p 4 d | M-x projectile-find-dir-other-window | Switch to a project directory and show it in another window. |
C-c p 5 d | M-x projectile-find-dir-other-frame | Switch to a project directory and show it in another frame. |
C-c p D | M-x projectile-dired | Opens the root of the project in dired. |
C-c p 4 D | M-x projectile-dired-other-window | Opens the root of the project in dired in another window. |
C-c p 5 D | M-x projectile-dired-other-frame | Opens the root of the project in dired in another frame. |
C-c p j | M-x projectile-find-tag | Find tag in project. |
C-c p T | M-x projectile-find-test-file | Display a list of all test files(specs, features, etc) in the project. |
C-c p s g | M-x projectile-grep | Run grep on the files in the project. |
M-- C-c p s g | Run grep on projectile-grep-default-files in the project. | |
C-c p v | M-x projectile-vc | Run vc-dir on the root directory of the project. |
C-c p V | M-x projectile-browse-dirty-projects | Browse dirty version controlled projects. |
C-c p I | M-x projectile-ibuffer | Open an IBuffer window showing all buffers in the current project. |
C-c p b | M-x projectile-switch-to-buffer | Display a list of all project buffers currently open. |
C-c p 4 b | M-x projectile-switch-to-buffer-other-window | Switch to a project buffer and show it in another window. |
C-c p 5 b | M-x projectile-switch-to-buffer-other-frame | Switch to a project buffer and show it in another frame. |
C-c p 4 C-o | M-x projectile-display-buffer | Display a project buffer in another window without selecting it. |
C-c p k | M-x projectile-kill-buffer | Kills all project buffers. |
C-c p o | M-x projectile-multi-occur | Runs multi-occur on all project buffers currently open. |
C-c p r | M-x projectile-replace | Runs interactive query-replace on all files in the projects. |
C-c p R | M-x projectile-regenerate-tags | Regenerate the project’s tags. |
C-c p s r | M-x projectile-ripgrep | Run a Ripgrep search with ‘SEARCH-TERM’ at current root. |
C-c p i | M-x projectile-invalidate-cache | Invalidates the project cache (if existing). |
C-c p p | M-x projectile-switch-project | Display a list of known projects you can switch to. |
C-c p S | M-x projectile-save-project-buffers | Save all project buffers. |
C-c p <left> | M-x projectile-previous-project-buffer | Switch to the previous project buffer. |
C-c p <right> | M-x projectile-next-project-buffer | Switch to the next project buffer. |
C-c p q | M-x projectile-switch-open-project | Switch to a project we have currently opened. |
C-c p ESC | M-x projectile-project-buffers-other-buffer | Switch to the most recently selected Projectile buffer. |
C-c p E | M-x projectile-edit-dir-locals | Opens the root dir-locals-file of the project. |
C-c p s s | M-x projectile-ag | Runs ag on the project, performing a literal search. |
C-c p ! | M-x projectile-run-shell-command-in-root | Runs shell-command in the root directory of the project. |
C-c p x s | M-x projectile-run-shell | Invoke ‘shell’ in the project’s root. |
C-c p x v | M-x projectile-run-vterm | Invoke ‘vterm’ in the project’s root. |
C-c p x e | M-x projectile-run-eshell | Invoke ‘eshell’ in the project’s root. |
C-c p u | M-x projectile-run-project | Run project run command. |
C-c p P | M-x projectile-test-project | Run project test command. |
C-c p x g | M-x projectile-run-gdb | Invoke ‘gdb’ in the project root. |
C-c p & | M-x projectile-run-async-shell-command-in-root | Runs async-shell-command in the root directory of the project. |
C-c p C | M-x projectile-configure-project | Runs a standard configure command for your type of project. |
C-c p c | M-x projectile-compile-project | Runs a standard compilation command for your type of project. |
C-c p L | M-x projectile-install-project | Run project install command. |
C-c p K | M-x projectile-package-project | Run project package command. |
C-c p t | M-x projectile-toggle-between-implementation-and-test | Toggle between an implementation file and its test file. |
C-c p 4 t | M-x projectile-find-implementation-or-test-other-window | Jump to implementation or test file in other window. |
C-c p 5 t | M-x projectile-find-implementation-or-test-other-frame | Jump to implementation or test file in other frame. |
C-c p z | M-x projectile-cache-current-file | Adds the currently visited file to the cache. |
C-c p m | M-x projectile-commander | Execute a Projectile command with a single letter. |
C-c p C-e e c | M-x psimacs/projectile/create-projectile-envrc-emscripten | Write a .projectile-envrc file for Emscripten support into the current projectile project root. |
C-c p C-e e d | M-x psimacs/projectile/destroy-projectile-envrc-emscripten | Remove the .projectile-envrc file for Emscripten from the current projectile project root. |
Special global commands:
Key binding | Command | Description |
---|---|---|
C-c p C-n | M-x psimacs/projectile/create-empty-projectile-file | Choose diretory and create an empty ‘.projectile’ file. |
The package projectile-envrc allows setting, modifying and removing of process environment variables from a simple ‘.projectile-envrc’ description file that resides in the projectile project root directory.
The file format for ‘.projectile-envrc’ is quite simple: Only lines that begin with ‘+’, ‘-‘, ’:’ or ‘:’ are considered. Everything else is ignored.
Specifier | Description |
---|---|
+ | Add variable/value to the process environent. |
- | Remove variable from the process environent. |
*: | Prepend to the process environment variable. |
:* | Append to the process environment variable. |
Example ‘.projectile-envrc’ file:
# # Hi there this is ignored # +TIK = Hallo World +TAK = "A small test" *:PATH = c:/utils/testA *:PATH = c:/utils/testB :*PATH = c:/utils/testC :*PATH = c:/utils/testD +TOK = c:/utils/testE -OSG_LOG_FILE +TOE = c:/utils/testF
The package projectile-cmake gives fine grained support of CMake with Emacs projectile.
Key binding | Command | Description |
---|---|---|
C-c C-p s C | M-x projectile-cmake-select-configuration | Select the cmake configuration data. Convenience function calling other select functions. |
C-c C-p s d | M-x projectile-cmake-select-build-dir | Select the current project build dir. |
C-c C-p s t | M-x projectile-cmake-select-build-type | Select the current project build type. |
C-c C-p s g | M-x projectile-cmake-select-generator | Select the current project configuration generator. |
C-c C-p s a | M-x projectile-cmake-select-architecture | Select the current project configuration architecture. |
C-c C-p s s | M-x projectile-cmake-select-toolset | Select the current project configuration toolset. |
C-c C-p s c | M-x projectile-cmake-select-toolchain | Select the current project configuration toolchain. |
C-c C-p s r g | M-x projectile-cmake-select-run-file | Select the file that should be run for the project. |
C-c C-p s r d | M-x projectile-cmake-select-run-file-debug | Select the file that should be run for the debug project. |
C-c C-p s r r | M-x projectile-cmake-select-run-file-release | Select the file that should be run for the release project. |
C-c C-p s r i | M-x projectile-cmake-select-run-file-release-with-debug-info | Select the file that should be run for the release with debug info project. |
C-c C-p s r m | M-x projectile-cmake-select-run-file-minimal-size-release | Select the file that should be run for the minimal size release project. |
C-c C-p t d | M-x projectile-cmake-toggle-run-in-build-dir | Toggle the run in build directory flag variable. |
C-c C-p h | M-x hydra-projectile-cmake/body | Hydra for projectile-cmake. |
The package treemacs-projectile is a small package that contains some utility functions that simplify adding your projectile projects to treemacs.
Key binding | Command | Description |
---|---|---|
H-m C-x t p | M-x treemacs-projectile | Add one of projectile-known-projects to the treemacs workspace. |
The dashboard is an extensible Emacs startup screen showing you what’s most important.
Key binding | Command | Description |
---|---|---|
C-<f8> | M-x psimacs/dashboard/open-dashboard | Open the dashboard. |
H | M-x psimacs/dashboard/homepage | Open the Psimacs homepage. |
R | M-x psimacs/dashboard/restore-previous-session | Restore previous session. |
L | M-x psimacs/dashboard/restore-session | Restore session. |
S | M-x psimacs/dashboard/open-custom-file | Open the Custom.el file. |
q Q | M-x psimacs/dashboard/quit-dashboard | Quit the dashboard. |
h | M-x psimacs/hydra/dashboard/body | Open dashboard hydra. |
? | M-x psimacs/hydra/dashboard/body | Open dashboard hydra. |
r | M-x psimacs/dashboard/goto-recent-files | Goto recent file section. |
m | M-x psimacs/dashboard/goto-bookmarks | Goto bookmarks section. |
p | M-x psimacs/dashboard/goto-projects | Goto projects section. |
a | M-x psimacs/dashboard/goto-agendas | Goto agenda section. |
e | M-x psimacs/dashboard/goto-registers | Goto register section. |
<ret> | M-x dashboard-return | Open item. |
<tab> C-i | M-x widget-forward | Next item. |
S-<tab> | M-x widget-backward | Previous item. |
j C-n | M-x dashboard-next-line | Next line. |
k C-p | M-x dashboard-previous-line | Previous line. |
Dashboard hyda bindings:
Key binding | Command | Description |
---|---|---|
H | M-x psimacs/dashboard/homepage | Open the Psimacs homepage. |
R | M-x psimacs/dashboard/restore-previous-session | Restore previous session. |
L | M-x psimacs/dashboard/restore-session | Restore session. |
S | M-x psimacs/dashboard/open-custom-file | Open the Custom.el file. |
q | Quit hydra | |
r | M-x psimacs/dashboard/goto-recent-files | Goto recent file section. |
m | M-x psimacs/dashboard/goto-bookmarks | Goto bookmarks section. |
p | M-x psimacs/dashboard/goto-projects | Goto projects section. |
a | M-x psimacs/dashboard/goto-agendas | Goto agenda section. |
e | M-x psimacs/dashboard/goto-registers | Goto register section. |
<ret> | M-x dashboard-return | Open item. |
<tab> C-i | M-x widget-forward | Next item. |
S-<tab> | M-x widget-backward | Previous item. |
j C-n | M-x dashboard-next-line | Next line. |
k C-p | M-x dashboard-previous-line | Previous line. |
C-<f8> | M-x psimacs/dashboard/open-dashboard | Open the dashboard. |
g | M-x dashboard-refresh-buffer | Refresh dashboard contents. |
Q | M-x psimacs/dashboard/quit-dashboard | Quit dashboard. |
The page-break-lines package provides a global mode which displays ugly form feed characters as tidy horizontal rules.
Key binding | Command | Description |
---|---|---|
C-x ] | M-x forward-page | Move forward to page boundary. |
C-x [ | M-x backward-page | Move backward to page boundary. |
Magit is an interface to the version control system Git , implemented as an Emacs package.
Magit is a complete text-based user interface to Git. It fills the glaring gap between the Git command-line interface and various GUIs, letting you perform trivial as well as elaborate version control tasks with just a couple of mnemonic key presses. Magit looks like a prettified version of what you get after running a few Git commands but in Magit every bit of visible information is also actionable to an extent that goes far beyond what any Git GUI provides and it takes care of automatically refreshing this output when it becomes outdated. In the background Magit just runs Git commands and if you wish you can see what exactly is being run, making it possible for you to learn the git command-line by using Magit.
Using Magit for a while will make you a more effective version control user. Magit supports and streamlines the use of Git features that most users and developers of other Git clients apparently thought could not be reasonably mapped to a non-command-line interface. Magit is both faster and more intuitive than either the command line or any GUI and these holds for both Git beginners and experts alike.
See also:
Key binding | Command | Description |
---|---|---|
C-x g | M-x magit-status | Run git status command. |
Peter Milliken has created a minor mode for Emacs called the Emacs Language Sensitive Editor (ELSE).
ELSE is a minor mode for Emacs, designed to work with any major mode. The aim is to provide a seamless mechanism to generate language constructs easily and intuitively with a minimum of keystrokes and interference with the user. It’s primary application is a minor mode for any programming language (major mode) but it can be used for any editing task that involves generation of repetitive text/blocks of text e.g. there is a template file for Texinfo mode.
See also:
- ELSE fork by me
- ELSE
- Emacs Language Sensitive Editor (ELSE)
- EmacsWiki: Else Mode
- Additional Emacs Language Sensitive Editor (ELSE) templates
- Else Documentation
Key binding | Command | Description |
---|---|---|
H-e | M-x else-expand | Expand the placeholder or any preceeding abbreviation at point. |
H-E | M-x else-expand-or-next-expand | Expand if possible else move to next and expand this one. |
H-n | M-x else-next | Move ‘point’ to the ‘next’ placeholder. |
H-p | M-x else-previous | Move `point’ to the (nth) previous placeholder. |
H-N | M-x else-expand-or-next-expand | Expand if possible else move to next and expand this one. |
H-P | M-x else-expand-or-previous-expand | Expand if possible else move to previous and expand this one. |
H-C-n | M-x else-kill-or-next-kill | Kill if possible else move to next and kill this one. |
H-C-p | M-x else-kill-or-previous-kill | Kill if possible else move to previous and kill this one. |
H-k | M-x else-kill | Kill the placeholder at point. |
H-K | M-x psimacs/else/kill-always | Like else-kill but kills required placeholders without prompting. |
H-m C-c m | M-x else-mode | Enable/disable else-mode . |
H-m C-c e | M-x else-expand | Expand the placeholder or any preceeding abbreviation at point. |
H-m C-c E | M-x else-expand-or-next-expand | Expand if possible else move to next and expand this one. |
H-m C-c n | M-x else-next | Move ‘point’ to the ‘next’ placeholder. |
H-m C-c p | M-x else-previous | Move `point’ to the (nth) previous placeholder. |
H-m C-c N | M-x else-expand-or-next-expand | Expand if possible else move to next and expand this one. |
H-m C-c P | M-x else-expand-or-previous-expand | Expand if possible else move to previous and expand this one. |
H-m C-c C-n | M-x else-kill-or-next-kill | Kill if possible else move to next and kill this one. |
H-m C-c C-p | M-x else-kill-or-previous-kill | Kill if possible else move to previous and kill this one. |
H-m C-c k | M-x else-kill | Kill the placeholder at point. |
H-m C-c K | M-x psimacs/else/kill-always | Like else-kill but kills required placeholders without prompting. |
H-m C-c C-c | M-x else-template-compile-buffer | Compile the whole current buffer. |
M-x else-compile-buffer | Compile the language template definitions. | |
M-x else-extract-placeholder | Place the definition of an placeholder into the buffer at point. | |
M-x else-extract-all | Extract the full language definition at point. | |
M-x else-show-placeholder-names | Display info on all Placeholders in the current language template set. |
ELSE, the Emacs Language Sensitive Editor, is a system for template generation aimed at reducing the amount of user typing and to operate seamlessly with a minimum of interference to the user. ELSE is implemented as a minor mode and can work with any major mode. As ELSE is invoked the first time for each major mode, it will load a template file specific to that mode.
The ELSE grammar compiler is a tool written specifically to generate these ELSE template files from an ANTLR language grammar specification.
The tools provided in this section provide a simple workflow for working on a ANTLR grammar file and creating a final ELSE template file ready to use in Psimacs.
Reference:
This simplistic ANTLRv4 major mode implementation allows to work on a ANTLRv4 file buffer. It provides syntax highlighting and supports the special annotation system that has been added to the ANTLRv4 specification in order to provide extra meta information for the ELSE framework.
Key binding | Command | Description |
---|---|---|
C-c C-c | M-x psimacs/antlrv4/create-else-grammar | Create a ELSE language specification from the ANTLRv4 grammar found in the current buffer. |
C-c C-v | M-x psimacs/antlrv4/create-visualization-from-grammar | Create a HTML visualization of the ANTLRv4 grammar found in the current buffer. |
String-inflection is a nifty package to cycle through string case styles: camel, snake, kebab… The package includes a handful of cycling functions for different languages (Ruby, Python and Java), but it’s easy to mix and match to roll your own.
Key binding | Command | Description |
---|---|---|
H-m H-l= | M-x string-inflection-all-cycle | foo_bar => FOO_BAR => FooBar => fooBar => foo-bar => Foo_Bar => foo_bar. |
The Language Server Protocol (v3.14) describes an client/server protocol for programming langugage servers and clients.
See also
Remarks:
cmake -H. -BDebug -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=YES
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
The package dap-mode provides an Emacs client library that allow the communication to a Debug server that supports the Debug Adapter Protocol, which is a wire protocol between the client and the Debug server. It’s similar to the Lsp-mode but provides integration with a debug server.
Dap-mode provides the following commands:
Key binding | Command | Description |
---|---|---|
<f9> | M-x dap-breakpoint-toggle | Toggle breakpoint at line. |
S-<f9> | M-x dap-breakpoint-delete | Delete breakpoint at line. |
C-S-<f9> | M-x dap-breakpoint-delete-all | Delete all breakpoints. |
C-<f9> | M-x dap-breakpoint-add | Add breakpoint at line. |
M-<f9> | M-x dap-breakpoint-condition | Set/unset breakpoint condition. |
C-M-<f9> | M-x dap-breakpoint-hit-condition | Set/unset breakpoint hit condition. |
S-M-<f9> | M-x dap-breakpoint-log-message | Set/unset breakpoint log message. |
M-x dap-eval | Eval string. | |
M-x dap-eval-region | Eval region string. | |
M-x dap-eval-thing-at-point | Eval symbol at point. | |
<f10> | M-x dap-next | Debug next. |
C-<f10> | M-x psimacs/dap/run-to-cursor | Add breakpoint at point and continue. |
<f11> | M-x dap-step-in | Debug step in. |
S-<f11> | M-x dap-step-out | Debug step out. |
M-x dap-stop-thread | Stop thread. | |
S-<f6> | M-x dap-restart-frame | Restarts current frame. |
<f6> | M-x dap-continue | Debug continue. |
S-<f5> | M-x dap-disconnect | Cancel current debug session. |
M-x dap-switch-stack-frame | Switch active stack frame. | |
M-x dap-switch-thread | Switch active thread. | |
M-x dap-switch-session | Switch active session. | |
M-x dap-debug-edit-template | Generate run command. | |
<f5> | M-x dap-debug | Create and run new configuration using the available templates. |
M-<f5> | M-x dap-debug-last | Debug previous configuration. |
C-M-<f5> | M-x dap-debug-recent | Select configuration to run from the previously started command. |
C-S-<f5> | M-x dap-debug-restart | Restarts current frame. |
M-x dap-go-to-output-buffer | Go output buffer. | |
M-x dap-ui-sessions | Show active/terminated sessions view. | |
M-x dap-ui-locals | Show locals view. | |
M-x dap-ui-expressions | Show expressions view. | |
M-x dap-ui-breakpoints | Show breakpoints view. | |
M-x dap-ui-repl | DAP UI REPL. | |
M-x dap-ui-mode | Display the DAP visuals. | |
M-x dap-ui-any-windows-mode | Show/Hide the windows from dap-auto-configure-features . | |
M-x dap-ui-show-many-windows | Show auto configured feature windows. | |
M-x dap-ui-hide-many-windows | Hide auto configured feature windows. | |
M-x dap-tm-loaded-sources | Loaded sources can be viewed by invoking this command. | |
C-c-l <tab> | M-x company-indent-or-complete-common | Indent the current line or region, or complete the common part. |
<f7> | M-x dap-hydra | Opens a dap-mode hydra. |
C-c l C-c h d | M-x dap-hydra | Opens a dap-mode hydra. |
H-SPC d | M-x dap-hydra | Opens a dap-mode hydra. |
Breakpoints can be viewed after invoking dap-ui-breakpoints
with:
Key binding | Command | Description |
---|---|---|
\-RET | M-x dap-ui-breakpoints-goto | Go to breakpoint under cursor. |
d | M-x dap-ui-breakpoints-delete | Delete breakpoint under cursor. |
D | M-x dap-ui-breakpoints-delete-selected | Delete selected breakpoints. |
m | M-x bui-list-mark | Mark breakpoint under point. |
u | M-x bui-list-unmark | Unmark breakpoint under point. |
U | M-x bui-list-unmark-all | Unmark breakpoint under point. |
Dap-mode supports launch.json
files out of the box, and there is nothing that needs to be enabled. All that
needs to be done is to add a launch.json
file at the project root and to run dap-debug
.
All configurations stored in the launch.json
will automatically show up in the selection.
launch.json
files in dap-mode are just like in VSCode and even support variables.
Remarks:
- Running
M-x dap-cpptools-setup
is necessary at least once. - Running
M-x dap-debug-edit-template
shows a function template to edit for a particular configuration. It looks like the following examples.
Lsp-mode is a client for Language Server Protocol (v3.14). Lsp-mode aims to provide IDE-like experience by providing optional integration with the most popular Emacs packages like company, Flycheck and projectile.
Currently, Psimacs uses lsp-mode for the following language modes:
- c-mode
- c++-mode
- cmake-mode
Python-mode is handled by elpy at the moment. That might be changed in the future.
When using lsp-mode most of the features depend on server capabilities.
Lsp-mode provides default bindings which are dynamically enabled/disabled based on the server functionality.
All the commands are configured lsp-command-map
which is bound to lsp-keymap-prefix
.
Psimacs binds lsp-mode commands to key prefix C-c l
.
Following a survey of the lsp-mode command bindings:
Key binding | Command | Description |
---|---|---|
C-c l s s | M-x lsp | Entry point for the server startup. |
C-c l s r | M-x lsp-workspace-restart | Restart workspace and language server. |
C-c l s q | M-x lsp-workspace-shutdown | Shutdown workspace and language server. |
C-c l s d | M-x lsp-describe-session | Describes current session. |
C-c l s D | M-x lsp-disconnect | Disconnect the buffer from the language server keeping the server running. |
C-c l = = | M-x lsp-format-buffer | Ask the server to format this document. |
C-c l = r | M-x lsp-format-region | Ask the server to format the region, or if none is selected, the current line. |
C-c l F a | M-x lsp-workspace-folders-add | Add new project root to the list of workspace folders. |
C-c l F r | M-x lsp-workspace-folders-remove | Remove project root from the list of workspace folders. |
C-c l F b | M-x lsp-workspace-blacklist-remove | Remove project root from the workspace blacklist. |
C-c l T a | M-x lsp-modeline-code-actions-mode | Toggle code actions on modeline. |
C-c l T b | M-x lsp-headerline-breadcrumb-mode | Toggle breadcrumb on headerline. |
C-c l T L | M-x lsp-toggle-trace-io | Toggle client-server protocol logging. |
C-c l T h | M-x lsp-toggle-symbol-highlight | Toggle symbol highlighting. |
C-c l T S | M-x lsp-ui-sideline-mode | Toggle minor mode for showing information for current line in sideline. |
C-c l T d | M-x lsp-ui-doc-mode | Toggle minor mode for showing hover information in child frame. |
C-c l T s | M-x lsp-toggle-signature-auto-activate | Toggle signature auto activate. |
C-c l T f | M-x lsp-toggle-on-type-formatiing | Toggle on type formatting. |
C-c l T D | M-x lsp-modeline-diagnostics-mode | Toggle diagnostics modeline. |
C-c l T T | M-x lsp-treemacs-sync-mode | Toggle global minor mode for synchronizing lsp-mode workspace folders and treemacs projects. |
C-c l g g | M-x lsp-find-definition | Find definitions of the symbol under point. |
C-c l g r | M-x lsp-find-references | Find references of the symbol under point. |
C-c l g e | M-x lsp-treemacs-errors-list | Display error list. |
C-c l g d | M-x lsp-find-declaration | Find declarations of the symbol under point. |
C-c l g h | M-x lsp-treemacs-call-hierarchy | Show the incoming call hierarchy for the symbol at point. |
C-c l g a | M-x xref-find-apropos | Find all meaningful symbols that match pattern. |
C-c l G s | M-x lsp-ui-peak-find-workspace-symbol | Find symbols in the workspace. |
C-c l h h | M-x lsp-describe-thing-at-point | Display the type signature and documentation of the thing at |
C-c l h s | M-x lsp-signature-activate | Activate signature help. |
C-c l h g | M-x lsp-ui-doc-glance | Trigger display hover information popup and hide it on next typing. |
C-c l r r | M-x lsp-rename | Rename the symbol (and all references to it). |
C-c l r o | M-x lsp-organize-imports | Perform the source.organizeImports code action, if available. |
C-c l a a | M-x lsp-execute-code-action | Execute code action. |
C-c l a h | M-x lsp-document-highlight | Highlight all relevant references to the symbol at point. |
C-c l G g | M-x lsp-ui-peek-find-definitions | Peek definitions to the identifier at point. |
C-c l G r | M-x lsp-ui-peek-find-references | Peek references to the identifier at point. |
C-c l G s | M-x lsp-ui-peek-workspace-symbol | Peek symbols in the workspace. |
C-c l C-c i | M-x lsp-ui-peek-find-implementation | Find implementation locations of the symbol at point. |
C-c l C-c m | M-x lsp-ui-imenu | Open ui-imenu in side window. |
C-c l C-c d | M-x psimacs/lsp-ui-mode/toggle-lsp-ui-doc | Minor mode for showing information in child frame. |
The package elisp-format format elisp code.
It provides the following commands:
Key binding | Command | Description |
---|---|---|
M-x elisp-format-region | Format region or defun. | |
M-x elisp-format-buffer | Format buffer. | |
M-x elisp-format-file | Format file. | |
M-x elisp-format-file-batch | Format file with `batch’. | |
M-x elisp-format-directory | Format recursive elisp files in directory. | |
M-x elisp-format-directory-batch | Format recursive elisp files in directory with `batch’. | |
M-x elisp-format-dired-mark-files | Format dired marked files. | |
M-x elisp-format-library | Format library. |
See also:
Configuration of the build-in python mode.
Key binding | Command | Description |
---|---|---|
H-M-b | M-x python-nav-backward-block | Moves to the previous python block. |
H-M-f | M-x python-nav-forward-block | Moves to the next python block. |
H-x C-c r | M-x psimacs/python/remove-unused-imports | Removes unused imports and unused variables with autoflake. |
H-x C-c R | M-x psimacs/python/blacken | Reformat buffer with tool black. |
H-x C-c Y | M-x psimacs/python/yapify | Reformat buffer with tool yapf. |
References:
CMake is an open-source, cross-platform family of tools designed to build, test and package software.
Cmake-mode provides syntax
highlighting and indentation for CMakeLists.txt
and *.cmake
source files.
Deft is an Emacs mode for quickly browsing, filtering, and editing directories of plain text notes, inspired by Notational Velocity. It was designed for increased productivity when writing and taking notes by making it fast and simple to find the right file at the right time and by automating many of the usual tasks such as creating new files and saving files.
Key binding | Command | Description |
---|---|---|
C-c n D | M-x deft | Switch to Deft buffer and load files. |
<Ret> | M-x deft-complete | Open file. |
C-o | M-x deft-open-file-other-window | Open file at point in other window. |
C-u C-o | C-u M-x deft-open-file-other-window | Open file at point in other window and switch to window. |
C-c C-c | M-x deft-filter-clear | Clear the current filter string and refresh the file browser. |
C-c C-q | M-x quit-window | Close Deft window. |
C-c C-g | M-x deft-refresh | Update the file cache, reapply the filter, and refresh the Deft buffer. |
C-c C-t | M-x deft-toggle-incremental-search | Toggle the ‘deft-incremental-search’ setting. |
C-c C-l | M-x deft-filter | Update the filter with STR and update the file browser. |
C-c C-s | M-x deft-toggle-sort-method | Toggle file sorting method defined in ‘deft-current-sort-method’ |
C-c C-n | M-X deft-new-file | Create a new file quickly. |
C-c C-d | M-x deft-delete-file | Delete the file represented by the button at the point. |
C-c C-r | M-x deft-rename-file | Rename the file represented by the button at the point. |
C-c C-a | M-x deft-archive-file | Archive the file represented by the button at the point. |
Manage references and bibliographies with Emacs BibTeX mode.
Emacs ships with bibtex-mode
to create and manage bibliographies. This mode, as the name suggests,
uses the BibTeX file format as your literature database. BibTeX is a tool to manage literature and
citations and is typically used for LaTeX typesetting.
A typical entry for a book will look like this:
@book{prevos_principles_2019,
title = {Principles of Strategic Data Science},
author = {Prevos, Peter},
year = 2019,
publisher = {Packt Publishing},
isbn = {978-1-83898-529-5},
file = {:/prevos-2019.pdf},
keywords = {data science, strategy}
}
See also: Manage your literature with Emacs BibTeX Mode
Ivy-bibtex allows you to search and manage your BibTeX bibliography. The main selling points are efficient search in large bibliographies using powerful search expressions and tight integration into your Emacs workflows.
Key binding | Command | Description |
---|---|---|
C-c i b | M-x ivy-bibtex | Ivy layer for bibtex. |
Support for writing text with LaTeX. Psimacs uses the AUCTeX package for assisting the LaTeX text editing. On default, Psimacs generates PDF-files and configures the free SumatraPDF application for viewing these files.
Key binding | Command | Description |
---|---|---|
C-c C-c | M-x TeX-command-master | You get a list of actions to choose from. |
C-c i g | M-x pdf-sync-forward-search |
Following an unsorted list if references:
- AUCTeX
- RefTeX
- EmacsWiki: LaTeX
- EmacsWiki: AUCTeX
- EmacsWiki: RefTeX
- CDLaTex
- LaTeX
- The LaTeX Project
- WikiBooks: LaTeX
- WikiBooks: LaTeX Mathematics
- The Not So Short Introduction to LaTeX2e
- LaTeX tutorial on YouTube
- Dante e.V.
- TeX Live
- MiKTeX
- CTAN
- KOMA-Script
Remark:
- I used to have some problems with the MikTeX installation. I got error messages on running pdflatex.
The follwing two commands worked for me running in a Windows console:
cd c:\Utils\MiKTeX\miktex\bin\x64 updmap.exe initexmf --mkmaps
Reference:
In this section the key bindings for the Psimacs org-mode configuration are defined.
Key binding | Command | Description |
---|---|---|
C-c C-. | M-x org-time-stamp-inactive | Insert an inactive time stamp. |
H-x C-c C-c i | M-x psimacs/org/copy-id-to-clipboard | Copy an ID link with the headline to killring, if no ID is there then create a new unique ID. |
H-x C-c C-x i | M-x psimacs/org/ids-to-headlines-in-file | Add ID properties to all headlines in the current file which do not already have one. |
H-x C-c C-k i | M-x org-table-insert-row | Insert a new row above the current line into the table. |
H-x C-c C-k h | M-x org-table-insert-hline | Insert a horizontal-line below the current line into the table. |
H-x C-c S-C-k p | M-x psimacs/org/table-create-preamble-keybinding-command-description | This function creates a three column table with header ‘Key binding’, ‘Command’ and ‘Description’. |
H-x C-c S-C-k i | M-x psimacs/org/table-insert-row-keybinding-command-description | This function inserts a three column row template above the current line into the table. |
H-x C-c S-C-k a | M-x psimacs/org/table-append-row-keybinding-command-description | This function appends a three column row template to the current table. |
H-x a | M-x org-agenda | Dispatch agenda commands to collect entries to the agenda buffer. |
H-x l | M-x org-store-link | Store a link to the current location. |
H-x c | M-x org-capture | Capture something. |
H-x & | M-x org-mark-ring-goto | Jump to the previous position in the mark ring. |
The org-cliplink package inserts org-mode links from the clipboard.
A simple command C-x p i
that takes a URL from the clipboard and inserts an org-mode link with a title
of a page found by the URL into the current buffer.
See also: org-cliplink
Key binding | Command | Description |
---|---|---|
C-x p i | M-x org-cliplink | Insert org-mode links from the clipboard. |
Org tempo reimplements completions of structure template before point.
Key binding | Description |
---|---|
<a TAB | #+begin_export ascii ... #+end_export |
<c TAB | #+begin_center ... #+end_center |
<C TAB | #+begin_comment ... #+end_comment |
<e TAB | #+begin_example ... #+end_example |
<E TAB | #+begin_export ... #+end_export |
<h TAB | #+begin_export html ... #+end_export |
<l TAB | #+begin_export latex ... #+end_export |
<q TAB | #+begin_quote ... #+end_quote |
<s TAB | #+begin_src ... #+end_src |
<v TAB | #+begin_verse ... #+end_verse |
emacs-jupyter provides REPL and org-mode source block frontends to Jupyter kernels. Kernel interactions integrated with Emacs’s built-in features.
Key binding | Command | Description |
---|---|---|
H-SPC j | M-x psimacs/hydra/jupyter/open-hydra | Show hydra for jupyter notebooks commands. |
H-RET | M-x jupyter-org-execute-and-next-block | Execute jupyter block and move to next block. |
C-S-H-<return> | M-x psimacs/jupyter/execute-all-jupyter-src-blocks | Execute all jupyter blocks. |
H-m n | M-x psimacs/jupyter/next-jupyter-src-block | Move point into the next jupyter src block. |
H-m p | M-x psimacs/jupyter/previous-jupyter-src-block | Move point into the previous jupyter src block. |
H-m i d | M-x org-display-inline-images | Display inline images. |
H-m i r | M-x org-redisplay-inline-images | Redisplay inline images. |
H-m i t | M-x org-toogle-inline-images | Toogle inline images. |
The following commands are defined only if point is in an org-babel source block.
Key binding | Command | Description |
---|---|---|
C-RET | M-x org-ctrl-c-ctrl-c | Execute block. |
S-RET | M-x jupyter-org-execute-and-next-block | Execute block and move to next block. |
M-RET | Execute block and add a new block. | |
C-M-RET | M-x jupyter-org-execute-to-point | Execute block to point. |
S-C-RET | M-x org-babel-execute-buffer | Execute all blocks of buffer. |
H-M-RET | M-x jupyter-org-execute-subtree | Execute subree to point. |
C-M-x | M-x jupyter-eval-defun | Evaluate the function at point. |
M-i | M-x jupyter-inspect-at-point | Inspect the code at point. |
C-c C-b | M-x jupyter-eval-buffer | Evaluate the whole buffer. |
C-c C-c | M-x jupyter-eval-line-or-region | Evaluate line or region. |
C-c C-i | M-x jupyter-repl-interrupt-kernel | Interrupt the kernel if possible. |
C-c C-r | M-x jupyter-repl-restart-kernel | Restart the kernel. |
C-c C-s | M-x jupyter-repl-scratch-buffer | Switch to a scratch buffer connected to the current REPL in another window. |
C-c C-o | M-x jupyter-eval-remove-overlays | Remove all evaluation result overlays in the buffer. |
C-c M-: | M-x jupyter-eval-string | Evaluate string. |
Key binding | Description |
---|---|
<bsh TAB | Bash shell source code block. |
<sh TAB | Shell source code block. |
<el TAB | Emacs lisp source code block. |
<ell TAB | Lexical Emacs lisp source code block. |
<p TAB | Python source code block. |
<ip TAB | IPython source code block. |
<jp TAB | Jupyter source code block. |
<jps TAB | Jupyter session source code block. |
<sl TAB | Source block with language choice. |
sbh TAB | Get source header value snippet. |
Org-roam is a plain-text personal knowledge management system.
Org-roam allows for effortless non-hierarchical note-taking: with Org-roam, notes flow naturally, making note-taking fun and easy. Org-roam augments the Org-mode syntax, and will work for anyone already using org-mode for their personal wiki.
The goal of org-roam is to create a web of notes linked between each other. By linking notes in a non-hierarchical way, one can make connections between topics and remember them without going through the hassle of creating a hierarchical tag system where it’s never clear if a note should belong to tag A or its parent B, etc.
References:
- My Org Roam Notes Workflow - Hugo Cisneros
- Ox-hugo export all roam to Hugo
- Export org-roam backlinks with Gohugo
- Introducing Org Roam by Jethro
- Jethro’s Braindump
- Jethro’s Braindump dotfile
- Automatically Adding Org Roam Tags To Hugo
- Org Roam Post by λx.jasbrg
- An Orgmode Note Workflow
- Keido site
- 5-org-roam-hacks
Brains:
Key binding | Command | Description |
---|---|---|
C-c n A | M-x psimacs/org-roam/refresh-agenda-list | Let be the org-agenda files the ones that have tag <Project>. |
C-c n D | M-x deft | Switch to Deft buffer and load files. |
C-c n R | M-x org-roam-node-random | Find and open a random Org-roam node. |
C-c n c | M-x org-roam-capture | Launches an ‘org-capture’ process for a new or existing node. |
C-c n f | M-x org-roam-node-find | Find and open an Org-roam node by its title or alias. |
C-c n o | M-x org-id-get-create | Create an ID for the current entry and return it. |
C-c n i i | M-x org-roam-node-insert | Find an Org-roam node and insert (where the point is) an “id:” link to it. |
C-c n i D | M-x psimacs/org-roam/node-insert-immediate-default | Immediate node insertion using the default capture template. |
C-c n i I | M-x psimacs/org-roam/node-insert-immediate | Immediate node insertion but let you choose the capture template. |
C-c n p f | M-x psimacs/org-roam/find-project | Find org roam node files which have tag <Project>. |
C-c n p n | M-x psimacs/org-roam/project-capture-note | Select or create project node and capture note. |
C-c n p r | M-x psimacs/org-roam/project-capture-reference | Select or create project node and capture reference. |
C-c n p s | M-x psimacs/org-roam/project-capture-resource | Select or create project node and capture resource. |
C-c n p t | M-x psimacs/org-roam/project-capture-task | Select or create project node and capture task. |
C-c n x i | M-x psimacs/org-roam/capture-inbox | Create a inbox capture node. |
C-c n r f | M-x org-roam-ref-find | Find and open an Org-roam node that’s dedicated to a specific ref. |
C-c n a a | M-x org-roam-alias-add | Add ALIAS to the node at point. |
C-c n a r | M-x org-roam-ref-add | Add REF to the node at point. |
C-c n a t | M-x org-roam-tag-add | Add TAGS to the node at point. |
C-c n g g | M-x org-roam-graph | Build and possibly display a graph for NODE. |
C-c n g u | M-x org-roam-ui-mode | Enable org-roam-ui. |
C-c n b d | M-x org-roam-buffer-display-dedicated | Launch NODE dedicated Org-roam buffer. |
C-c n b t | M-x org-roam-buffer-toggle | Toggle display of the persistent ‘org-roam-buffer’. |
C-c n d f | M-x org-roam-dailies-find-directory | Find and open ‘org-roam-dailies-directory’. |
C-c n d c | M-x org-roam-dailies-goto-date | Find the daily-note for a date using the calendar, creating it if necessary. |
C-c n d C | M-x org-roam-dailies-capture-date | Create an entry in the daily-note for a date using the calendar. |
C-c n d d | M-x org-roam-dailies-goto-today | Find the daily-note for today, creating it if necessary. |
C-c n d D | M-x org-roam-dailies-capture-today | Create an entry in the daily-note for today. |
C-c n d n | M-x org-roam-dailies-goto-next-note | Find next daily-note. |
C-c n d p | M-x org-roam-dailies-goto-previous-note | Find previous daily-note. |
C-c n d t | M-x org-roam-dailies-goto-tomorrow | Find the daily-note for tomorrow, creating it if necessary. |
C-c n d T | M-x org-roam-dailies-capture-tomorrow | Create an entry in the daily-note for tomorrow. |
C-c n d y | M-x org-roam-dailies-goto-yesterday | Find the daily-note for yesterday, creating it if necessary. |
C-c n d Y | M-x org-roam-dailies-capture-yesterday | Create an entry in the daily-note for yesteday. |
C-c n TAB | M-x psimacs/org/roam-screenshots | Move screenshot images to org roam image directory. |
The package org-noter allows you to take notes in org-mode files that stay in sync with pdf document files. It integrates also with the org-roam package.
Working with org-noter
:
Key binding | Command | Description |
---|---|---|
H-x n | M-x org-noter | Start ‘org-noter’ session. |
M-x org-noter-start-from-dired | In Dired, open sessions for marked files or file at point. | |
M-x org-noter-set-doc-split-fraction | Set the fraction of the frame that the document window will occupy when split. | |
M-x org-noter-set-notes-window-location | Set the notes window default location for the current session. | |
M-x org-noter-create-skeleton | Create notes skeleton based on the outline of the document. | |
M-x org-noter-pdf-set-columns | Interactively set the COLUMN_EDGES property for the current heading. | |
M-T | M-x org-noter-toggle-notes-window-location | Toggle between side- and bottom-notes window location. |
M-q | M-x org-noter-kill-session | Kill an ‘org-noter’ session. |
M-x org-noter-set-hide-other | Toggle hiding other headings for the current session. | |
M-x org-noter-set-hide-other | Toggle hiding other headings for the current session. |
Keybindings for the pdf buffer in org-noter-mode
:
Key binding | Command | Description |
---|---|---|
SPC n <PageDown> <down> | To move forward in document. | |
BACKSPACE p <PageUp> <up> | To move back in document. | |
i | M-x org-noter-insert-precise-note | Insert a note associated with a specific location (x,y). |
I | M-x org-noter-insert-precise-note-toggle-no-questions | Insert a note associated with a specific location (x,y). Note is always create with the default title. |
C-i TAB | M-x org-noter-insert-note | Inserts a note linked to the current page. |
C-S-i M-TAB | M-x org-noter-insert-note-toggle-no-questions | Inserts a note linked to the current page. Note is always create with the default title. |
M-p | M-x org-noter-sync-prev-note | Go to the location of the previous note, in relation to where the point is. |
M-n | M-x org-noter-sync-next-note | Go to the location of the next note, in relation to where the point is. |
M-. | M-x org-noter-sync-current-note | Go the location of the selected note, in relation to where the point is. |
C-M-p | M-x org-noter-sync-prev-page-or-chapter | Show previous page or chapter that has notes. |
C-M-n | M-x org-noter-sync-next-page-or-chapter | Show next page or chapter that has notes. |
C-M-. | M-x org-noter-sync-current-page-or-chapter | Show current page or chapter notes. |
M-T | M-x org-noter-toggle-notes-window-location | Toggle between side- and bottom-notes window location. |
M-q | M-x org-noter-kill-session | Kill an ‘org-noter’ session. |
Keybinding for the org note buffer in org-noter-mode
:
Key binding | Command | Description |
---|---|---|
M-p | M-x org-noter-sync-prev-note | Go to the location of the previous note, in relation to where the point is. |
M-n | M-x org-noter-sync-next-note | Go to the location of the next note, in relation to where the point is. |
M-. | M-x org-noter-sync-current-note | Go the location of the selected note, in relation to where the point is. |
C-M-p | M-x org-noter-sync-prev-page-or-chapter | Show previous page or chapter that has notes. |
C-M-n | M-x org-noter-sync-next-page-or-chapter | Show previous page or chapter that has notes. |
C-M-. | M-x org-noter-sync-current-page-or-chapter | Show current page or chapter notes. |
M-T | M-x org-noter-toggle-notes-window-location | Toggle between side- and bottom-notes window location. |
M-q | M-x org-noter-kill-session | Kill an ‘org-noter’ session. |
Key binding | Command | Description |
---|---|---|
C-TAB | M-x psimacs/buffer/next-user-buffer | Switch to the next user buffer. Buffer name starts with *, it’s not considered a user buffer. |
C-S-TAB | M-x psimacs/buffer/previous-user-buffer | Switch to the previous user buffer. Buffer name starts with *, it’s not considered a user buffer. |
H-TAB | M-x psimacs/buffer/next-emacs-buffer | Switch to the next emacs buffer, i.e. that starts with *. |
H-S-TAB | M-x psimacs/buffer/previous-emacs-buffer | Switch to the previous emacs buffer, i.e. that starts with *. |
C-x <right> | M-x next-buffer | Switch to the next buffer. |
C-x <left> | M-x previous-buffer | Switch to the previous buffer. |
H-<up> | M-x psimacs/movement/move-text-up | Move region or line up. |
H-<down> | M-x psimacs/movement/move-text-down | Move region or line down. |
H-m C-v C-o | M-x psimacs/shell/open-file-in-visual-studio | Open the given file argument in the MS Visual Studion session. |
H-m C-v C-i | M-x psimacs/shell/import-file-in-visual-studio | Import the given file argument in the MS Visual Studion session. |
H-m C-f C-a c | M-x find-file <psimacs/config/org-capture-coding-diary-file> | Find coding diary file in agenda directory. |
H-m C-f C-a d | M-x find-file <Diary.org> | Find diary file in agenda directory. |
H-m C-f C-a j | M-x find-file <Journal.org> | Find journal file in agenda directory. |
H-m C-f C-a l | M-x find-file <TimeLog.org> | Find time log file in agenda directory. |
H-m C-f C-f | M-x find-function | Find the definition of function near point |
H-m C-e C-m v | M-x visual-line-mode | Line wrapping. See Visual Line Mode. |
H-m C-p C-b | M-x psimacs/pair/bounce-sexp | Will bounce between matching parens. |
H-m C-x s b | M-x psimacs/convenience/bind-f6-to-last-command | Bind function key F6 to the last command used. |
H-x C-c C-e s h | M-x psimacs/sphinx/org-sphinx-build | Run the sphinx-build tool for the current org buffer. |
H-x C-c C-e s H | M-x psimacs/sphinx/build | Run the sphinx-build tool for the given file. |