]> git.lizzy.rs Git - micro.git/blob - runtime/help/commands.md
Merge pull request #847 from sotpapathe/octave_support
[micro.git] / runtime / help / commands.md
1 # Possible commands
2
3 You can execute an editor command by pressing `Ctrl-e` followed by the command.
4 Here are the possible commands that you can use.
5
6 * `quit`: Quits micro.
7
8 * `save filename?`: Saves the current buffer. If the filename is provided it
9   will 'save as' the filename.
10
11 * `replace "search" "value" flags`: This will replace `search` with `value`. 
12    The `flags` are optional. At this point, there is only one flag: `-a`, which
13    replaces all occurrences at once.
14
15    Note that `search` must be a valid regex.  If one of the arguments does not
16    have any spaces in it, you may omit the quotes.
17
18 * `replaceall "search" "value"`: This will replace `search` with `value` without
19    user confirmation.
20
21         See `replace` command for more information.
22
23 * `set option value`: sets the option to value. See the `options` help topic for
24    a list of options you can set.
25
26 * `setlocal option value`: sets the option to value locally (only in the current
27    buffer).
28
29 * `show option`: shows the current value of the given option.
30
31 * `eval "expression"`: Evaluates a Lua expression. Note that micro will not
32    print anything so you should use `messenger:Message(...)` to display a value.
33
34 * `run sh-command`: runs the given shell command in the background. The 
35    command's output will be displayed in one line when it finishes running.
36
37 * `bind key action`: creates a keybinding from key to action. See the sections
38    on keybindings above for more info about what keys and actions are available.
39
40 * `vsplit filename`: opens a vertical split with `filename`. If no filename is
41    provided, a vertical split is opened with an empty buffer.
42
43 * `hsplit filename`: same as `vsplit` but opens a horizontal split instead of a
44    vertical split.
45
46 * `tab filename`: opens the given file in a new tab.
47
48 * `tabswitch tab`: This command will switch to the specified tab. The `tab` can
49    either be a tab number, or a name of a tab.
50                                          
51 * `log`: opens a log of all messages and debug statements.
52
53 * `plugin install plugin_name`: installs the given plugin.
54
55 * `plugin remove plugin_name`: removes the given plugin.
56
57 * `plugin list`: lists all installed plugins.
58
59 * `plugin update`: updates all installed plugins.
60
61 * `plugin search plugin_name`: searches for the given plugin. Note that you can
62    find a list of all available plugins at
63    github.com/micro-editor/plugin-channel.
64
65    You can also see more information about the plugin manager in the
66    `Plugin Manager` section of the `plugins` help topic.
67
68 * `plugin available`: list plugins available for download (this includes any
69    plugins that may be already installed).
70
71 * `reload`: reloads all runtime files.
72
73 * `cd path`: Change the working directory to the given `path`.
74
75 * `pwd`: Print the current working directory.
76
77 * `open filename`: Open a file in the current buffer.
78
79 ---
80
81 The following commands are provided by the default plugins:
82
83 * `lint`: Lint the current file for errors.