Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emacs-php/magic-filetype.el
Enhance filetype major mode
https://github.com/emacs-php/magic-filetype.el
Last synced: about 1 month ago
JSON representation
Enhance filetype major mode
- Host: GitHub
- URL: https://github.com/emacs-php/magic-filetype.el
- Owner: emacs-php
- Created: 2015-08-15T12:58:03.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-03-27T07:15:00.000Z (9 months ago)
- Last Synced: 2024-08-05T06:05:28.615Z (5 months ago)
- Language: Emacs Lisp
- Homepage: https://www.emacswiki.org/emacs/ZonuExe
- Size: 38.1 KB
- Stars: 6
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
* magic-filetype
#+BEGIN_HTML
#+END_HTMLEnhance filetype major mode
** Installation
*** Cask
See [[http://cask.readthedocs.org/en/latest/guide/installation.html][Cask Installation]]. put into your own =Cask= file.
*** MELPA
See [[http://melpa.org/#/getting-started][Getting Started - MELPA]]. =M-x package-install= and type =magic-filetype=.
*** El-get
See [[https://github.com/dimitri/el-get#installation][El-Get #Installation]]. put into your own =init.el= file.
#+BEGIN_SRC emacs-lisp
(el-get-bundle magic-filetype)
#+END_SRC** Features
*** Support Vim-style file type header
put into your own =.emacs= file (=init.el=)
#+BEGIN_SRC emacs-lisp
(magic-filetype-enable-vim-filetype)
#+END_SRC*** Major mode settings
for example...
#+BEGIN_SRC emacs-lisp
(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)))
#+END_SRCIf you write the setting to =.emacs=, you can be briefly defined as follows.
#+BEGIN_SRC emacs-lisp
(defalias 'major-mode-of 'magic-filetype-major-mode-of)(add-to-list 'auto-mode-alist `("/\\.mysql\\'" . ,(major-mode-of 'mysql)))
#+END_SRC*** 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
#+BEGIN_SRC emacs-lisp
(require 'magic-filetype')
(completing-read "Input major mode: " (magic-filetype-collect-major-modes))
#+END_SRC