Table of Contents
Django setup
ref: emacs django config
- install virtualenvwrapper
install virtualenvwrapper - install python-django.el
install it via elpa bind key to open project
in the .emacs config(require-package 'python-django) (require 'python-django) (global-set-key (kbd "C-x j") 'python-django-open-project)
set emacs config environment virables for django project
goto project rootcd /path/to/django/project touch .dir-locals.el
and input this to .dir-locals.el
((python-mode (python-shell-interpreter . "python") (python-shell-interpreter-args . "/home/robin/Env/mezproj/project/manage.py shell") (python-shell-prompt-regexp . "In \\[[0-9]+\\]: ") (python-shell-prompt-output-regexp . "Out\\[[0-9]+\\]: ") (python-shell-completion-setup-code . "from IPython.core.completerlib import module_completion") (python-shell-completion-module-string-code . "';'.join(module_completion('''%s'''))\n") (python-shell-completion-string-code . "';'.join(get_ipython().Completer.all_completions('''%s'''))\n") (python-shell-extra-pythonpaths "/home/robin/Env/mezproj/lib/python2.7/site-packages/") (python-shell-virtualenv-path . "/home/robin/Env/mezproj")))
添加web-mode
install web-mode via elpa(require 'web-mode) (add-to-list 'auto-mode-alist '("\\.html\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.[agj]sp\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode)) (setq web-mode-engines-alist '(("django" . "\\.html\\'") ("django" . "\\.djhtml\\.")) )