diff options
author | 2013-05-20 12:41:29 -0400 | |
---|---|---|
committer | 2013-05-20 12:41:29 -0400 | |
commit | cd53300ce7b4b6ce90dcf95525fd7cc14efc3685 (patch) | |
tree | 907466d522cc6939b42b6d043e991c27e09a1cea /doc/10_Advanced.md | |
parent | d042865f672d6708df80250c9c59172148a55f11 (diff) | |
download | textadept-cd53300ce7b4b6ce90dcf95525fd7cc14efc3685.tar.gz textadept-cd53300ce7b4b6ce90dcf95525fd7cc14efc3685.zip |
Rewrote the manual to use the active voice.
Diffstat (limited to 'doc/10_Advanced.md')
-rw-r--r-- | doc/10_Advanced.md | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/doc/10_Advanced.md b/doc/10_Advanced.md index bc3a0ab7..9d921164 100644 --- a/doc/10_Advanced.md +++ b/doc/10_Advanced.md @@ -2,16 +2,16 @@ ## Command Entry -Access to the Lua state is available through the command entry. Press `Ctrl+E` -(`⌘E` on Mac OSX | `M-C` in curses) to access it. It is useful for debugging, +The command entry grants access to Textadept's Lua state. Press `Ctrl+E` (`⌘E` +on Mac OSX | `M-C` in curses) to display the entry. It is useful for debugging, inspecting, and entering `buffer` or `view` commands. If you try to cause -instability in Textadept's Lua state, you might very well succeed so be careful. -For available commands, see the [Lua API][]. Abbreviated commands for -[`buffer`][], [`view`][] and [`gui`][] are available: the command -`buffer:append_text('foo')` can be shortened to `append_text('foo')`. Therefore, -use `_G.print()` for Lua's `print()` since [`gui.print()`][] is shortened to -`print()`. You can also run commands on startup using the `-e` and `--execute` -command line switches. +instability in Textadept's Lua state, you will probably succeed so be careful. +The [Lua API][] lists available commands. The command entry provides abbreviated +commands for [`buffer`][], [`view`][] and [`gui`][]: you may reduce the +`buffer:append_text('foo')` command to `append_text('foo')`. Therefore, use +`_G.print()` for Lua's `print()` since `print()` expands to [`gui.print()`][]. +These commands are runnable on startup using the `-e` and `--execute` command +line switches.  @@ -23,18 +23,18 @@ command line switches. ### Tab Completion -Tab-completion for functions, variables, tables, etc. is available. Press the -`Tab` (`⇥` on Mac OSX | `Tab` in curses) key to display a list of available -completions. Use the arrow keys to make a selection and press `Enter` (`↩` | -`Enter`) to insert it. +The command entry also provides tab-completion for functions, variables, tables, +etc. Press the `Tab` (`⇥` on Mac OSX | `Tab` in curses) key to display a list of +available completions. Use the arrow keys to make a selection and press `Enter` +(`↩` | `Enter`) to insert it.  ### Extending -You can extend the command entry to do more than enter Lua commands. An -example of this is [incremental search][]. See *modules/textadept/find.lua* and -*modules/textadept/keys.lua* for the implementation. +Executing Lua commands is just one of the many tools the command entry functions +as. For example, *modules/textadept/find.lua* and *modules/textadept/keys.lua* +extend it to implement [incremental search][]. [incremental search]: api/gui.find.html#find_incremental @@ -46,25 +46,26 @@ selection dialog. Typing part of any command filters the list, with spaces being wildcards. This is an easy way to run commands without navigating the menus, using the mouse, or remembering key bindings. It is also useful for looking up particular key bindings quickly. Note: the key bindings in the dialog do not -look like those in the menu. This different notation is how bindings are -represented internally. You can learn more about this in the [keys LuaDoc]. +look like those in the menu. Textadept uses this different notation internally. +Learn more about it in the [keys LuaDoc][]. [preferences]: 08_Preferences.html#User.Init [keys LuaDoc]: api/keys.html ## Shell Commands and Filtering Text -Sometimes it is easier to use an existing shell command to manipulate text -instead of using the command entry. An example would be sorting all text in a -buffer (or a selection). You could do the following from the command entry: +Sometimes using an existing shell command to manipulate text is easier than +using the command entry. An example would be sorting all text in a buffer (or a +selection). One way to do this from the command entry is: ls={}; for l in buffer:get_text():gmatch('[^\n]+') do ls[#ls+1]=l end; table.sort(ls); buffer:set_text(table.concat(ls, '\n')) -A simpler way would be to press `Ctrl+|` (`⌘|` on Mac OSX | `^\` in curses), -enter the shell command `sort`, and hit `Enter` (`↩` | `Enter`). +A simpler way is pressing `Ctrl+|` (`⌘|` on Mac OSX | `^\` in curses), entering +the shell command `sort`, and pressing `Enter` (`↩` | `Enter`). -The standard input (stdin) for shell commands is determined as follows: +This feature determines the standard input (stdin) for shell commands as +follows: * If text is selected and spans multiple lines, all text on the lines containing the selection is used. However, if the end of the selection is at the @@ -73,14 +74,14 @@ The standard input (stdin) for shell commands is determined as follows: * If text is selected and spans a single line, only the selected text is used. * If no text is selected, the entire buffer is used. -The input text is replaced with the standard output (stdout) of the command. +The standard output (stdout) of the command replaces the input text. ## Remote Control -Since Textadept can execute arbitrary Lua code passed via the `-e` and -`--execute` command line switches, a side-effect of [single instance][] -functionality on the platforms that support it is that you can remotely control -the original instance. For example: +Since Textadept executes arbitrary Lua code passed via the `-e` and `--execute` +command line switches, a side-effect of [single instance][] functionality on the +platforms that support it is that you can remotely control the original +instance. For example: ta ~/.textadept/init.lua & ta -e "events.emit(events.FIND, 'require')" |