Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Modelines.sublime-commands
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
{ "caption": "Modelines: Run Tests",
"command": "run_plugin_unittest",
"args": {"module": "Modelines.tests"} }
]
34 changes: 34 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,30 @@ one of the following syntaxes::
single-line comment character for your language. When there isn't a concept of
comment, the default comment character must be used.

Vim compatibility
-----------------

Also following modelines are supported::

# vim:ai:et:ts=4:
# sublime: set color_scheme="Packages/Color Scheme - Default/Monokai.tmTheme":
# sublime: set ignored_packages+=['Vintage']:

.. note:: Modeline values are interpreted as JSON, or string as fallback. If you
use JSON Objects in modeline (like ``[]`` or ``{}``), you can only use this as
last value in a line, for quick and easy parsing reasons.

There is full vim-modeline-compatibility implemented. Only some options are
mapped to Sublime Text options. Following options are supported so far:

- autoindent, ai
- tabstop, ts
- expandtab, et
- syntax, syn
- number, nu

(these are the ones, I used most)

How to Define Comment Characters in Sublime Text
------------------------------------------------

Expand Down Expand Up @@ -70,3 +94,13 @@ non-standard accessors as a stop-gap solution.
**x_syntax** *Packages/Foo/Foo.tmLanguage*

Sets the syntax to the specified *.tmLanguage* file.


Contributers
------------

Kay-Uwe (Kiwi) Lorenz <kiwi@franka.dyndns.org> (http://quelltexter.org)
- added VIM compatibility
- smart syntax matching
- modelines also parsed on save
- settings are erased from view, if removed from modeline
Loading