aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--custom.el2
-rw-r--r--modules/init-projectile.el13
-rw-r--r--modules/init-web-mode.el26
3 files changed, 39 insertions, 2 deletions
diff --git a/custom.el b/custom.el
index 1433a42..e5b20b1 100644
--- a/custom.el
+++ b/custom.el
@@ -11,7 +11,7 @@
'(ecb-options-version "2.50")
'(package-selected-packages
(quote
- (dokuwiki-mode web-mode rainbow-mode yaml-mode sass-mode less-css-mode pkgbuild-mode py-autopep8 pip-requirements elpy company-php php-mode php-refactor-mode markdown-mode crystal-mode git-timemachine gitattributes-mode gitignore-mode gitconfig-mode git-gutter-fringe nginx-mode emmet-mode whitespace-cleanup-mode log4j-mode ivy-rich counsel flycheck company-quickhelp company apache-mode neotree shrink-path all-the-icons highlight-indent-guides anzu sml-modeline smart-mode-line-powerline-theme smart-mode-line ecb diminish undo-tree nlinum sublime-themes use-package))))
+ (git-gutter-fringe yaml-mode whitespace-cleanup-mode web-mode use-package undo-tree sublime-themes sml-modeline smart-mode-line-powerline-theme shrink-path sass-mode rainbow-mode py-autopep8 pkgbuild-mode pip-requirements php-refactor-mode nlinum nginx-mode neotree markdown-mode log4j-mode less-css-mode ivy-rich highlight-indent-guides gitignore-mode gitconfig-mode gitattributes-mode git-timemachine flycheck emmet-mode elpy ecb dokuwiki-mode diminish crystal-mode counsel company-quickhelp company-php apache-mode anzu all-the-icons))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
diff --git a/modules/init-projectile.el b/modules/init-projectile.el
new file mode 100644
index 0000000..96fa205
--- /dev/null
+++ b/modules/init-projectile.el
@@ -0,0 +1,13 @@
+;;; init-projectile.el --- .Emacs Configuration -*- lexical-binding: t -*-
+;;; Commentary:
+;;
+
+;;; Code:
+;; Projectile
+(use-package projectile
+ :ensure t
+ :init
+ (projectile-mode))
+
+(provide 'init-projectile)
+;;; init-yaml.el ends here
diff --git a/modules/init-web-mode.el b/modules/init-web-mode.el
index e5016c9..5eba924 100644
--- a/modules/init-web-mode.el
+++ b/modules/init-web-mode.el
@@ -15,7 +15,31 @@
;; web-modeの設定
(setq web-mode-enable-current-element-highlight t)
(set-face-background 'web-mode-current-element-highlight-face "#a3a3a3")
- )
+
+ ;; Django hook
+ ;; require projectile
+ (defun my-django-mode-hook ()
+ (if (projectile-project-p)
+ (when (file-exists-p (concat (projectile-project-root) "manage.py"))
+ (web-mode-set-engine "django")
+
+ ;; HTML auto functions
+ (setq web-mode-enable-auto-opening t)
+ (setq web-mode-enable-auto-closing t)
+ (setq web-mode-enable-auto-quoting t)
+ (setq web-mode-enable-auto-expanding t)
+
+ ;; Auto-pairing
+ (require 'smartparens)
+ (sp-pair "{% " " %}")
+ (sp-pair "{{ " " }}")
+ (sp-pair "{# " " #}")
+ (sp-pair "{" nil :actions :rem)
+ (sp-pair "<" ">")
+
+ (setq web-mode-enable-auto-pairing nil))))
+ ;; Add hooks
+ (add-hook 'web-mode-hook 'my-django-mode-hook))
(provide 'init-web-mode)
;;; init-web-mode.el ends here