Move all init-xxx files into extensions.el
This commit is contained in:
parent
ddb8e0a38f
commit
3165a91e9f
|
@ -116,15 +116,13 @@ extension.
|
|||
(load init-file))))
|
||||
|
||||
(defun spacemacs/initialize-extensions (ext-list)
|
||||
"Initialize all the declared in EXT-LIST hash table."
|
||||
"Initialize all the declared extensions in EXT-LIST hash table."
|
||||
(ht-each 'spacemacs/initialize-extension ext-list))
|
||||
|
||||
(defun spacemacs/initialize-extension (ext lsym)
|
||||
"Initialize the extension EXT from the configuration layer LSYM."
|
||||
(let* ((layer (assq lsym spacemacs-config-layers))
|
||||
(ext-dir (plist-get (cdr layer) :ext-dir))
|
||||
(init-dir (plist-get (cdr layer) :init-dir))
|
||||
(init-file (concat init-dir (format "init-%s.el" ext))))
|
||||
(add-to-list 'load-path (format "%s%s/" ext-dir ext))
|
||||
(if (file-exists-p init-file)
|
||||
(load init-file))))
|
||||
(init-func (intern (format "%s/init-%s" (symbol-name lsym) ext))))
|
||||
(add-to-list 'load-path (format "%s%s/" ext-dir ext))
|
||||
(funcall init-func)))
|
||||
|
|
|
@ -19,3 +19,83 @@
|
|||
pylookup
|
||||
solarized-theme
|
||||
))
|
||||
|
||||
;; Initialize the extensions
|
||||
|
||||
(defun spacemacs/init-use-package ()
|
||||
(require 'use-package))
|
||||
|
||||
(defun spacemacs/init-centered-cursor ()
|
||||
(use-package centered-cursor-mode
|
||||
:commands global-centered-cursor-mode
|
||||
:init
|
||||
(evil-leader/set-key "zz" 'global-centered-cursor-mode)
|
||||
:config
|
||||
(custom-set-variables
|
||||
'(ccm-recenter-at-end-of-file t)
|
||||
'(ccm-ignored-commands (quote (mouse-drag-region
|
||||
mouse-set-point
|
||||
widget-button-click
|
||||
scroll-bar-toolkit-scroll
|
||||
evil-mouse-drag-region))))))
|
||||
|
||||
(defun spacemacs/init-dos ()
|
||||
(use-package dos
|
||||
:mode ("\\.bat$" . dos-mode)))
|
||||
|
||||
(defun spacemacs/init-emoji-cheat-sheet ()
|
||||
(use-package emoji-cheat-sheet
|
||||
:commands emoji-cheat-sheet))
|
||||
|
||||
(defun spacemacs/init-evil-org-mode ()
|
||||
(use-package evil-org
|
||||
:commands evil-org-mode
|
||||
:init (add-hook 'org-mode-hook 'evil-org-mode)))
|
||||
|
||||
(defun spacemacs/init-evil-plugins ()
|
||||
(use-package evil-little-word)
|
||||
(use-package evil-operator-comment
|
||||
:init
|
||||
(global-evil-operator-comment-mode 1)))
|
||||
|
||||
(defun spacemacs/init-nose ()
|
||||
(use-package nose
|
||||
:commands (nosetests-one
|
||||
nosetests-pdb-one
|
||||
nosetests-all
|
||||
nosetests-pdb-all
|
||||
nosetests-module
|
||||
nosetests-pdb-module
|
||||
nosetests-suite
|
||||
nosetests-pdb-suite)
|
||||
:config
|
||||
(progn
|
||||
(add-to-list 'nose-project-root-files "setup.cfg")
|
||||
(setq nose-use-verbose nil))))
|
||||
|
||||
(defun spacemacs/init-o-blog ()
|
||||
(use-package o-blog
|
||||
:defer t))
|
||||
|
||||
(defun spacemacs/init-pylookup ()
|
||||
(use-package pylookup
|
||||
:commands pylookup-lookup
|
||||
:config
|
||||
(progn
|
||||
(setq pylookup-dir (concat spacemacs-extensions-directory "/pylookup"))
|
||||
;; set executable file and db file
|
||||
(setq pylookup-program (concat pylookup-dir "/pylookup.py"))
|
||||
(setq pylookup-db-file (concat pylookup-dir "/pylookup.db")))))
|
||||
|
||||
(defun spacemacs/init-solarized-theme ()
|
||||
;; different method used than the documented one in order to speed up the
|
||||
;; loading of emacs
|
||||
(use-package solarized
|
||||
:init
|
||||
(progn
|
||||
(deftheme solarized-light "The light variant of the Solarized colour theme")
|
||||
(create-solarized-theme 'light 'solarized-light)
|
||||
(deftheme solarized-dark "The dark variant of the Solarized colour theme")
|
||||
(create-solarized-theme 'dark 'solarized-dark)
|
||||
(spacemacs/set-flycheck-custom-face)
|
||||
)))
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
(use-package centered-cursor-mode
|
||||
:commands global-centered-cursor-mode
|
||||
:init
|
||||
(evil-leader/set-key "zz" 'global-centered-cursor-mode)
|
||||
:config
|
||||
(custom-set-variables
|
||||
'(ccm-recenter-at-end-of-file t)
|
||||
'(ccm-ignored-commands (quote (mouse-drag-region
|
||||
mouse-set-point
|
||||
widget-button-click
|
||||
scroll-bar-toolkit-scroll
|
||||
evil-mouse-drag-region))))
|
||||
)
|
|
@ -1,3 +0,0 @@
|
|||
(use-package dos
|
||||
:mode ("\\.bat$" . dos-mode))
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
(use-package emoji-cheat-sheet
|
||||
:commands emoji-cheat-sheet)
|
|
@ -1,3 +0,0 @@
|
|||
(use-package evil-org
|
||||
:commands evil-org-mode
|
||||
:init (add-hook 'org-mode-hook 'evil-org-mode))
|
|
@ -1,5 +0,0 @@
|
|||
(use-package evil-little-word)
|
||||
|
||||
(use-package evil-operator-comment
|
||||
:init
|
||||
(global-evil-operator-comment-mode 1))
|
|
@ -1,13 +0,0 @@
|
|||
(use-package nose
|
||||
:commands (nosetests-one
|
||||
nosetests-pdb-one
|
||||
nosetests-all
|
||||
nosetests-pdb-all
|
||||
nosetests-module
|
||||
nosetests-pdb-module
|
||||
nosetests-suite
|
||||
nosetests-pdb-suite)
|
||||
:config
|
||||
(progn
|
||||
(add-to-list 'nose-project-root-files "setup.cfg")
|
||||
(setq nose-use-verbose nil)))
|
|
@ -1,2 +0,0 @@
|
|||
(use-package o-blog
|
||||
:defer t)
|
|
@ -1,8 +0,0 @@
|
|||
(use-package pylookup
|
||||
:commands pylookup-lookup
|
||||
:config
|
||||
(progn
|
||||
(setq pylookup-dir (concat spacemacs-extensions-directory "/pylookup"))
|
||||
;; set executable file and db file
|
||||
(setq pylookup-program (concat pylookup-dir "/pylookup.py"))
|
||||
(setq pylookup-db-file (concat pylookup-dir "/pylookup.db"))))
|
|
@ -1,12 +0,0 @@
|
|||
;; different method used than the documented one in order to speed up the
|
||||
;; loading of emacs
|
||||
(use-package solarized
|
||||
:init
|
||||
(progn
|
||||
(deftheme solarized-light "The light variant of the Solarized colour theme")
|
||||
(create-solarized-theme 'light 'solarized-light)
|
||||
(deftheme solarized-dark "The dark variant of the Solarized colour theme")
|
||||
(create-solarized-theme 'dark 'solarized-dark)
|
||||
(spacemacs/set-flycheck-custom-face)
|
||||
))
|
||||
|
|
@ -1 +0,0 @@
|
|||
(require 'use-package)
|
Loading…
Reference in New Issue