From f3841ba942666f93c55bf2a90015c57a4baf65e4 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Wed, 15 Jul 2020 03:41:50 +0200 Subject: [PATCH] Improve tab navigation --- .emacs.d/config.org | 49 ++++++++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/.emacs.d/config.org b/.emacs.d/config.org index 2b24d9a..5d54362 100644 --- a/.emacs.d/config.org +++ b/.emacs.d/config.org @@ -146,7 +146,7 @@ Install and configure packages. :after evil :custom (evil-collection-company-use-tng nil) - (evil-collection-key-blacklist '("M-h" "M-l" "SPC")) + (evil-collection-key-blacklist '("M-h" "M-j" "M-k" "M-l" "SPC")) (evil-collection-setup-minibuffer t) :config (evil-collection-init)) @@ -428,7 +428,7 @@ https://github.com/laishulu/hl-fill-column #+BEGIN_SRC emacs-lisp (use-package elfeed :custom - (elfeed-db-directory "~/.emacs.d/elfeed/") + (elfeed-db-directory (concat emacs-d "/elfeed")) (elfeed-enclosure-default-dir "~/downloads/") (elfeed-search-filter "@6-months-ago +unread") (elfeed-search-clipboard-type 'CLIPBOARD) @@ -877,6 +877,8 @@ Disable spacebar in evil motion. #+BEGIN_SRC emacs-lisp ;; Buffers (global-set-key (kbd "M-h") 'centaur-tabs-backward-tab) + (global-set-key (kbd "M-j") 'centaur-tabs-forward-group) + (global-set-key (kbd "M-k") 'centaur-tabs-backward-group) (global-set-key (kbd "M-l") 'centaur-tabs-forward-tab) (global-set-key (kbd "C-M-h") 'centaur-tabs-move-current-tab-to-left) (global-set-key (kbd "C-M-l") 'centaur-tabs-move-current-tab-to-right) @@ -1027,11 +1029,8 @@ General.el ~leader key binds. "f r" '(rename-file-and-buffer :which-key "Rename file") "f s" '(basic-save-buffer :which-key "Save file") - ;; Tabs - "h" '(centaur-tabs-backward-group :which-key "Tab backward group") - "j" '(centaur-tabs-select-end-tab :which-key "Tab select first") - "k" '(centaur-tabs-select-beg-tab :which-key "Tab select last") - "l" '(centaur-tabs-forward-group :which-key "Tab forward group") + ;; Help + "h" '(help-command :which-key "help") ;; Insert "i" '(:ignore t :which-key "insert") @@ -1063,6 +1062,10 @@ General.el ~leader key binds. "t" '(:ignore t :which-key "tabs") "t b" '(centaur-tabs-group-buffer-groups :which-key "Group tabs by buffer") "t p" '(centaur-tabs-group-by-projectile-project :which-key "Group tabs by project") + "t h" '(centaur-tabs-backward-group :which-key "Tab backward group") + "t j" '(centaur-tabs-select-end-tab :which-key "Tab select first") + "t k" '(centaur-tabs-select-beg-tab :which-key "Tab select last") + "t l" '(centaur-tabs-forward-group :which-key "Tab forward group") ;; Update packages "u" '(auto-package-update-now :which-key "Update packages") @@ -1098,20 +1101,38 @@ https://github.com/suyashbire1/emacs.d/blob/master/init.el *** Major mode #+BEGIN_SRC emacs-lisp - (general-create-definer comma-leader - :prefix "SPC ," - :states '(normal visual)) + (general-create-definer local-leader + :prefix "SPC m" + :non-normal-prefix "M-SPC m" + :global-prefix "M-SPC m" + :states '(normal visual insert motion emacs) + ) + + (which-key-add-key-based-replacements "SPC m" "") + (which-key-add-key-based-replacements "M-SPC m" "") + + (local-leader org-mode-map + "'" '(org-edit-special :which-key "Org edit") + ) - (comma-leader elfeed-search-mode-map - "" '(:ignore t :which-key "elfeed") + (local-leader org-src-mode-map + "'" '(org-edit-src-exit :which-key "Org exit edit") + "k" '(org-edit-src-abort :which-key "Org abort edit") + ) + + (define-key org-src-mode-map (kbd "C-c C-c") #'org-edit-src-exit) + + (local-leader elfeed-search-mode-map "g" 'elfeed-search-update--force "G" 'elfeed-search-fetch ) - (comma-leader elfeed-show-mode-map - "" '(:ignore t :which-key "elfeed") + (local-leader elfeed-show-mode-map "g" 'elfeed-show-refresh ) + + ;; c-fill-paragraph Reflow comment + ;; https://youtu.be/hbmV1bnQ-i0?t=1910 #+END_SRC * Notes