aboutsummaryrefslogtreecommitdiff
path: root/doc/08_Preferences.md
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2012-10-17 13:07:18 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2012-10-17 13:07:18 -0400
commit39ee8c120e62331c2d31846a18086efd059f5709 (patch)
tree64a2d66f93f43281eacd65b21cb0868e99542852 /doc/08_Preferences.md
parent28b1bccb2ed38faacfcc77674081db207c32cf89 (diff)
downloadtextadept-39ee8c120e62331c2d31846a18086efd059f5709.tar.gz
textadept-39ee8c120e62331c2d31846a18086efd059f5709.zip
Updated manual.
Diffstat (limited to 'doc/08_Preferences.md')
-rw-r--r--doc/08_Preferences.md25
1 files changed, 21 insertions, 4 deletions
diff --git a/doc/08_Preferences.md b/doc/08_Preferences.md
index f0cdd2f0..7fb21c22 100644
--- a/doc/08_Preferences.md
+++ b/doc/08_Preferences.md
@@ -62,8 +62,11 @@ your `menu.lua` instead of its own.
### Language-Specific
-Similar to generic modules, copying the default Lua language-specific module
-(`modules/lua`) to `~/.textadept/modules/` causes Textadept to load that module
+Similar to generic modules, putting your own language-specific module in
+`~/.textadept/modules/` causes Textadept to load that module for editing the
+language's code instead of the default one in `modules/` (if the latter exists).
+For example, copying the default Lua language-specific module from
+`modules/lua/` to `~/.textadept/modules/` causes Textadept to use that module
for editing Lua code instead of the default one. If you make custom changes to
these kinds of copies of language-specific modules, you will likely want to
update them with each new Textadept release. Instead of potentially wasting time
@@ -100,6 +103,10 @@ contain the following:
_M.textadept = require 'textadept'
_M.foo = require 'foo'
+Language-specific modules are loaded automatically by Textadept when a source
+file of that language is opened. No additional action is required after
+installing the module.
+
### Key Bindings
For simple changes to key bindings, `~/.textadept/init.lua` is a good place to
@@ -111,7 +118,8 @@ instead of `Ctrl+N`:
If you plan on redefining most key bindings, you would probably want to copy or
create a new `keys.lua` and then put it in `~/.textadept/modules/textadept/`.
-You can learn more about key bindings in the [key bindings LuaDoc][].
+You can learn more about key bindings and how to define them in the
+[key bindings LuaDoc][].
[key bindings LuaDoc]: api/keys.html
@@ -160,18 +168,27 @@ can override or add to them in your `~/.textadept/mime_types.conf`:
### Detect by Extension
+The syntax for mapping a file extension to a lexer is:
+
file_ext lexer
Note: `file_ext` should not start with a `.` (period).
### Detect by Shebang
+The syntax for mapping a word contained in a shebang line (the first line of a
+file whose first two characters are `#!`) to a lexer is:
+
#shebang_word lexer
-Examples of `shebang_word`s are `lua`, `ruby`, `python`.
+Examples of `shebang_word`s are `lua`, `ruby`, `python` which match lines like
+`#!/usr/bin/lua`, `#!/usr/env/ruby`, and `#!/usr/bin/python3`, respectively.
### Detect by Pattern
+The syntax for mapping a Lua pattern that matches the first line of a file to a
+lexer is:
+
/pattern lexer
[Lua pattern syntax][] is used. Only the last space, the one separating the