Module textadept.mime_types
Handles file-specific settings (based on file extension).
Functions
| handle_new () |
[Local function] Performs actions suitable for a new buffer. |
| handle_switch () |
[Local function] Performs actions suitable for when buffers are switched. |
| load_language_module_from_filename (filename) |
[Local function] Loads a language module based on a filename (if it hasn't been loaded already). |
| set_lexer_from_filename (filename) |
[Local function] Sets the buffer's lexer language based on a filename. |
| set_lexer_from_pattern () |
[Local function] Sets the buffer's lexer language based on a pattern that matches its first line. |
| set_lexer_from_sh_bang () |
[Local function] Sets the buffer's lexer language based on a shebang line. |
Tables
| extensions |
[Local table] File extensions with their associated languages. |
| languages |
[Local table] Language names with their associated lexers. |
| patterns |
[Local table] First-line patterns and their associated languages. |
| shebangs |
[Local table] Shebang words and their associated languages. |
Functions
- handle_new ()
-
[Local function] Performs actions suitable for a new buffer. Sets the buffer's lexer language and loads the language module.
- handle_switch ()
-
[Local function] Performs actions suitable for when buffers are switched. Sets the buffer's lexer language.
- load_language_module_from_filename (filename)
-
[Local function] Loads a language module based on a filename (if it hasn't been loaded already).
Parameters
-
filename: The filename used to load a language module from.
- set_lexer_from_filename (filename)
-
[Local function] Sets the buffer's lexer language based on a filename.
Parameters
-
filename: The filename used to set the lexer language.
Return value:
boolean indicating whether or not a lexer language was set.
- set_lexer_from_pattern ()
-
[Local function] Sets the buffer's lexer language based on a pattern that matches its first line.
- set_lexer_from_sh_bang ()
-
[Local function] Sets the buffer's lexer language based on a shebang line.
Tables
- extensions
- [Local table] File extensions with their associated languages.
- languages
- [Local table] Language names with their associated lexers.
- patterns
- [Local table] First-line patterns and their associated languages.
- shebangs
- [Local table] Shebang words and their associated languages.