From cfb860f71a8a9d2c15bd023bd74c8c75268553ac Mon Sep 17 00:00:00 2001 From: StrawberryTea Date: Fri, 12 Apr 2024 13:20:17 -0500 Subject: [PATCH 1/2] doc(corfu): update troubleshooting section --- modules/completion/corfu/README.org | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/modules/completion/corfu/README.org b/modules/completion/corfu/README.org index cf0e35a72..fa8502d99 100644 --- a/modules/completion/corfu/README.org +++ b/modules/completion/corfu/README.org @@ -242,6 +242,8 @@ all CAPFs are interactive to be called this way, in which case you can use * Troubleshooting [[doom-report:][Report an issue?]] +** Performance issues with ~cape-dabbrev~ + If you have performance issues with ~cape-dabbrev~, the first thing I recommend doing is to look at the list of buffers Dabbrev is scanning: @@ -253,6 +255,34 @@ doing is to look at the list of buffers Dabbrev is scanning: ... and modify ~dabbrev-ignored-buffer-regexps~ or ~dabbrev-ignored-buffer-modes~ accordingly. +** Fixing TAB Keybindings + +If you encounter an issue where your ~TAB~ keybindings are not responding in Doom +Emacs while the ~:editor evil~ module is active, it's likely caused by a conflict +where ~~ keybindings and insert state bindings are overriding your ~TAB~ key +assignments. + +In Evil mode, keybinding priorities are set such that: +1. ~~ keybindings supersede ~TAB~ keybindings and only work in GUI Emacs. +2. Bindings in insert state take precedence whenever the insert state is active. + +To resolve this conflict and to assign your desired command to the ~TAB~ key, you +must redefine the keybindings with insert state set explicitly. You can do this +by configuring your ~evil~ keybindings for the insert state as follows: + +#+begin_src emacs-lisp +(map! :gi "TAB" #'your-command + :gi "" #'your-command) +#+end_src + +Place this code in your Doom Emacs configuration file to set the function ~your-command~ as the response to pressing ~TAB~ during insert mode. + +Remember to replace ~#'your-command~ with the actual command you wish to invoke +with the ~TAB~ key. + +If ever in a situation like this, use ~describe-key~ with ~C-h k~ and look at what +command is being called as well as what keymaps the command is defined in. + * Frequently asked questions /This module has no FAQs yet./ [[doom-suggest-faq:][Ask one?]] From 0a4d22e5b78c90d07bfbb0b587d93be91f2c489e Mon Sep 17 00:00:00 2001 From: StrawberryTea Date: Fri, 10 May 2024 22:08:32 -0500 Subject: [PATCH 2/2] fix(config): fix corfu smart tab behavior --- modules/config/default/autoload/filters.el | 7 ------- modules/config/default/config.el | 8 ++++++-- 2 files changed, 6 insertions(+), 9 deletions(-) delete mode 100644 modules/config/default/autoload/filters.el diff --git a/modules/config/default/autoload/filters.el b/modules/config/default/autoload/filters.el deleted file mode 100644 index 09e6d2323..000000000 --- a/modules/config/default/autoload/filters.el +++ /dev/null @@ -1,7 +0,0 @@ -;;; config/default/autoload/filters.el -*- lexical-binding: t; -*- - -;;;###autoload -(defun +yas-active-p () - "Return t if we are in a YASnippet field." - (memq (bound-and-true-p yas--active-field-overlay) - (overlays-in (1- (point)) (1+ (point))))) diff --git a/modules/config/default/config.el b/modules/config/default/config.el index b92ee6405..667b6abb0 100644 --- a/modules/config/default/config.el +++ b/modules/config/default/config.el @@ -496,13 +496,15 @@ Continues comments if executed from a commented line. Consults (cond ,@(when (modulep! :editor snippets) '(((and +corfu-want-tab-prefer-navigating-snippets - (+yas-active-p)) + (memq (bound-and-true-p yas--active-field-overlay) + (overlays-in (1- (point)) (1+ (point))))) #'yas-next-field-or-maybe-expand) ((and +corfu-want-tab-prefer-expand-snippets (yas-maybe-expand-abbrev-key-filter 'yas-expand)) #'yas-expand))) ,@(when (modulep! :lang org) '(((and +corfu-want-tab-prefer-navigating-org-tables + (featurep 'org) (org-at-table-p)) #'org-table-next-field))) (t cmd)))) ) @@ -513,10 +515,12 @@ Continues comments if executed from a commented line. Consults (cond ,@(when (modulep! :editor snippets) '(((and +corfu-want-tab-prefer-navigating-snippets - (+yas-active-p)) + (memq (bound-and-true-p yas--active-field-overlay) + (overlays-in (1- (point)) (1+ (point))))) #'yas-prev-field))) ,@(when (modulep! :lang org) '(((and +corfu-want-tab-prefer-navigating-org-tables + (featurep 'org) (org-at-table-p)) #'org-table-previous-field))) (t cmd))))))