From 2c2ddb469a2f51895ed836a5269b85f84c5f41be Mon Sep 17 00:00:00 2001 From: Derek Taylor Date: Wed, 16 Aug 2023 21:11:06 -0500 Subject: [PATCH] Fixing the annoying ESC three times behavior in the modeline --- .config/emacs/config.el | 20 +++++++++------- .config/emacs/config.org | 52 +++++++++++++++++++++++----------------- 2 files changed, 41 insertions(+), 31 deletions(-) diff --git a/.config/emacs/config.el b/.config/emacs/config.el index ef9375b..7b2ef84 100644 --- a/.config/emacs/config.el +++ b/.config/emacs/config.el @@ -308,6 +308,16 @@ "w L" '(buf-move-right :wk "Buffer move right")) ) +(use-package git-timemachine + :after git-timemachine + :hook (evil-normalize-keymaps . git-timemachine-hook) + :config + (evil-define-key 'normal git-timemachine-mode-map (kbd "C-j") 'git-timemachine-show-previous-revision) + (evil-define-key 'normal git-timemachine-mode-map (kbd "C-k") 'git-timemachine-show-next-revision) +) + +(use-package magit) + (menu-bar-mode -1) (tool-bar-mode -1) (scroll-bar-mode -1) @@ -352,15 +362,7 @@ (use-package haskell-mode) (use-package lua-mode) -(use-package git-timemachine - :after git-timemachine - :hook (evil-normalize-keymaps . git-timemachine-hook) - :config - (evil-define-key 'normal git-timemachine-mode-map (kbd "C-j") 'git-timemachine-show-previous-revision) - (evil-define-key 'normal git-timemachine-mode-map (kbd "C-k") 'git-timemachine-show-next-revision) -) - -(use-package magit) +(global-set-key [escape] 'keyboard-escape-quit) (use-package doom-modeline :ensure t diff --git a/.config/emacs/config.org b/.config/emacs/config.org index be3bb93..fa71905 100644 --- a/.config/emacs/config.org +++ b/.config/emacs/config.org @@ -21,14 +21,15 @@ - [[#setting-the-font-face][Setting the Font Face]] - [[#zooming-inout][Zooming In/Out]] - [[#general-keybindings][GENERAL KEYBINDINGS]] +- [[#git-programs][GIT PROGRAMS]] + - [[#git-time-machine][Git Time Machine]] + - [[#magit][Magit]] - [[#graphical-user-interface-tweaks][GRAPHICAL USER INTERFACE TWEAKS]] - [[#disable-menubar-toolbars-and-scrollbars][Disable Menubar, Toolbars and Scrollbars]] - [[#display-line-numbers-and-truncated-lines][Display Line Numbers and Truncated Lines]] - [[#ivy-counsel][IVY (COUNSEL)]] - [[#language-support][LANGUAGE SUPPORT]] -- [[#git-programs][GIT PROGRAMS]] - - [[#git-time-machine][Git Time Machine]] - - [[#magit][Magit]] +- [[#minibuffer-escape][MINIBUFFER ESCAPE]] - [[#modeline][MODELINE]] - [[#neotree][NEOTREE]] - [[#org-mode][ORG MODE]] @@ -433,6 +434,29 @@ You can use the bindings CTRL plus =/- for zooming in/out. You can also use CTR #+end_src +* GIT PROGRAMS +** Git Time Machine +[[https://github.com/emacsmirror/git-timemachine][git-timemachine]] is a program that allows you to move backwards and forwards through a file's commits. 'SPC g t' will open the time machine on a file if it is in a git repo. Then, while in normal mode, you can use 'CTRL-j' and 'CTRL-k' to move backwards and forwards through the commits. + + +#+begin_src emacs-lisp +(use-package git-timemachine + :after git-timemachine + :hook (evil-normalize-keymaps . git-timemachine-hook) + :config + (evil-define-key 'normal git-timemachine-mode-map (kbd "C-j") 'git-timemachine-show-previous-revision) + (evil-define-key 'normal git-timemachine-mode-map (kbd "C-k") 'git-timemachine-show-next-revision) +) +#+end_src + +** Magit +[[https://magit.vc/manual/][Magit]] is a full-featured git client for Emacs. + +#+begin_src emacs-lisp +(use-package magit) + +#+end_src + * GRAPHICAL USER INTERFACE TWEAKS Let's make GNU Emacs look a little better. @@ -500,27 +524,11 @@ Emacs has built-in programming language modes for Lisp, Scheme, DSSSL, Ada, ASM, #+end_src -* GIT PROGRAMS -** Git Time Machine -[[https://github.com/emacsmirror/git-timemachine][git-timemachine]] is a program that allows you to move backwards and forwards through a file's commits. 'SPC g t' will open the time machine on a file if it is in a git repo. Then, while in normal mode, you can use 'CTRL-j' and 'CTRL-k' to move backwards and forwards through the commits. - +* MINIBUFFER ESCAPE +By default, Emacs requires you to hit ESC three times to escape quit the minibuffer. #+begin_src emacs-lisp -(use-package git-timemachine - :after git-timemachine - :hook (evil-normalize-keymaps . git-timemachine-hook) - :config - (evil-define-key 'normal git-timemachine-mode-map (kbd "C-j") 'git-timemachine-show-previous-revision) - (evil-define-key 'normal git-timemachine-mode-map (kbd "C-k") 'git-timemachine-show-next-revision) -) -#+end_src - -** Magit -[[https://magit.vc/manual/][Magit]] is a full-featured git client for Emacs. - -#+begin_src emacs-lisp -(use-package magit) - +(global-set-key [escape] 'keyboard-escape-quit) #+end_src * MODELINE