17. Org Mode Ate My Keyboard

This is an edited AI response from keep org mode from hijacking C-# - Google Search

To keep Org Mode from hijacking C-# (or other keybindings, such as shift-cursor keys), you can customize how Org interacts with the keymap. The most common cause of this is Org trying to take control of keybindings for its own functionality (e.g., table editing or speed keys).

Here are the ways to stop this behavior, specifically targeting org-disputed-keys.

  1. The Recommended Fix: org-disputed-keys

    Add this to your init.el or .emacs file to tell Org mode not to hijack specific keys, allowing them to pass through to your system or other modes:

    (with-eval-after-load 'org
      ;; :kbd:`C-#` is the snippets/workspace multiplexer
      (define-key org-mode-map [(control ?#)] (make-sparse-keymap))
      (define-key org-mode-map [(control ?#) (control ?#)] #'org-table-rotate-recalc-marks)
    
      ;; :kbd:`C-c #` is the snippets/workspace multiplexer
      (define-key org-mode-map [(control c) ?#] nil)
      (define-key org-mode-map [(control c) (control ?#)] #'org-update-statistics-cookies)
      )
    

    Alternatively, if you are having issues with C-# being used for org-table-rotate-recalc-marks(), you can specifically rebind that to something else, or use nil to unbind it entirely in org-mode-map.

  2. Disabling Org Speed Keys

    If C-# is being interpreted as a “speed key” at the beginning of a headline, you can disable the speed keys feature:

    (setq org-use-speed-commands nil)
    
  3. Handling Shift-Selection Conflicts

    If the issue involves C-S-# or other shifted keys, you can tell Org to yield to other modes (like CUA mode) by customizing the org-replace-disputed-keys variable:

    (setq org-replace-disputed-keys t)
    ;; Then define the mapping in org-disputed-keys if necessary
    
  4. Direct Keybinding Removal

    To ensure Org mode does not bind that key at all, you can explicitly remove it from the map:

    (add-hook 'org-mode-hook
              (lambda ()
                (define-key org-mode-map (kbd "C-#") nil)))
    

After adding any of these, restart Emacs or evaluate the code (M-x eval-buffer) to apply the changes.