summaryrefslogtreecommitdiff
path: root/jakob.org
diff options
context:
space:
mode:
authorJakob L. Kreuze2019-02-17 10:03:09 -0500
committerJakob L. Kreuze2019-02-17 10:03:09 -0500
commitb3f89c0603007a6b98adac30f6b7c17de73a083f (patch)
tree1662a966df9b580f745a9aa9ed2100659a82f884 /jakob.org
parentf86a59412b61a5978f78602d8b0fb5652463bfa7 (diff)
Add initial configuration for company
Diffstat (limited to 'jakob.org')
-rw-r--r--jakob.org43
1 files changed, 38 insertions, 5 deletions
diff --git a/jakob.org b/jakob.org
index a1ac237..a4d9dac 100644
--- a/jakob.org
+++ b/jakob.org
@@ -684,6 +684,13 @@ they look like."
`(font-lock-variable-name-face ((,class (:foreground ,yellow-1))))
`(font-lock-warning-face ((,class (:weight bold :foreground ,red-2))))
+ ;; company
+ `(company-tooltip ((,class (:background ,black-4))))
+ `(company-scrollbar-bg ((,class (:background ,black-4))))
+ `(company-scrollbar-fg ((,class (:background ,orange-2))))
+ `(company-tooltip-selection ((,class (:background ,black-3))))
+ `(company-tooltip-common ((,class (:foreground ,blue-1))))
+
;; org-mode
`(org-block ((,class (:foreground ,white-1 :background ,black-4))))
`(org-block-begin-line ((,class (:foreground ,black-3))))
@@ -943,7 +950,9 @@ because it gets in the way of readline.
exwm-input-simulation-keys
'(([?\C-q] . [?\C-w])))))
(when (and exwm-class-name
- (string= exwm-class-name "kitty"))
+ (or
+ (string= exwm-class-name "kitty")
+ (string= exwm-class-name "mutt")))
(exwm-input-set-local-simulation-keys nil))))
#+END_SRC
@@ -1626,6 +1635,7 @@ always using =dumb-jump= instead of a proper tag indexer.
(define-key dumb-jump-mode-map (kbd "M-,") #'dumb-jump-back)
(dumb-jump-mode))
#+END_SRC
+
* helpful
A wonderful improvement upon the vanilla =describe-.*= functions, showing source
@@ -1639,6 +1649,7 @@ code, keybindings, symbol properties, and more.
("C-h C" . helpful-command)
("C-c C-d" . helpful-at-point)))
#+END_SRC
+
* cc
Generally, I adhere to the [[https://www.kernel.org/doc/html/v4.10/process/coding-style.html][Linux kernel coding style]].
@@ -1646,13 +1657,35 @@ Generally, I adhere to the [[https://www.kernel.org/doc/html/v4.10/process/codin
#+BEGIN_SRC elisp
(use-package cc-mode
:hook
- (c-mode . (lambda () (c-set-style "linux")))
+ (c-mode . (lambda () (c-set-style "linux"))))
+#+END_SRC
+
+* company
+
+Start suggesting completions ASAP.
+
+#+BEGIN_SRC elisp
+(use-package company
+ :config
+ (setq company-idle-delay 0)
+ (setq company-minimum-prefix-length 3)
#+END_SRC
-Automatically insert the leading asterisk when continuing a multi-line comment.
+Use standard movement keys instead of those used for minibuffer next/previous.
#+BEGIN_SRC elisp
:bind
- (:map c-mode-map
- ("RET" . c-indent-new-comment-line)))
+ (:map company-active-map
+ ("M-n" . nil)
+ ("M-p" . nil)
+ ("C-n" . #'company-select-next)
+ ("C-p" . #'company-select-previous))
+#+END_SRC
+
+Enable company-mode for a few modes.
+
+#+BEGIN_SRC elisp
+ :hook
+ (lisp-interaction-mode . company-mode)
+ (emacs-lisp-mode . company-mode))
#+END_SRC

© 2015 - 2026 Jakob L. Kreuze