single syntax with «use-package»

This commit is contained in:
Jesús 2018-10-26 23:27:56 -05:00
parent 4a3d8a46f9
commit aaa86c4187
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766
16 changed files with 120 additions and 125 deletions

View File

@ -1,10 +1,7 @@
;;---------------------------------------------------------------------------- ;;----------------------------------------------------------------------------
;; Crystal Mode ;; Crystal Mode
;;---------------------------------------------------------------------------- ;;----------------------------------------------------------------------------
(use-package crystal-mode) (use-package crystal-mode
:mode ("\\.cr\\'" . crystal-mode))
(autoload 'crystal-mode "crystal-mode" "Major mode for crystal files" t)
(add-to-list 'auto-mode-alist '("\\.cr$" . crystal-mode))
(add-to-list 'interpreter-mode-alist '("crystal" . crystal-mode))
(provide 'init-crystal) (provide 'init-crystal)

View File

@ -1,6 +1,9 @@
;; emmet-mode ;; emmet-mode
(use-package emmet-mode) (use-package emmet-mode
(add-hook 'sgml-mode-hook 'emmet-mode) ;; Auto-start on any markup modes ;; Enable for only languages
(add-hook 'css-mode-hook 'emmet-mode) ;; enable Emmet's css abbreviation. :init
(add-hook 'sgml-mode-hook 'emmet-mode) ;; Auto-start on any markup modes
(add-hook 'css-mode-hook 'emmet-mode) ;; enable Emmet's css abbreviation.
)
(provide 'init-emmet-mode) (provide 'init-emmet-mode)

View File

@ -1,12 +1,12 @@
(use-package flycheck) (use-package flycheck
;; Enable for only languages
;; Enable for only languages :init
;;(add-hook 'emacs-lisp-mode-hook 'flycheck-mode) ;; (add-hook 'after-init-hook 'global-flycheck-mode)
(add-hook 'c++-mode-hook 'flycheck-mode) (add-hook 'c++-mode-hook 'flycheck-mode)
(add-hook 'html-mode-hook 'flycheck-mode) ;; (add-hook 'emacs-lisp-mode-hook 'flycheck-mode)
(add-hook 'sh-mode-hook 'flycheck-mode) (add-hook 'html-mode-hook 'flycheck-mode)
(add-hook 'js-mode-hook 'flycheck-mode) (add-hook 'js-mode-hook 'flycheck-mode)
(add-hook 'php-mode-hook 'flycheck-mode) (add-hook 'php-mode-hook 'flycheck-mode)
;; (add-hook 'after-init-hook 'global-flycheck-mode) (add-hook 'sh-mode-hook 'flycheck-mode))
(provide 'init-flycheck) (provide 'init-flycheck)

View File

@ -1,8 +1,10 @@
;; This minor mode highlights indentation levels via font-lock ;; This minor mode highlights indentation levels via font-lock
(use-package highlight-indent-guides)
(setq highlight-indent-guides-method 'character) (use-package highlight-indent-guides
:config
(add-hook 'prog-mode-hook 'highlight-indent-guides-mode) (setq highlight-indent-guides-method 'character)
;; Indent character samples: fill, column or character
(setq highlight-indent-guides-method 'character)
(add-hook 'prog-mode-hook 'highlight-indent-guides-mode))
(provide 'init-indent-guides) (provide 'init-indent-guides)

View File

@ -1,7 +1,7 @@
;;---------------------------------------------------------------------------- ;;----------------------------------------------------------------------------
;; Less Mode ;; Less Mode
;;---------------------------------------------------------------------------- ;;----------------------------------------------------------------------------
(use-package less-css-mode) (use-package less-css-mode
(add-to-list 'auto-mode-alist '("\\.less$" . less-css-mode)) :mode ("\\.less\\'" . less-css-mode))
(provide 'init-less) (provide 'init-less)

View File

@ -1,20 +1,18 @@
;;---------------------------------------------------------------------------- ;;----------------------------------------------------------------------------
;; Markdown mode ;; Markdown mode
;;---------------------------------------------------------------------------- ;;----------------------------------------------------------------------------
(use-package markdown-mode) (use-package markdown-mode
:mode (("\\.markdown\\'" . markdown-mode)
("\\.md\\'" . markdown-mode))
(autoload 'markdown-mode "markdown-mode" :config
"Major mode for editing Markdown files" t) ;;----------------------------------------------------------------------------
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode)) ;; Generated HTML 5 and UTF-8 with Markdown
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)) ;;----------------------------------------------------------------------------
(eval-after-load "markdown-mode"
'(defalias 'markdown-add-xhtml-header-and-footer 'as/markdown-add-xhtml-header-and-footer))
;;---------------------------------------------------------------------------- (defun as/markdown-add-xhtml-header-and-footer (title)
;; Generated HTML 5 and UTF-8 with Markdown
;;----------------------------------------------------------------------------
(eval-after-load "markdown-mode"
'(defalias 'markdown-add-xhtml-header-and-footer 'as/markdown-add-xhtml-header-and-footer))
(defun as/markdown-add-xhtml-header-and-footer (title)
"Wrap XHTML header and footer with given TITLE around current buffer." "Wrap XHTML header and footer with given TITLE around current buffer."
(goto-char (point-min)) (goto-char (point-min))
(insert "<!DOCTYPE html>\n" (insert "<!DOCTYPE html>\n"
@ -30,6 +28,6 @@
(goto-char (point-max)) (goto-char (point-max))
(insert "\n" (insert "\n"
"</body>\n" "</body>\n"
"</html>\n")) "</html>\n")))
(provide 'init-markdown) (provide 'init-markdown)

View File

@ -4,43 +4,43 @@
(use-package smart-mode-line) (use-package smart-mode-line)
(use-package smart-mode-line-powerline-theme) (use-package smart-mode-line-powerline-theme)
(use-package sml-modeline) (use-package sml-modeline
;; Show number of occurrences when searching :config
(use-package anzu) ;; Show number of occurrences when searching
(setq sml/theme 'powerline)
(setq sml/theme 'powerline) (setq sml/no-confirm-load-theme t)
(setq sml/shorten-modes t)
;; Show EOL mode
(setq sml/show-eol t)
;; Show remote buffers
(setq sml/show-remote t)
(setq sml/no-confirm-load-theme t) (sml/setup)
(setq sml/shorten-modes t) (add-to-list 'sml/replacer-regexp-list '("^~/Proyectos/git/" ":Git:") t)
;; Show EOL mode (add-to-list 'sml/replacer-regexp-list '("^~/www/" ":www:") t)
(setq sml/show-eol t)
;; Show remote buffers
(setq sml/show-remote t)
(sml/setup) (sml-modeline-mode t))
(add-to-list 'sml/replacer-regexp-list '("^~/Proyectos/git/" ":Git:") t) (use-package anzu
(add-to-list 'sml/replacer-regexp-list '("^~/www/" ":www:") t) :config
(custom-set-variables
'(anzu-search-threshold 1000)
'(anzu-replace-threshold 1000)
'(anzu-deactivate-region t)
'(anzu-input-idle-delay 0.1)
'(anzu-replace-to-string-separator " => "))
(global-anzu-mode +1)
(set-face-attribute 'anzu-mode-line nil
:foreground "yellow" :weight 'bold)
(sml-modeline-mode t) (define-key isearch-mode-map [remap isearch-query-replace] #'anzu-isearch-query-replace)
(define-key isearch-mode-map [remap isearch-query-replace-regexp] #'anzu-isearch-query-replace-regexp)
(custom-set-variables ;;----------------------------------------------------------------------------
'(anzu-search-threshold 1000) ;; Keyboard shortcuts in Anzu Mode
'(anzu-replace-threshold 1000) ;;----------------------------------------------------------------------------
'(anzu-deactivate-region t) (global-set-key (kbd "M-%") 'anzu-query-replace)
'(anzu-input-idle-delay 0.1) (global-set-key (kbd "s-<SPC>") 'anzu-query-replace))
'(anzu-replace-to-string-separator " => "))
(global-anzu-mode +1)
(set-face-attribute 'anzu-mode-line nil
:foreground "yellow" :weight 'bold)
(define-key isearch-mode-map [remap isearch-query-replace] #'anzu-isearch-query-replace)
(define-key isearch-mode-map [remap isearch-query-replace-regexp] #'anzu-isearch-query-replace-regexp)
;;----------------------------------------------------------------------------
;; Keyboard shortcuts in Anzu Mode
;;----------------------------------------------------------------------------
(global-set-key (kbd "M-%") 'anzu-query-replace)
(global-set-key (kbd "s-<SPC>") 'anzu-query-replace)
(myemacs/elapsed-time) (myemacs/elapsed-time)
(provide 'init-modeline) (provide 'init-modeline)

View File

@ -1,17 +1,16 @@
;;----------------------------------- ;;-----------------------------------
;; Neotree - NerdTree for Vim ;; Neotree - NerdTree for Vim
;;----------------------------------- ;;-----------------------------------
(use-package neotree) (use-package neotree
(global-set-key [f8] 'neotree-toggle) :config
(global-set-key [f8] 'neotree-toggle)
;;----------------------- ;;-----------------------
;; neo-smart-open ;; neo-smart-open
;;----------------------- ;;-----------------------
;;(setq neo-smart-open t) ;;(setq neo-smart-open t)
;;---------------------------------------------------------
;;--------------------------------------------------------- ;; Custom icons - Require of all-the-icons
;; Custom icons - Require of all-the-icons ;;---------------------------------------------------------
;;--------------------------------------------------------- (setq neo-theme (if (display-graphic-p) 'icons 'arrow)))
(setq neo-theme (if (display-graphic-p) 'icons 'arrow))
(provide 'init-neotree) (provide 'init-neotree)

View File

@ -1,8 +1,7 @@
;;--------------------------- ;;---------------------------
;; Nginx Mode ;; Nginx Mode
;;--------------------------- ;;---------------------------
(use-package nginx-mode) (use-package nginx-mode
:mode ("/nginx/sites-\\(?:available\\|enabled\\)/" . nginx-mode))
(add-to-list 'auto-mode-alist '("/nginx/sites-\\(?:available\\|enabled\\)/" . nginx-mode))
(provide 'init-nginx) (provide 'init-nginx)

View File

@ -1,21 +1,19 @@
(use-package php-mode)
(use-package ac-php) (use-package ac-php)
(autoload 'php-mode "php-mode" "Major mode for editing PHP code." t) (use-package php-mode
(add-to-list 'auto-mode-alist '("\\.php$" . php-mode)) :mode (("\\.php$" . php-mode)
(add-to-list 'auto-mode-alist '("\\.inc$" . php-mode)) ("\\.inc$" . php-mode))
:config
(add-hook 'php-mode-hook
'(lambda ()
(auto-complete-mode t)
(require 'ac-php)
(setq ac-sources '(ac-source-php ))
(setq ac-sources '(ac-source-dictionary ac-source-abbrev ac-source-php ))
(add-hook 'php-mode-hook (ac-php-core-eldoc-setup ) ;; enable eldoc
'(lambda () (define-key php-mode-map (kbd "C-]") 'ac-php-find-symbol-at-point) ;goto define
(auto-complete-mode t) (define-key php-mode-map (kbd "C-t") 'ac-php-location-stack-back)))) ;go back
(require 'ac-php)
(setq ac-sources '(ac-source-php ))
(setq ac-sources '(ac-source-dictionary ac-source-abbrev ac-source-php ))
(ac-php-core-eldoc-setup ) ;; enable eldoc
(define-key php-mode-map (kbd "C-]") 'ac-php-find-symbol-at-point) ;goto define
(define-key php-mode-map (kbd "C-t") 'ac-php-location-stack-back) ;go back
))
(use-package smarty-mode) (use-package smarty-mode)

View File

@ -1,6 +1,4 @@
(use-package pkgbuild-mode) (use-package pkgbuild-mode
:mode ("/PKGBUILD$" . pkgbuild-mode))
(autoload 'pkgbuild-mode "pkgbuild-mode.el" "PKGBUILD mode." t)
(setq auto-mode-alist (append '(("/PKGBUILD$" . pkgbuild-mode)) auto-mode-alist))
(provide 'init-pkgbuild) (provide 'init-pkgbuild)

View File

@ -1,10 +1,11 @@
;; rainbow-mode ;; rainbow-mode
(use-package rainbow-mode) (use-package rainbow-mode
(add-hook 'css-mode-hook 'rainbow-mode) :init
(add-hook 'sass-mode-hook 'rainbow-mode) (add-hook 'css-mode-hook 'rainbow-mode)
(add-hook 'scss-mode-hook 'rainbow-mode) (add-hook 'sass-mode-hook 'rainbow-mode)
(add-hook 'less-mode-hook 'rainbow-mode) (add-hook 'scss-mode-hook 'rainbow-mode)
(add-hook 'web-mode-hook 'rainbow-mode) (add-hook 'less-mode-hook 'rainbow-mode)
(add-hook 'html-mode-hook 'rainbow-mode) (add-hook 'web-mode-hook 'rainbow-mode)
(add-hook 'html-mode-hook 'rainbow-mode))
(provide 'init-rainbow) (provide 'init-rainbow)

View File

@ -1,7 +1,7 @@
;;---------------------------------------------------------------------------- ;;----------------------------------------------------------------------------
;; Sass Mode ;; Sass Mode
;;---------------------------------------------------------------------------- ;;----------------------------------------------------------------------------
(use-package sass-mode) (use-package sass-mode
(add-to-list 'auto-mode-alist '("\\.sass\\'" . sass-mode)) :mode ("\\.sass\\'" . sass-mode))
(provide 'init-sass) (provide 'init-sass)

View File

@ -1,8 +1,7 @@
;;---------------------------------------------------------------------------- ;;----------------------------------------------------------------------------
;; Scss Mode ;; Scss Mode
;;---------------------------------------------------------------------------- ;;----------------------------------------------------------------------------
(use-package scss-mode) (use-package scss-mode
:mode ("\\.scss\\'" . scss-mode))
(add-to-list 'auto-mode-alist '("\\.scss\\'" . scss-mode))
(provide 'init-scss) (provide 'init-scss)

View File

@ -1,10 +1,10 @@
(use-package sublime-themes) (use-package sublime-themes
(load-theme 'spolsky t) :config
(load-theme 'spolsky t)
;; Fix linum current-line highlight. Doesn't looks good with this theme ;; Fix linum current-line highlight. Doesn't looks good with this theme
(defface my-linum-hl (defface my-linum-hl
'((t :background "gray30" :foreground "gold")) '((t :background "gray30" :foreground "gold"))
"Face for the currently active Line number" "Face for the currently active Line number"
:group 'linum) :group 'linum))
(provide 'init-theme) (provide 'init-theme)

View File

@ -1,4 +1,5 @@
;; yaml-mode ;; yaml-mode
(use-package yaml-mode) (use-package yaml-mode
(add-to-list 'auto-mode-alist '("\\.yml\\'" . yaml-mode)) :mode ("\\.yml\\'" . yaml-mode))
(provide 'init-yaml) (provide 'init-yaml)