3 The command bar is opened by pressing Ctrl-e. It is a single-line buffer,
4 meaning that all keybindings from a normal buffer are supported (as well
5 as mouse and selection).
7 When running a command, you can use extra syntax that micro will expand before
8 running the command. To use an argument with a space in it, put it in
9 quotes. The command bar parser uses the same rules for parsing arguments that
10 `/bin/sh` would use (single quotes, double quotes, escaping). The command bar
11 does not look up environment variables.
15 Micro provides the following commands that can be executed at the command-bar by
16 pressing `Ctrl-e` and entering the command. Arguments are placed in single
17 quotes here but these are not necessary when entering the command in micro.
19 * `bind 'key' 'action'`: creates a keybinding from key to action. See the
20 `keybindings` documentation for more information about binding keys.
21 This command will modify `bindings.json` and overwrite any bindings to
22 `key` that already exist.
24 * `help 'topic'?`: opens the corresponding help topic. If no topic is provided
25 opens the default help screen.
27 * `save 'filename'?`: saves the current buffer. If the file is provided it
28 will 'save as' the filename.
30 * `quit`: quits micro.
32 * `replace 'search' 'value' 'flags'?`: This will replace `search` with `value`.
33 The `flags` are optional. Possible flags are:
34 * `-a`: Replace all occurrences at once
35 * `-l`: Do a literal search instead of a regex search
37 Note that `search` must be a valid regex (unless `-l` is passed). If one
38 of the arguments does not have any spaces in it, you may omit the quotes.
40 * `replaceall 'search' 'value'`: this will replace all occurrences of `search`
41 with `value` without user confirmation.
43 See `replace` command for more information.
45 * `set 'option' 'value'`: sets the option to value. See the `options` help topic for
46 a list of options you can set. This will modify your `settings.json` with the
49 * `setlocal 'option' 'value'`: sets the option to value locally (only in the current
50 buffer). This will *not* modify `settings.json`.
52 * `show 'option'`: shows the current value of the given option.
54 * `run 'sh-command'`: runs the given shell command in the background. The
55 command's output will be displayed in one line when it finishes running.
57 * `vsplit 'filename'`: opens a vertical split with `filename`. If no filename is
58 provided, a vertical split is opened with an empty buffer.
60 * `hsplit 'filename'`: same as `vsplit` but opens a horizontal split instead of a
63 * `tab 'filename'`: opens the given file in a new tab.
65 * `tabswitch 'tab'`: This command will switch to the specified tab. The `tab` can
66 either be a tab number, or a name of a tab.
68 * `textfilter 'sh-command'`: filters the current selection through a shell command
69 as standard input and replaces the selection with the stdout of the shell command.
70 For example, to sort a list of numbers, first select them, and then execute
71 `> textfilter sort -n`.
73 * `log`: opens a log of all messages and debug statements.
75 * `plugin 'list'`: lists all installed plugins.
77 * `plugin version 'pl'`: shows version for specified plugin.
79 * `plugin info 'pl'`: shows additional info for specified plugin.
81 * `reload`: reloads all runtime files.
83 * `cd 'path'`: Change the working directory to the given `path`.
85 * `pwd`: Print the current working directory.
87 * `open 'filename'`: Open a file in the current buffer.
89 * `reset 'option'`: resets the given option to its default value
91 * `retab`: Replaces all leading tabs with spaces or leading spaces with tabs
92 depending on the value of `tabstospaces`.
94 * `raw`: micro will open a new tab and show the escape sequence for every event
95 it receives from the terminal. This shows you what micro actually sees from
96 the terminal and helps you see which bindings aren't possible and why. This
97 is most useful for debugging keybindings.
99 * `showkey`: Show the action(s) bound to a given key. For example
100 running `> showkey CtrlC` will display `Copy`.
104 The following commands are provided by the default plugins:
106 * `lint`: Lint the current file for errors.
108 * `comment`: automatically comment or uncomment current selection or line.