From 4dbce2072c1484094a08d8333a635050985e1c65 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Fri, 20 Mar 2020 18:05:12 +0100 Subject: Stop using C-tab for other-window Use C-x o with repeatable o instead. This removes a conflict with Magit and Org bindings. Inspiration: https://emacs.stackexchange.com/a/52203/10209 --- .emacs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.emacs b/.emacs index 3d48a4a..51f4004 100644 --- a/.emacs +++ b/.emacs @@ -36,6 +36,15 @@ (global-set-key (kbd "C-x C-b") 'ibuffer) +(defun my/other-window (count &optional all-frames) + (interactive "p") + (let ((repeat-map (make-sparse-keymap))) + (define-key repeat-map [?o] #'other-window) + (set-transient-map repeat-map t) + (other-window count all-frames))) + +(global-set-key (kbd "C-x o") #'my/other-window) + ;; Hopefully these will be easier to remember than TeX commands: (require 'quail) @@ -139,7 +148,6 @@ (when window-system (load-theme 'eighters t) ;; Bindings ala Terminator - (global-set-key [C-tab] 'other-window) (global-set-key (kbd "C-S-o") 'split-window-below) (global-set-key (kbd "C-S-e") 'split-window-right) (global-set-key (kbd "C-+") 'text-scale-adjust) @@ -181,14 +189,6 @@ (delight 'compilation-in-progress "⚙" 'compile) (message "TODO: tweak compilation lighter")) -(defun my/magit-mode-hook () - (when window-system - (local-set-key [C-tab] 'other-window) - (local-set-key (kbd "C-i") 'magit-section-cycle) - (local-set-key (kbd "") 'magit-section-toggle))) - -(add-hook 'magit-mode-hook 'my/magit-mode-hook) - (add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh t) ;; Don't use Customize here, since that would set the variable's value -- cgit v1.2.3