VimModelines
Sublime Text 3 plugin to parse and apply Vim modelines
Details
Installs
- Total 14K
- Win 7K
- Mac 4K
- Linux 3K
Jan 21 | Jan 20 | Jan 19 | Jan 18 | Jan 17 | Jan 16 | Jan 15 | Jan 14 | Jan 13 | Jan 12 | Jan 11 | Jan 10 | Jan 9 | Jan 8 | Jan 7 | Jan 6 | Jan 5 | Jan 4 | Jan 3 | Jan 2 | Jan 1 | Dec 31 | Dec 30 | Dec 29 | Dec 28 | Dec 27 | Dec 26 | Dec 25 | Dec 24 | Dec 23 | Dec 22 | Dec 21 | Dec 20 | Dec 19 | Dec 18 | Dec 17 | Dec 16 | Dec 15 | Dec 14 | Dec 13 | Dec 12 | Dec 11 | Dec 10 | Dec 9 | Dec 8 | Dec 7 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 3 | 3 | 1 | 2 | 0 | 4 | 2 | 1 | 1 | 0 | 1 | 0 | 0 | 3 | 0 | 2 | 1 | 3 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 3 | 2 | 3 | 0 | 1 | 3 | 1 | 3 | 0 | 1 | 0 | 2 |
Mac | 0 | 0 | 2 | 0 | 0 | 2 | 0 | 2 | 0 | 3 | 0 | 2 | 0 | 0 | 0 | 0 | 4 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 |
Linux | 0 | 1 | 2 | 0 | 0 | 1 | 1 | 0 | 3 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 2 | 2 | 1 | 2 | 1 | 1 | 1 | 3 | 2 | 0 | 5 | 0 | 0 | 1 | 1 | 1 | 1 | 0 |
Readme
- Source
- raw.githubusercontent.com
VimModelines for Sublime Text 3
VimModelines adds Vim modeline support into Sublime Text 3 for common settings. Modelines are Vim commands embedded into the comments in headers or footers. They are commonly used to set attributes specific to the file, like indentation or line endings to override the editor's default settings.
They are the Vi/Vim equivalent of Emacs modelines.
Their inclusion into files like Makefile
, which must be tab delimited, or in
projects with many contributors is common-ish. They are also a common mechanism
to define the source encoding
for Python 2.
This plugin, by default, will search for them on file load & save and apply them to the Sublime Text view.
The default settings file for this plugin, for example, uses tabs and has
preference for a width of 2. This will override your default settings if
apply_on_load
is set to true
.
Parsed Attributes
Attribute | Description | Mapping |
---|---|---|
autoindent, ai | Automatic indentation | auto_indent = True |
noautoindent, noai | Disable automatic indentation | auto_indent = False |
fileformat, ff | Set line endings (dos, mac, unix) | set_line_endings() |
fileencoding, fenc | Set file encoding (utf-8, …) | set_encoding() |
tabstop, ts | # of columns for each tab character | tab_size |
shiftwidth, sw | # of columns for indent operation | ignored |
softtab, st | # of columns for tab key (space & tab) | ignored |
expandtab, et | Tabs → Spaces | translate_tabs_to_spaces = True |
noexpandtab, noet | Respect tab chars | translate_tabs_to_spaces = False |
number, nu | Show line numbers | line_numbers = True |
nonumber, nonu | Hide line numbers | line_numbers = False |
wrap | Enable word wrap | word_wrap = True |
nowrap | Disable word wrap | word_wrap = False |
Supported File Encodings
VimModelines will set the encoding as specified, but will not convert it. The following are the supported Sublime Text encodings and their mappings to Vim.
Vim Encoding | Sublime Text Encoding |
---|---|
latin1 | Western (Windows 1252) |
koi8-r | Cyrillic (KOI8-R) |
koi8-u | Cyrillic (KOI8-U) |
macroman | Western (Mac Roman) |
iso-8859-1 | Western (ISO 8859-1) |
iso-8859-2 | Central European (ISO 8859-2) |
iso-8859-3 | Western (ISO 8859-3) |
iso-8859-4 | Baltic (ISO 8859-4) |
iso-8859-5 | Cyrillic (ISO 8859-5) |
iso-8859-6 | Arabic (ISO 8859-6) |
iso-8859-7 | Greek (ISO 8859-7) |
iso-8859-8 | Hebrew (ISO 8859-8) |
iso-8859-9 | Turkish (ISO 8859-9) |
iso-8859-10 | Nordic (ISO 8859-10) |
iso-8859-13 | Estonian (ISO 8859-13) |
iso-8859-14 | Celtic (ISO 8859-14) |
iso-8859-15 | Western (ISO 8859-15) |
iso-8859-16 | Romanian (ISO 8859-16) |
cp437 | DOS (CP 437) |
cp866 | Cyrillic (Windows 866) |
cp1250 | Central European (Windows 1250) |
cp1251 | Cyrillic (Windows 1251) |
cp1252 | Western (Windows 1252) |
cp1253 | Greek (Windows 1253) |
cp1254 | Turkish (Windows 1254) |
cp1255 | Hebrew (Windows 1255) |
cp1256 | Arabic (Windows 1256) |
cp1257 | Baltic (Windows 1257) |
cp1258 | Vietnamese (Windows 1258) |
utf-8 | utf-8 |
ucs-2le | utf-16 le |
utf-16 | utf-16 be |
utf-16le | utf-16 le |
Requirements
Installation Instructions
Using Package Control
- Install Package Control
- Open the Command Palette (⌘+⇧+P on macOS or ⌃+⇧+P on Linux & Windows)
- Search for and select “Package Control: Install Package”
- Search for and install “VimModelines”
Manually
cd
into your “Packages” directory:
Platform | |
---|---|
Linux | ~/.config/sublime-text-3/Packages/ |
macOS | ~/Library/Application Support/Sublime Text 3/Packages/ |
Windows | %APPDATA%\Sublime Text 3\Packages\ |
- Clone the repository:
git clone https://github.com/pestilence669/VimModelines.git