mirror of
https://github.com/fscotto/infra.git
synced 2026-09-27 19:03:47 +00:00
Refactor Emacs for authoring workflows
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
;;; completion.el -*- lexical-binding: t; -*-
|
||||
;;; completion.el --- Completion for writing -*- lexical-binding: t; -*-
|
||||
|
||||
(require 'use-package)
|
||||
|
||||
(use-package ivy
|
||||
:ensure t
|
||||
@@ -9,32 +11,6 @@
|
||||
:ensure t
|
||||
:defer t)
|
||||
|
||||
(use-package company
|
||||
:ensure t
|
||||
:custom
|
||||
(company-tooltip-align-annotations 't)
|
||||
(company-minimum-prefix-length 1)
|
||||
(company-idle-delay 0.1)
|
||||
:hook (prog-mode . company-mode))
|
||||
|
||||
(with-eval-after-load 'company
|
||||
(add-hook 'bash-ts-mode-hook 'company-mode))
|
||||
|
||||
;; Static analysis for code base
|
||||
(use-package flycheck
|
||||
:ensure t
|
||||
:hook (prog-mode . flycheck-mode)
|
||||
:config
|
||||
(setq flycheck-check-syntax-automatically '(save mode-enabled)))
|
||||
|
||||
;; Snippets
|
||||
(use-package yasnippet
|
||||
:ensure t
|
||||
:config
|
||||
(setq yas/root-directory
|
||||
(list "~/.emacs.d/snippets") yas-indent-line 'fixed)
|
||||
(yas-global-mode))
|
||||
|
||||
(use-package orderless
|
||||
:ensure t
|
||||
:custom
|
||||
@@ -43,21 +19,18 @@
|
||||
(completion-pcm-leading-wildcard t)
|
||||
:config
|
||||
(setq ivy-re-builders-alist '((t . orderless-ivy-re-builder)))
|
||||
(add-to-list 'ivy-highlight-functions-alist '(orderless-ivy-re-builder . orderless-ivy-highlight)))
|
||||
(add-to-list 'ivy-highlight-functions-alist
|
||||
'(orderless-ivy-re-builder . orderless-ivy-re-builder-highlight)))
|
||||
|
||||
(defun just-one-face (fn &rest args)
|
||||
(let ((orderless-match-faces [completions-common-part]))
|
||||
(apply fn args)))
|
||||
|
||||
(advice-add 'company-capf--candidates :around #'just-one-face)
|
||||
(use-package yasnippet
|
||||
:ensure t
|
||||
:config
|
||||
(yas-global-mode))
|
||||
|
||||
(use-package smartparens
|
||||
:ensure smartparens ;; install the package
|
||||
:hook (prog-mode text-mode markdown-mode) ;; add `smartparens-mode` to these hooks
|
||||
:ensure t
|
||||
:hook (text-mode . smartparens-mode)
|
||||
:config
|
||||
;; load default config
|
||||
(require 'smartparens-config))
|
||||
|
||||
(provide 'completion)
|
||||
|
||||
;;; completion.el ends here
|
||||
(provide 'tools/completion)
|
||||
|
||||
Reference in New Issue
Block a user