Merge pull request #2 from LemonBreezes/fix-some-bugs
Minor fixes to the code
This commit is contained in:
commit
f6b9d15b66
1 changed files with 23 additions and 21 deletions
|
@ -12,6 +12,10 @@ major mode regardless of size.")
|
||||||
:hook ((doom-first-buffer . global-corfu-mode)
|
:hook ((doom-first-buffer . global-corfu-mode)
|
||||||
(org-mode . corfu-mode))
|
(org-mode . corfu-mode))
|
||||||
:init
|
:init
|
||||||
|
(when (modulep! +orderless)
|
||||||
|
(after! orderless
|
||||||
|
(setq orderless-component-separator #'orderless-escapable-split-on-space)))
|
||||||
|
|
||||||
;; Auto-completion settings, must be set before calling `global-corfu-mode'.
|
;; Auto-completion settings, must be set before calling `global-corfu-mode'.
|
||||||
;; Due to lazy-loading, overriding these in config.el works too.
|
;; Due to lazy-loading, overriding these in config.el works too.
|
||||||
(setq corfu-auto t
|
(setq corfu-auto t
|
||||||
|
@ -80,10 +84,6 @@ major mode regardless of size.")
|
||||||
;; Allow completion after `:' in Lispy.
|
;; Allow completion after `:' in Lispy.
|
||||||
(add-to-list 'corfu-auto-commands #'lispy-colon)
|
(add-to-list 'corfu-auto-commands #'lispy-colon)
|
||||||
|
|
||||||
(when (modulep! +orderless)
|
|
||||||
(after! orderless
|
|
||||||
(setq orderless-component-separator #'orderless-escapable-split-on-space)))
|
|
||||||
|
|
||||||
(add-hook! 'evil-insert-state-exit-hook
|
(add-hook! 'evil-insert-state-exit-hook
|
||||||
(defun +corfu-quit-on-evil-insert-state-exit-h ()
|
(defun +corfu-quit-on-evil-insert-state-exit-h ()
|
||||||
;; This predicate a workaround for unexpected calls to `corfu-quit' in
|
;; This predicate a workaround for unexpected calls to `corfu-quit' in
|
||||||
|
@ -188,7 +188,6 @@ major mode regardless of size.")
|
||||||
(add-hook 'completion-at-point-functions #'cape-elisp-block 0 t))
|
(add-hook 'completion-at-point-functions #'cape-elisp-block 0 t))
|
||||||
|
|
||||||
;; Enable Dabbrev completion basically everywhere as a fallback.
|
;; Enable Dabbrev completion basically everywhere as a fallback.
|
||||||
(when (modulep! +dabbrev)
|
|
||||||
;; Set up `cape-dabbrev' options.
|
;; Set up `cape-dabbrev' options.
|
||||||
(defun +dabbrev-friend-buffer-p (other-buffer)
|
(defun +dabbrev-friend-buffer-p (other-buffer)
|
||||||
(< (buffer-size other-buffer) +cape-buffer-scanning-size-limit))
|
(< (buffer-size other-buffer) +cape-buffer-scanning-size-limit))
|
||||||
|
@ -199,10 +198,12 @@ major mode regardless of size.")
|
||||||
"^ "
|
"^ "
|
||||||
"\\(TAGS\\|tags\\|ETAGS\\|etags\\|GTAGS\\|GRTAGS\\|GPATH\\)\\(<[0-9]+>\\)?")
|
"\\(TAGS\\|tags\\|ETAGS\\|etags\\|GTAGS\\|GRTAGS\\|GPATH\\)\\(<[0-9]+>\\)?")
|
||||||
dabbrev-upcase-means-case-search t)
|
dabbrev-upcase-means-case-search t)
|
||||||
|
(when (modulep! +dabbrev)
|
||||||
(add-hook! (prog-mode text-mode conf-mode comint-mode minibuffer-setup
|
(add-hook! (prog-mode text-mode conf-mode comint-mode minibuffer-setup
|
||||||
eshell-mode)
|
eshell-mode)
|
||||||
(add-hook 'completion-at-point-functions #'cape-dabbrev 20 t)))
|
(add-hook 'completion-at-point-functions #'cape-dabbrev 20 t)))
|
||||||
(when (modulep! +line)
|
|
||||||
|
|
||||||
;; Set up `cape-line' options.
|
;; Set up `cape-line' options.
|
||||||
(defun +cape-line-buffers ()
|
(defun +cape-line-buffers ()
|
||||||
(cl-loop for buf in (buffer-list)
|
(cl-loop for buf in (buffer-list)
|
||||||
|
@ -210,6 +211,7 @@ major mode regardless of size.")
|
||||||
(< (buffer-size buf) +cape-buffer-scanning-size-limit))
|
(< (buffer-size buf) +cape-buffer-scanning-size-limit))
|
||||||
collect buf))
|
collect buf))
|
||||||
(setq cape-line-buffer-function #'+cape-line-buffers)
|
(setq cape-line-buffer-function #'+cape-line-buffers)
|
||||||
|
(when (modulep! +line)
|
||||||
(add-hook! (text-mode comint-mode minibuffer-setup)
|
(add-hook! (text-mode comint-mode minibuffer-setup)
|
||||||
(add-hook 'completion-at-point-functions #'cape-line 20 t)))
|
(add-hook 'completion-at-point-functions #'cape-line 20 t)))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue