Skip to main content

SaneKeys

My personal keybindings for Emacs , 2021-07-05T11:00:00+02:00

As I am the only one using my Emacs I peronalized my keybinding heavily to resemble well-known Windows key combinations

Using them in Emacs can be advantageous for several reasons:

  • Ease of Learning: Many users are already familiar with common Windows key combinations from their everyday use of the operating system. By leveraging these familiar combinations, users can quickly adapt to using Emacs without the need to learn an entirely new set of keybindings.
  • Consistency Across Applications: Maintaining consistency with widely-used key combinations in Windows can enhance the user experience, especially for those who frequently switch between Emacs and other applications. It reduces cognitive load by allowing users to rely on muscle memory and established patterns when performing tasks.
  • Accessibility: Leveraging well-known Windows key combinations can make Emacs more accessible to users who are transitioning from other text editors or word processors that use similar shortcuts. It lowers the barrier to entry for new users and facilitates a smoother onboarding process.
  • Productivity: Familiar key combinations can contribute to increased productivity by enabling users to perform tasks more efficiently. Users can navigate, edit, and manipulate text within Emacs with greater speed and accuracy when using shortcuts they already know and understand.
  • Customization and Flexibility: While sticking to well-known Windows key combinations provides a familiar starting point, Emacs is highly customizable, allowing users to modify keybindings to suit their preferences and workflow. Users can customize Emacs to incorporate additional shortcuts or redefine existing ones based on their needs.

In summary, using well-known Windows key combinations in Emacs can enhance usability, facilitate a smoother transition for new users, and contribute to improved productivity and efficiency, while still allowing for customization and flexibility.

Letters

A Select all text or items in the current window

In most text editing applications, word processors, email clients, web browsers, file managers, and other software, pressing Ctrl+A will select all text or items within the active window or document. This includes everything from the beginning to the end of the document or all items in a list, folder, or other container.

Mode Ctrl Super Meta Shift Function Remark
Global X       'mark-whole-buffer  
org-mode X       'mark-whole-buffer  

B Buffer Handling

Mode Ctrl Super Meta Shift Function Remark
Global X       'consult-buffer  
Global X X     'consult-project-buffer  

C

D Bookmark the current page, duplicate or debug

In Windows, the Ctrl+D keyboard shortcut does not have a universally recognized or standardized function across all applications. However, depending on the context or specific software being used, Ctrl+D may be used for certain purposes:

  • Bookmark: In some web browsers, such as Mozilla Firefox and Google Chrome, pressing Ctrl+D is commonly used to bookmark the current webpage. This action adds the webpage to the browser's bookmarks or favorites list, allowing users to quickly access it later without having to search for it again.
  • Duplicate: In certain applications, Ctrl+D may be used to duplicate selected items or content. For example, in file managers or graphic design software, pressing Ctrl+D may duplicate selected files, folders, or elements.
  • Debugging: In integrated development environments (IDEs) or debugging tools, Ctrl+D may be used as a shortcut for specific debugging commands or actions. For example, in some debugging environments, Ctrl+D may be used to set a breakpoint or initiate a step-over debugging operation.
