Enhance filetype major mode
See Cask Installation. put into your own Cask
file.
See Getting Started - MELPA. M-x package-install
and type magic-filetype
.
See El-Get #Installation. put into your own init.el
file.
(el-get-bundle magic-filetype)
put into your own .emacs
file (init.el
)
(magic-filetype-enable-vim-filetype)
for example…
(add-to-list 'auto-mode-alist `("/.fooconfig\\'" . ,(magic-filetype-major-mode-of 'javascript)))
(add-to-list 'auto-mode-alist `("/FooPack.lock\\'" . ,(magic-filetype-major-mode-of 'json)))
If you write the setting to .emacs
, you can be briefly defined as follows.
(defalias 'major-mode-of 'magic-filetype-major-mode-of)
(add-to-list 'auto-mode-alist `("/\\.mysql\\'" . ,(major-mode-of 'mysql)))
M-x magic-filetype-major-mode-from-language-name
M-x magic-filetype-reload-major-mode
(require 'magic-filetype')
(completing-read "Input major mode: " (magic-filetype-collect-major-modes))