Atom Packages Directory

a package directory for a text editor of the 21st Century

Vim Modeline

Install with:
    apm install vim-modeline
  

vim-modeline package

Enable Vim-style modeline in Atom.

Supported options

Example

Valid Vim-style modeline

coffeescript # vim:set expandtab tabstop=2 fenc=utf-8 ff=unix ft=coffee:

Atom-specific modeline

coffeescript # atom:set useSoftTabs tabLength=2 encoding=utf-8 lineEnding=lf grammar=coffee:

Atom-specific modeline

Configuring filetype

You can add more filetype for a given language scope. To do this, add the settings to the ~/.atom/config.cson in the format below.

coffeescript 'vim-modeline-filetypes': # append scopeName 'as': [ 'source.actionscript.3' ] # override scopeName 'markdown': 'text.md'

vim-modeline Event Handler

This package can use the event handler using “Service API”.

eg: get parse result in init.coffee.

coffeescript atom.packages.serviceHub.consume "vim-modeline-event-handler", "^1.0.0", (handler) -> handler.onDidParse ({editor, options}) -> console.log editor console.log options someFunction(options)

Conflict issue

If you use auto-encoding package, file encoding doesn’t match the modeline. If you want use vim-modeline parse result, please invoke ‘vim-modeline:detect’ command after open TextEditor.

TODO

Keywords: vim, format, code, style, code-style Suggest keywords
Fork me on GitHub