Skip to content

emacs-php/magic-filetype.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

magic-filetype

MELPA magic-filetype MELPA stable: magic-filetype Join the chat at https://gitter.im/zonuexe/magic-filetype.el

Enhance filetype major mode

Installation

Cask

See Cask Installation. put into your own Cask file.

MELPA

See Getting Started - MELPA. M-x package-install and type magic-filetype.

El-get

See El-Get #Installation. put into your own init.el file.

(el-get-bundle magic-filetype)

Features

Support Vim-style file type header

put into your own .emacs file (init.el)

(magic-filetype-enable-vim-filetype)

Major mode settings

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)))

Use major mode from language name

M-x magic-filetype-major-mode-from-language-name

Reload major mode

M-x magic-filetype-reload-major-mode

Utility function

Collect major-modes

(require 'magic-filetype')
(completing-read "Input major mode: " (magic-filetype-collect-major-modes))