summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-05-15 00:25:02 +0100
committerjao <jao@gnu.org>2021-05-15 00:25:02 +0100
commit0df3477db2f54656f1edbe413333b719bac26496 (patch)
treeb42b71c8582a394630a5345009f6abba01639212
parentfbb9546b2fb33e0b6981350432a5c64ee7188234 (diff)
downloadelibs-0df3477db2f54656f1edbe413333b719bac26496.tar.gz
elibs-0df3477db2f54656f1edbe413333b719bac26496.tar.bz2
attic
-rw-r--r--attic/misc.org81
1 files changed, 59 insertions, 22 deletions
diff --git a/attic/misc.org b/attic/misc.org
index d9d1aaa..397bfcb 100644
--- a/attic/misc.org
+++ b/attic/misc.org
@@ -1,5 +1,15 @@
#+title: Miscellaneous config bits that i don't use anymore
+* enwc (network monitor)
+ #+BEGIN_SRC emacs-lisp
+ (use-package enwc
+ :ensure t
+ :init (setq enwc-default-backend 'nm
+ enwc-backend 'nm
+ enwc-display-mode-line nil
+ enwc-wired-device "enp3s0f0"
+ enwc-wireless-device "wlp1s0"))
+ #+END_SRC
* frm
#+begin_src emacs-lisp
(use-package jao-frm
@@ -70,19 +80,15 @@
(when (string-match "/\\([^/]+\\)/.*" md)
(match-string 1 md)))))
- (defun jao-mu4e--maildir-folder (dir)
- `(lambda (msg)
- (format "/%s/%s" (jao-mu4e--maildir msg) ,dir)))
-
(defun jao-mu4e--refile-folder (msg)
(let ((md (jao-mu4e--maildir msg)))
(if (string= md "trove")
"/trove/jao"
(format "/trove/%" md))))
- (setq mu4e-sent-folder (jao-mu4e--maildir-folder "sent"))
- (setq mu4e-drafts-folder (jao-mu4e--maildir-folder "trash"))
- (setq mu4e-trash-folder (jao-mu4e--maildir-folder "trash"))
+ (setq mu4e-sent-folder #'jao-mu4e--refile-folder)
+ (setq mu4e-drafts-folder "/trove/drafts")
+ (setq mu4e-trash-folder "/trash")
(setq mu4e-refile-folder 'jao-mu4e--refile-folder)
(setq mu4e-contexts nil)
@@ -99,25 +105,56 @@
'("ViewInBrowser" . mu4e-action-view-in-browser) t))
#+end_src
-* corfu and dabbrev
+* company
#+begin_src emacs-lisp
- (jao-load-path "corfu")
- (use-package corfu
- :commands (corfu-mode)
- :init (setq corfu-cycle t
- corfu-excluded-modes '(clojure-mode)
- tab-always-indent 'complete)
+ (use-package company
+ :ensure t
+ :custom ((company-backends '(company-capf
+ company-bbdb
+ company-files
+ company-dabbrev
+ company-keywords))
+ (company-global-modes '(not slack-message-buffer-mode
+ circe-channel-mode
+ telega-chat-mode))
+ (company-format-margin-function nil) ;; #'company-text-icons-margin
+ (company-idle-delay 0.2)
+ (company-lighter "")
+ (company-lighter-base "")
+ (company-show-numbers nil)
+ (company-selection-wrap-around t)
+ (company-tooltip-limit 15)
+ (company-tooltip-align-annotations t)
+ (company-tooltip-offset-display 'lines)) ;; 'scrollbar
:config
+ (defun jao-complete-at-point ()
+ "Complete using company unless we're in the minibuffer."
+ (interactive)
+ (if (or (not company-mode) (window-minibuffer-p))
+ (completion-at-point)
+ (company-manual-begin)))
+
+ (defun jao-company-use-in-tab ()
+ (global-set-key [remap completion-at-point] #'jao-complete-at-point)
+ (global-set-key [remap completion-symbol] #'jao-complete-at-point)
+ (global-set-key (kbd "M-TAB") #'jao-complete-at-point))
+
+ (jao-company-use-in-tab)
+
+ :bind (:map company-active-map
+
+ ("<tab>" . #'company-complete-common-or-cycle)
+ ("TAB" . #'company-complete-common-or-cycle)
- (corfu-global-mode)
+ ("C-h" . #'company-show-doc-buffer)
+ ("M-." . #'company-show-location)
- (use-package dabbrev
- ;; Swap M-/ and C-M-/
- :bind (("M-/" . dabbrev-completion)
- ("C-M-/" . dabbrev-expand)))
+ :filter (or (not (derived-mode-p 'eshell-mode))
+ (company-explicit-action-p))
+ ("<return>" . #'company-complete-selection)
+ ("RET" . #'company-complete-selection))
+ :diminish)
- :bind (:map corfu-map
- ("TAB" . corfu-next)
- ("S-TAB" . corfu-previous)))
+ (global-company-mode 1)
#+end_src