From 8a438d164f17f5261da39231cd0e903b85f62d8d Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 27 Mar 2021 03:55:21 +0000 Subject: clean-ups --- consult.org | 10 +++++++--- exwm.org | 8 ++++---- init.org | 55 ++++++++++++++++++------------------------------------- 3 files changed, 29 insertions(+), 44 deletions(-) diff --git a/consult.org b/consult.org index 72e30cc..d4854aa 100644 --- a/consult.org +++ b/consult.org @@ -1,13 +1,17 @@ #+title: Completion configuration using selectrum, consult and friends -* completion styles: orderless +* completion styles #+begin_src emacs-lisp + (setq completion-styles '(basic partial-completion emacs22)) + #+end_src +* completion styles: orderless + #+begin_src emacs-lisp :load no (use-package orderless :ensure t - :custom ((completion-styles '(basic partial-completion emacs22)) + :custom ((completion-styles '(orderless)) + (orderless-component-separator "[ -/]+") (orderless-matching-styles '(orderless-literal orderless-regexp orderless-initialism))) - :init :bind ((:map minibuffer-local-completion-map ("SPC" . self-insert-command)))) #+end_src diff --git a/exwm.org b/exwm.org index 996c840..26a1779 100644 --- a/exwm.org +++ b/exwm.org @@ -16,7 +16,7 @@ (use-package exwm-edit :ensure t) (require 'exwm) #+end_src -* Frames as workspaces +* Frame(s) as workspaces #+begin_src emacs-lisp (defun jao-exwm--new-frame-p () (not (frame-parameter nil 'jao-frames-initialized))) @@ -75,8 +75,8 @@ #+begin_src emacs-lisp (add-hook 'exwm-workspace-switch-hook 'tracking-remove-visible-buffers) #+end_src -* Buffer titles - #+BEGIN_SRC emacs-lisp +* Buffer names + #+begin_src emacs-lisp (defun jao-exwm--use-title-p () (or (string-prefix-p "sun-awt-X11-" exwm-instance-name) (string= "Navigator" exwm-instance-name) @@ -104,7 +104,7 @@ (add-hook 'exwm-mode-hook 'jao-exwm--set-exwm-name) (add-hook 'exwm-update-class-hook 'jao-exwm-rename-buffer/class) (add-hook 'exwm-update-title-hook 'jao-exwm-rename-buffer/title) - #+END_SRC + #+end_src * Float windows #+begin_src emacs-lisp (defvar jao-exwm-max-x (x-display-pixel-width)) diff --git a/init.org b/init.org index 2b1a695..9e1669b 100644 --- a/init.org +++ b/init.org @@ -231,10 +231,6 @@ (string-trim)))) #+end_src -*** Memory usage - #+begin_src emacs-lisp - (use-package memory-usage :ensure t) - #+end_src *** Keyboard and hydra #+begin_src emacs-lisp @@ -872,18 +868,13 @@ (setq company-require-match #'company-explicit-action-p) (defun jao-complete-at-point () + "Complete using company unless we're in the minibuffer." (interactive) (if (window-minibuffer-p) (completion-at-point) (company-manual-begin))) - :bind (;; Remap the standard Emacs keybindings for invoking - ;; completion to instead use Company. You might think this - ;; could be put in the `:bind*' declaration below, but it - ;; seems that `bind-key*' does not work with remappings. - ([remap completion-at-point] . #'jao-complete-at-point) + :bind (([remap completion-at-point] . #'jao-complete-at-point) ([remap complete-symbol] . #'jao-complete-at-point) - ("C-c ." . company-complete) - ;; The following are keybindings that take effect whenever ;; the completions menu is visible, even if the user has not ;; explicitly interacted with Company. @@ -894,35 +885,25 @@ ("" . #'company-complete-selection) ("TAB" . #'company-complete-selection) - ;; When was the last time you used the C-s binding for - ;; searching candidates? It conflicts with buffer search, - ;; anyway. Same for the scroll commands. - ("C-s" . nil) - ([remap scroll-down-command] . nil) - ([remap scroll-up-command] . nil) - - ("C-h" . company-show-doc-buffer) - ("M-." . company-show-location) + ("C-h" . #'company-show-doc-buffer) + ("M-." . #'company-show-location) - ;; The following are keybindings that only take effect if the - ;; user has explicitly interacted with Company. Note that - ;; `:map' from above is "sticky", and applies also below: see - ;; https://github.com/jwiegley/use-package/issues/334#issuecomment-349473819. + ;; The following are keybindings that only take effect + ;; if not in eshell. Note that `:map' from above is + ;; "sticky", and applies also below. + ;; Another interesting :filter (company-explicit-action-p) - :filter (company-explicit-action-p) - - ;; Make RET trigger a completion if and only if the user has - ;; explicitly interacted with Company, instead of always - ;; doing so. + :filter (not (derived-mode-p 'eshell-mode)) ("" . #'company-complete-selection) ("RET" . #'company-complete-selection)) - :bind* (;; The default keybinding for `completion-at-point' and - ;; `complete-symbol' is M-TAB or equivalently C-M-i. We - ;; already remapped those bindings to `company-manual-begin' - ;; above. Here we make sure that they definitely invoke - ;; `company-manual-begin' even if a minor mode binds M-TAB - ;; directly. - ("M-TAB" . #'jao-complete-at-point)) + + :bind* (;; The default keybinding for `completion-at-point' and + ;; `complete-symbol' is M-TAB or equivalently C-M-i. We + ;; already remapped those bindings to `company-manual-begin' + ;; above. Here we make sure that they definitely invoke + ;; `company-manual-begin' even if a minor mode binds M-TAB + ;; directly. + ("M-TAB" . #'jao-complete-at-point)) :diminish) @@ -1751,7 +1732,7 @@ ***** Attach image to message Use ~C-c C-p~ in message-mode. ***** Org-mime - #+BEGIN_SRC emacs-lisp + #+BEGIN_SRC emacs-lisp :load no (use-package org-mime :ensure t :init (setq org-mime-beautify-quoted-mail t) :bind (:map message-mode-map ("C-c M-o" . org-mime-htmlize))) -- cgit v1.2.3