Commit Graph

15 Commits

Author SHA1 Message Date
chrisarcand d87fad649c Improved vim modeline detection
TLDR: This greatly increases the flexibility of vim modeline detection
to manually set the language of a file.

In vim there are two forms of modelines:

[text]{white}{vi:|vim:|ex:}[white]{options}
examples: 'vim: syntax=perl', 'ex: filetype=ruby'

-and-

[text]{white}{vi:|vim:|Vim:|ex:}[white]se[t] {options}:[text]
examples: 'vim set syntax=perl:', 'Vim: se ft=ruby:'

As you can see, there are many combinations. These changes should allow
most combinations to be used. The two most important additions are the
use of the keyword 'syntax', as well as the addition of the first form
(you now no longer need to use the keyword 'set' with a colon at the end).
The use of first form with 'syntax' is very, very common across GitHub:

https://github.com/search?l=ruby&q=vim%3A+syntax%3D&ref=searchresults&type=Code&utf8=%E2%9C%93
2016-01-16 08:57:20 -05:00
Ammar Askar 4650368bc2 Make regex for vim modeline more lenient
This change allows the filetype/language to be retrieved from more complex vim modelines. The current regex strictly allows a set line which contains only the filetype/ft parameter and nothing else
2015-08-10 00:42:14 -05:00
michael tesch a5b0b333b0 Merge branch 'master' into tesch1-emacs-patch-1 2015-03-24 09:44:08 +01:00
なつき 67e4212f64 Test detecting generated source maps 2015-03-19 19:50:40 -07:00
michael tesch fda0f2a042 detect emacs modeline for fundamental as Text 2015-03-14 23:53:17 +01:00
michael tesch 6af4ab6db1 harder test 2015-03-14 23:26:08 +01:00
michael tesch a364e4a2dc tests for emacs modeline regex 2015-03-14 23:13:59 +01:00
Michael Tesch 1bb639617c Create seeplusplusEmacs1
one type of emacs modeline
2015-03-14 22:44:02 +01:00
Arfon Smith 0db1d1c8ca Modifying some modeline fixtures to test case InSeNsItivitY 2015-02-06 08:48:59 -06:00
Lars Brinkhoff 2077fa3837 'Text' doesn't qualify as a valid modeline language. 2015-02-04 08:20:19 +01:00
Arfon Smith 119a8fff1e Emacs modeline fixtures 2015-01-26 15:38:19 -06:00
Arfon Smith 429c791377 Testing Vim modeline support 2015-01-26 14:39:07 -06:00
Paul Chaignon f93272f0bd Move text files from fixtures to samples when possible 2014-12-10 20:09:14 -05:00
Paul Chaignon 93186947c2 Move binaries and text files from samples folder to fixtures 2014-12-04 23:48:05 -05:00
Paul Chaignon 77444284e3 Data folder in fixtures for files with no language 2014-12-04 19:14:44 -05:00