Mode Ctrl Super Meta Shift Function Remark
org-mode X       'org-store-link  
org-mode X X     'org-super-links-store-link  
org-read-date-minibuffer-local         (lambda () (interactive) (org-eval-in-calendar '(diary-view-entries)))  

E Export

Mode Ctrl Super Meta Shift Function Remark
org-mode X       'org-export-dispatch  
elfeed-search-mode X       'elfeed-export-opml  

F Open the "Find" dialog to search for text or items within the current window

The whole thing of search & replace consist of three keys:

  • f:: for findig
  • f3:: für repeating the search
  • h:: für replacing
  • Ctrl:: does it for Strings
  • Meta:: does it for regular expressions
  • Shft:: does it backwards
Mode Ctrl Super Meta Shift Function Remark
Global X       'isearch-forward  
Global X X     'isearch-backward  
Global     X   'isearch-forward-regexp  
Global   X X   'isearch-backward-regexp  
org-mode X       'isearch-forward  
org-mode X X     'isearch-backward  
org-mode     X   'isearch-forward-regexp  
org-mode   X X   'isearch-backward-regexp  

G Cancel or quit the current operation or command

In Emacs, Ctrl+G is a commonly used key combination that is primarily employed to cancel or quit the current operation or command. It serves as an "emergency escape" key to interrupt commands or processes that may be taking too long or have unexpectedly entered a state where user input is required.

Here's how Ctrl+G is typically used in Emacs:

  • Interrupt Commands: If Emacs appears to be stuck or unresponsive while executing a command, pressing Ctrl+G will interrupt the current operation and return control to the user. This is particularly useful when a command is taking longer to execute than expected or has entered an infinite loop.
  • Cancel Minibuffer Input: In Emacs, the minibuffer is used for entering commands, file names, or other input. If you're in the minibuffer and decide you don't want to proceed with the current command or input, pressing Ctrl+G will cancel the minibuffer input and return to the previous state.
  • Abort Commands: Ctrl+G can be used to abort partially typed or incomplete commands. If you're in the middle of typing a command but decide you want to cancel it, pressing Ctrl+G will abandon the command and return to the normal editing state.
  • Break Out of Recursive Edits: Emacs supports recursive editing, where you can enter another level of editing within an active command or operation. Ctrl+G can be used to exit recursive edits and return to the outer level of editing.

Overall, Ctrl+G in Emacs provides a quick and reliable way to abort or cancel ongoing operations, providing users with a means to regain control and return to normal editing or interaction with Emacs.

H Replace

In Windows, the Ctrl+H keyboard shortcut typically serves as a universal command for accessing the "Find and Replace" function within various text editing programs and applications. This functionality allows users to search for specific text strings and optionally replace them with another string. The whole thing of search & replace consist of three keys:

f
for findig
f3
für repeating the search
h
für replacing
Ctrl
does it for Strings
Meta
does it for regular expressions
Mode Ctrl Super Meta Shift Function Remark
Global X       'replace-string  
Global     X   'replace-regexp  

J Join

Mode Ctrl Super Meta Shift Function Remark
org-mode X       'org-fill-paragraph  

K

L Link handling

Mode Ctrl Super Meta Shift Function Remark
Global X       'org-insert-link-global  
org-mode X       'org-insert-link  
org-mode X X     'org-super-links-insert-link  
org-mode X     X 'org-super-links-link  

M

N Open a new window or document

In Windows, the Ctrl+N keyboard shortcut is typically used for creating a new document, window, or instance of the active application. It's a common and widely used shortcut across various software applications and operating system functions.

Mode Ctrl Super Meta Shift Function Remark
Global X       'find-file  
org-mode X       'find-file  
denote-mode X       'denote  

O Open an existing file or document

In Windows, the Ctrl+O keyboard shortcut is not as commonly used as some other shortcuts like Ctrl+S for saving or Ctrl+N for creating new documents. However, in some applications, particularly text editors, word processors, and file managers, Ctrl+O is typically used to open existing files or documents.

Mode Ctrl Super Meta Shift Function Remark
Global X       'consult-dir  
Global     X   'recentf-open-files  
Global   X     'consult-projectile-find-file  

P Print the current document or file

In Windows, the Ctrl+P keyboard shortcut is typically used to initiate the "Print" function within various applications.

Mode Ctrl Super Meta Shift Function Remark
Global X       'print-buffer  

Q Quit Application

In some software applications, particularly those developed for Unix/Linux systems, Ctrl+Q may be used as a shortcut to quit or close the application. However, this usage is less common in Windows applications, where Ctrl+Q is often not assigned any default functionality.

Mode Ctrl Super Meta Shift Function Remark
Global X       'save-buffers-kill-emacs  
             

R Refresh or Reload

In web browsers such as Google Chrome, Mozilla Firefox, Microsoft Edge, and others, pressing Ctrl+R (or F5) will refresh or reload the current webpage. This action requests the browser to reload the page content from the web server, updating it with any changes or new information that may have occurred since the page was last loaded.

Mode Ctrl Super Meta Shift Function Remark
Global X       'revert-buffer  
org-mode X       'revert-buffer  
org-mode X X     'org-revert-all-org-buffers  

S Save the current document or file

Ctrl+S is primarily used to save the current document or file in a variety of applications, including text editors, word processors, spreadsheets, graphic design software, and more. When you press Ctrl+S, the application will typically save the changes made to the document to its current location or prompt you to choose a location if it's a new file that hasn't been saved before.

Mode Ctrl Super Meta Shift Function Remark
Global X       'save-buffer  
org-mode X       'save-buffer  
org-mode X X     'write-file  
org-mode X X X   'org-save-all-org-buffers  
org-agenda-mode X X X   'org-save-all-org-buffers  
custom-mode X       'Custom-save  

T Open a new tab in web browsers or some applications

In web browsers such as Google Chrome, Mozilla Firefox, Microsoft Edge, and others, Ctrl+T is commonly used to open a new tab. This allows users to quickly open additional browsing tabs without having to use the mouse to click on the browser's interface.

Mode Ctrl Super Meta Shift Function Remark
Global X       'tab-bar-new-tab  
Global X X     'tab-bar-undo-close-tab  

U Unused yet, maybe for quick access to unicode chars

Ctrl+U does not have a standardized usage across all Windows applications and contexts. Its functionality may vary depending on the specific application being used and how it's configured by the user or the software developer.

V

W Close the current window or tab

Mode Ctrl Super Meta Shift Function Remark
Global X       'kill-this-buffer  
org-mode X       'kill-this-buffer  
Global X   X   'writeroom-mode  

X

Y

Z Undo the previous action

Mode Ctrl Super Meta Shift Function Remark
Global X       'undo  

Function Keys

F1 Help

F2

F3

Mode Ctrl Super Meta Shift Function Remark
Global         'isearch-repeat-forward  
Global       X 'isearch-repeat-backward  
org-mode X       'isearch-repeat-forward  
org-mode X     X 'isearch-repeat-backward  

F4

Mode Ctrl Super Meta Shift Function Remark
Global         'projectile-mode  

F5 Reload

Mode Ctrl Super Meta Shift Function Remark
Global         'revert-buffer  
org-agenda-mode         'org-agenda-redo  

F6

Mode Ctrl Super Meta Shift Function Remark
Global         'dired  
denote-mode         (lambda () (interactive) (find-file "~/wiki"))  

F7

Mode Ctrl Super Meta Shift Function Remark
Global         'flyspell-mode  

F8

Mode Ctrl Super Meta Shift Function Remark
Global         'magit  
             

F9

Mode Ctrl Super Meta Shift Function Remark
Global         'treemacs  
             

F10

Mode Ctrl Super Meta Shift Function Remark
Global         'menu-bar-open  

F11

F12

Mode Ctrl Super Meta Shift Function Remark
Global         (lambda () (interactive) (find-file "~/jrn"))  
             

F13

Mode Ctrl Super Meta Shift Function Remark
Global         (lambda () (interactive) (find-file "~/wiki"))  
             

F14

Mode Ctrl Super Meta Shift Function Remark
Global         (lambda () (interactive) (find-file "~/doc"))  
             

F15

Mode Ctrl Super Meta Shift Function Remark
Global         (lambda () (interactive) (find-file "~/blog"))  
             

F16

Mode Ctrl Super Meta Shift Function Remark
Global         (lambda () (interactive) (find-file "~/prj"))  
             

F17

Mode Ctrl Super Meta Shift Function Remark
Global         (lambda () (interactive) (find-file "~/doc/Rechnungen"))  
             

F18

Mode Ctrl Super Meta Shift Function Remark
Global         (lambda () (interactive) (find-file "~/.config/emacs"))  
             

F19

Mode Ctrl Super Meta Shift Function Remark
Global         (lambda () (interactive) (find-file "~/.local/bin"))  
             

F20

Mode Ctrl Super Meta Shift Function Remark
Global         (lambda () (interactive) (find-file "~/Downloads"))  
             

F21

F22

F23

F24

Mode Ctrl Super Meta Shift Function Remark
Global         (lambda () (interactive) (org-agenda nil "n"))  
Global X       `org-agenda-execute  

Navigation

Up

Mode Ctrl Super Meta Shift Function Remark
Global X X     'delete-other-window  
org-read-date-minibuffer-local         (lambda () (interactive) (org-eval-in-calendar '(calendar-backward-week 1)))  
org-read-date-minibuffer-local       X (lambda () (interactive) (org-eval-in-calendar '(calendar-backward-year 1)))  
hs-minor-mode     X   'hs-hide-all  

Down

Mode Ctrl Super Meta Shift Function Remark
Global X X     (lambda () (interactive)(split-window-below) (other-window 1))  
org-read-date-minibuffer-local       X (lambda () (interactive) (org-eval-in-calendar '(calendar-forward-week 1)))  
org-read-date-minibuffer-local         (lambda () (interactive) (org-eval-in-calendar '(calendar-forward-year 1)))  
hs-minor-mode     X   'hs-show-all  

Left

Mode Ctrl Super Meta Shift Function Remark
Global X X     'delete-window  
org-read-date-minibuffer-local         (lambda () (interactive) (org-eval-in-calendar '(calendar-backward-day 1)))  
org-read-date-minibuffer-local       X (lambda () (interactive) (org-eval-in-calendar '(calendar-backward-month 1)))  
hs-minor-mode     X   'hs-hide-block  

Right

Mode Ctrl Super Meta Shift Function Remark
Global X X     (lambda () (interactive)(split-window-horizontally) (other-window 1)) !  
org-read-date-minibuffer-local         (lambda () (interactive) (org-eval-in-calendar '(calendar-forward-day 1)))  
org-read-date-minibuffer-local       X (lambda () (interactive) (org-eval-in-calendar '(calendar-forward-month 1)))  
hs-minor-mode     X   'hs-show-block  

Home

Mode Ctrl Super Meta Shift Function Remark
Global     X   #'(lambda nil (interactive) (find-file "~/org/ops.org"))  

End

Prior

Next

Special Keys

SPC

Mode Ctrl Super Meta Shift Function Remark
org-mode X       'org-capture  
hs-minor-mode     X   'hs-hide-level  
             

Escape

Mode Ctrl Super Meta Shift Function Remark
Global         'quit-window  
messages-buffer-mode         'quit-window  
custom-mode         'Custom-buffer-done  
vertico         'minibuffer-keyboard-quit  
org-agenda-mode         'org-agenda-quit  

Enter

Mode Ctrl Super Meta Shift Function Remark
             

Return

Mode Ctrl Super Meta Shift Function Remark
Global X       'cua-set-rectangle-mark  
org-mode X       'cua-set-rectangle-mark  

Tab

In Windows, the Tab key on the keyboard is typically used for the following purposes:

  • Text Input Navigation: In text fields, forms, and other input areas, pressing the Tab key allows users to navigate between different fields or elements in a sequential order. This is especially useful in web browsers, dialog boxes, and forms where users need to enter information into multiple fields.
  • Auto-Completion: In certain applications, such as text editors or code editors, pressing the Tab key may trigger an auto-completion feature. This feature suggests or completes words or phrases based on the context or previously entered text, helping users to type more efficiently.
  • Indentation: In text editors, code editors, and word processors, pressing the Tab key typically inserts a predefined amount of space or a tab character at the beginning of the current line or selected text. This is commonly used for indentation purposes, especially in programming where indentation is used to improve code readability and structure.
  • Navigation and Control: In some applications, pressing the Tab key may be used to navigate through various interface elements, such as tabs, buttons, or menu options. This allows users to move focus between different parts of the application's user interface without using the mouse.

Overall, the Tab key is a versatile key in Windows used for navigation, text input, auto-completion, indentation, and other purposes, providing users with a convenient way to interact with various applications and input forms.

Mode Ctrl Super Meta Shift Function Remark
Global X       `other-window  
Global X X X   `tab-bar-switch-to-next-tab  
Global X X X X `tab-bar-switch-to-next-tab  

Insert

Overall, the INS key primarily functions as a toggle between "Insert" and "Overwrite" modes in text editing applications, allowing users to control how text is entered and manipulated.

Mode Ctrl Super Meta Shift Function Remark
Global         'overwrite-mode  
Global X       'insert-file  

Delete

Overall, the DEL key is a versatile key in Windows used for deleting characters, files, or other items depending on the context of its usage, providing users with a quick and efficient way to remove unwanted content.

Mode Ctrl Super Meta Shift Function Remark
Global X       'kill-whole-line  

Backspace

Overall, the Backspace key is primarily used for backward deletion of characters in text editing applications and for navigation in file management applications, providing users with a quick and efficient way to correct mistakes, delete text, or navigate through folder hierarchies.

Mode Ctrl Super Meta Shift Function Remark
Global X       'delete-blank-lines  

print

In Windows, the "PrtScn" (Print Screen) key on the keyboard is typically used to capture a screenshot of the entire screen or all active monitors. Here's how the PrtScn key is typically utilized:

  • Capture Full Screen: Pressing the PrtScn key captures an image of the entire desktop, including all open windows, icons, and other elements displayed on the screen. The captured screenshot is then copied to the clipboard.
  • Capture Multiple Monitors: If you have multiple monitors connected to your computer, pressing the PrtScn key captures a screenshot that includes all active monitors, providing a comprehensive view of your entire desktop setup.
  • Take Screenshots for Documentation or Sharing: Users often use the PrtScn key to capture screenshots for documentation, troubleshooting, or sharing purposes. Once captured, users can paste the screenshot into image editing software, word processors, or other applications to annotate, edit, or save the image as needed.

Overall, the PrtScn key is a handy tool for capturing screenshots of the entire desktop or multiple monitors in Windows, providing users with a convenient way to document and share information displayed on their screens.

Mode Ctrl Super Meta Shift Function Remark
Global X       'emacsshot-snap-window  
Global X X     'emacsshot-snap-window-include-modeline  
Global X   X   'emacsshot-snap-frame  

Maus

Mouse-1

Mode Ctrl Super Meta Shift Function Remark
Global            

Mouse-2

Mode Ctrl Super Meta Shift Function Remark
Global         'ibuffer  

Mouse-3

Mode Ctrl Super Meta Shift Function Remark
Global         'embark-act  

Sonstiges

-

Mode Ctrl Super Meta Shift Function Remark
Global X       'text-scale-decrease  

+

Mode Ctrl Super Meta Shift Function Remark
Global X       'text-scale-increase  
             

<

Mode Ctrl Super Meta Shift Function Remark
org-read-date-minibuffer-local         (lambda () (interactive) (org-eval-in-calendar '(calendar-scroll-left-three-months)))  
             

>

Mode Ctrl Super Meta Shift Function Remark
org-read-date-minibuffer-local         (lambda () (interactive) (org-eval-in-calendar '(calendar-scroll-right-three-months)))  
             

.

Mode Ctrl Super Meta Shift Function Remark
Global X       'embark-act  
org-read-date-minibuffer-local         (lambda () (interactive) (org-eval-in-calendar '(calendar-goto-today)))