mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
Majorly re-organize modules
- Split large modules into smaller parts (e.g. siren-text-manipulation) - Organize modules into high level groups: - completion - core - editor - languages - linting - misc - navigation - projects - spelling - text-editing - version-control - windows - workspaces
This commit is contained in:
34
modules/completion/siren-auto-complete.el
Normal file
34
modules/completion/siren-auto-complete.el
Normal file
@@ -0,0 +1,34 @@
|
||||
;;; siren-auto-complete.el --- jimeh's Emacs Siren: auto-complete configuration.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Basic configuration for auto-complete.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'siren-flyspell)
|
||||
|
||||
(use-package auto-complete
|
||||
:bind (:map ac-completing-map
|
||||
("RET" . ac-complete)
|
||||
("C-m" . ac-complete)
|
||||
("C-s" . ac-isearch)
|
||||
("C-n" . ac-next)
|
||||
("C-p" . ac-previous))
|
||||
:config
|
||||
(ac-flyspell-workaround)
|
||||
|
||||
(setq ac-auto-show-menu 0.2
|
||||
ac-auto-start 3
|
||||
ac-delay 0.05
|
||||
ac-menu-height 15)
|
||||
|
||||
;; Auto-complete when indenting.
|
||||
(defadvice indent-for-tab-command (around ac-before-indent activate)
|
||||
"Call `auto-complete' if text was recently entered."
|
||||
(if (ac-trigger-command-p last-command)
|
||||
(auto-complete)
|
||||
ad-do-it)))
|
||||
|
||||
(provide 'siren-auto-complete)
|
||||
;;; siren-auto-complete.el ends here
|
||||
49
modules/completion/siren-company.el
Normal file
49
modules/completion/siren-company.el
Normal file
@@ -0,0 +1,49 @@
|
||||
;;; siren-company.el --- jimeh's Emacs Siren: company configuration.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Basic configuration for company. Auto completion on steroids.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'siren-fci)
|
||||
|
||||
(use-package company
|
||||
:init
|
||||
(defun company-turn-off-fci (&rest ignore)
|
||||
(when (boundp 'fci-mode)
|
||||
(setq company-fci-mode-on-p fci-mode)
|
||||
(when fci-mode (fci-mode -1))))
|
||||
|
||||
(defun company-maybe-turn-on-fci (&rest ignore)
|
||||
(when company-fci-mode-on-p (fci-mode 1)))
|
||||
|
||||
:config
|
||||
;; work-around for issues with fci-mode
|
||||
(defvar-local company-fci-mode-on-p nil)
|
||||
|
||||
(add-hook 'company-completion-started-hook 'company-turn-off-fci)
|
||||
(add-hook 'company-completion-finished-hook 'company-maybe-turn-on-fci)
|
||||
(add-hook 'company-completion-cancelled-hook 'company-maybe-turn-on-fci)
|
||||
|
||||
(setq company-begin-commands '(self-insert-command)
|
||||
company-dabbrev-downcase nil
|
||||
company-echo-delay 0
|
||||
company-idle-delay 0.3
|
||||
company-minimum-prefix-length 2
|
||||
company-tooltip-limit 20
|
||||
;; invert the navigation direction if the the completion popup-isearch-match
|
||||
;; is displayed on top (happens near the bottom of windows)
|
||||
company-tooltip-flip-when-above t)
|
||||
|
||||
(global-company-mode 1)
|
||||
|
||||
;; Customize keybindings for navigating up/down the completion popup list.
|
||||
(define-key company-active-map (kbd "C-n") #'company-select-next)
|
||||
(define-key company-active-map (kbd "C-p") #'company-select-previous)
|
||||
|
||||
;; Enable indent and complete at point functionality by pressing tab.
|
||||
(global-set-key (kbd "TAB") #'company-indent-or-complete-common))
|
||||
|
||||
(provide 'siren-company)
|
||||
;;; siren-company.el ends here
|
||||
Reference in New Issue
Block a user