+ :popup -> set-popup-rule! + :popups -> set-popup-rules! + :company-backend -> set-company-backend! + :evil-state -> set-evil-initial-state! I am slowly phasing out the setting system (def-setting! and set!), starting with these. What are autodefs? These are functions that are always defined, whether or not their respective modules are enabled. However, when their modules are disabled, they are replaced with macros that no-op and don't waste time evaluating their arguments. The old set! function will still work, for a while.
52 lines
1.3 KiB
EmacsLisp
52 lines
1.3 KiB
EmacsLisp
;;; lang/data/config.el -*- lexical-binding: t; -*-
|
|
|
|
;; Built in plugins
|
|
(dolist (spec '(("/sxhkdrc\\'" . conf-mode)
|
|
("\\.\\(?:hex\\|nes\\)\\'" . hexl-mode)
|
|
("\\.plist\\'" . nxml-mode)))
|
|
(map-put auto-mode-alist (car spec) (cdr spec)))
|
|
|
|
(after! nxml-mode
|
|
(set-company-backend! 'nxml-mode '(company-nxml company-yasnippet)))
|
|
|
|
|
|
;;
|
|
;; Third-party plugins
|
|
;;
|
|
|
|
;; `csv-mode'
|
|
(map! :after csv-mode
|
|
:map csv-mode-map
|
|
(:localleader
|
|
:desc "Align fields" :nvm "a" #'csv-align-fields
|
|
:desc "Unalign fields" :nvm "u" #'csv-unalign-fields
|
|
:desc "Sort fields" :nvm "s" #'csv-sort-fields
|
|
:desc "Sort fields (n)" :nvm "S" #'csv-sort-numeric-fields
|
|
:desc "Kill fields" :nvm "k" #'csv-kill-fields
|
|
:desc "Transpose fields" :nvm "t" #'csv-transpose))
|
|
|
|
(def-package! graphql-mode
|
|
:mode "\\.gql\\'")
|
|
|
|
(def-package! json-mode
|
|
:mode "\\.js\\(?:on\\|[hl]int\\(rc\\)?\\)\\'"
|
|
:config
|
|
(when (featurep! :feature syntax-checker)
|
|
(add-hook 'json-mode-hook #'flycheck-mode))
|
|
(set! :electric 'json-mode :chars '(?\n ?: ?{ ?})))
|
|
|
|
(def-package! vimrc-mode
|
|
:mode "\\.?vimperatorrc\\'")
|
|
|
|
|
|
;;
|
|
;; Frameworks
|
|
;;
|
|
|
|
(def-project-mode! +data-ansible-mode
|
|
:modes (yaml-mode)
|
|
:files ("roles/"))
|
|
|
|
(def-project-mode! +data-vagrant-mode
|
|
:files ("Vagrantfile"))
|
|
|