~hristoast/dot-emacs

c822a776ba4c86c738e332f85a148ec76a6cf7cf — Hristos N. Triantafillou 3 months ago b9097af
Break these out into their own files
3 files changed, 60 insertions(+), 1 deletions(-)

M init.el
A lib/h-company.el
A lib/h-flycheck.el
M init.el => init.el +3 -1
@@ 40,7 40,7 @@
;; Module definitions
(defvar hristoast-modules
  #s(hash-table
     size 39
     size 42
     data
     ;; "Env var that disables loading if present" "file name in lib/ minus the extension"
     ;; Be sure to check `list-load-path-shadows' every so often!


@@ 50,6 50,8 @@
      "EMACS_NO_KEYBINDINGS_TWEAKS" "keybindings"
      "EMACS_NO_UI_TWEAKS" "ui"

      "EMACS_NO_COMPANY" "h-company"
      "EMACS_NO_FLYCHECK" "h-flycheck"
      "EMACS_NO_LSP" "h-lsp"
      "EMACS_NO_ANSIBLE" "ansible"
      "EMACS_NO_C_CPP" "c-cpp"

A lib/h-company.el => lib/h-company.el +42 -0
@@ 0,0 1,42 @@
;;; h-company.el --- Packages related to company mode.
;;; Commentary:
;; Packages related to company mode.
;;; Code:

;; Modular in-buffer completion framework for Emacs
;; http://company-mode.github.io/
(use-package company
  :straight t
  :diminish company-mode
  :hook (after-init . global-company-mode)
  :config
  (setq
   company-echo-delay 0
   company-idle-delay 0.0
   company-minimum-prefix-length 1
   company-tooltip-align-annotations t
   company-tooltip-limit 20)
  ;; Default colors are awful - borrowed these from gocode (thanks!):
  ;; https://github.com/nsf/gocode/tree/master/emacs-company#color-customization
  ;; See: M-x list-colors-display
  ;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Colors.html
  (set-face-attribute
   'company-preview nil :foreground "black" :underline t)
  (set-face-attribute
   'company-preview-common nil :inherit 'company-preview)
  (set-face-attribute
   'company-tooltip nil :background "gray44" :foreground "black")
  (set-face-attribute
   'company-tooltip-selection nil :background "LavenderBlush4" :foreground "DarkOliveGreen2")
  (set-face-attribute
   'company-tooltip-common nil :foreground "OliveDrab3" :weight 'bold)
  (set-face-attribute
   'company-tooltip-common-selection nil :foreground "black" :weight 'bold))

(unless (getenv "EMACS_NO_COMPANY_ICONS")
  (use-package company-box
    :diminish company-box-mode
    :straight t
    :hook (company-mode . company-box-mode)))

;;; h-company.el ends here

A lib/h-flycheck.el => lib/h-flycheck.el +15 -0
@@ 0,0 1,15 @@
;;; h-flycheck.el --- Packages related to flycheck.
;;; Commentary:
;; Packages related to flycheck.
;;; Code:

;; Syntax checking for GNU Emacs - http://www.flycheck.org/
(use-package flycheck
  :straight t
  :bind
  (("C-c e n" . flycheck-next-error)
   ("C-c e p" . flycheck-previous-error))
  ;; https://www.flycheck.org/en/latest/user/installation.html#use-package
  :init (global-flycheck-mode))

;;; h-flycheck.el ends here