To read MarkDown in CLI use glow <file.md>
comment detectindent filemanager jump manipulator micro-autofmt micro-run glow misspell quoter
ctrl + e comment
set commenttype "/* %s */"settings.json Alt-/ (comments selected lines)
set detectindent on
| Option | Purpose | Default |
|---|---|---|
filemanager-showdotfiles |
Show dotfiles (hidden if false) | true |
filemanager-showignored |
Show gitignore'd files (hidden if false) | true |
filemanager-compressparent |
Collapse the parent dir when left is pressed on a child file | true |
filemanager-foldersfirst |
Sorts folders above any files | true |
filemanager-openonstart |
Automatically open the file tree when starting Micro | false |
-
Ctrl-wkeybinding is to switch which buffer your
| Command | Keybinding(s) | What it does | API for bindings.json |
|---|---|---|---|
tree |
- | Open/close the tree | filemanager.toggle_tree |
| - | Tab & MouseLeft | Open a file, or go into the directory. Goes back a dir if on .. |
filemanager.try_open_at_cursor |
| - | → | Expand directory in tree listing | filemanager.uncompress_at_cursor |
| - | ← | Collapse directory listing | filemanager.compress_at_cursor |
| - | Shift ⬆ | Go to the target's parent directory | filemanager.goto_parent_dir |
| - | Alt Shift { | Jump to the previous directory in the view | filemanager.goto_next_dir |
| - | Alt Shift } | Jump to the next directory in the view | filemanager.goto_prev_dir |
rm |
- | Prompt to delete the target file/directory your cursor is on | filemanager.prompt_delete_at_cursor |
rename |
- | Rename the file/directory your cursor is on, using the passed name | filemanager.rename_at_cursor |
touch |
- | Make a new file under/into the file/directory your cursor is on, using the passed name | filemanager.new_file |
mkdir |
- | Make a new directory under/into the file/directory your cursor is on, using the passed name | filemanager.new_dir |
Use F4 to jump between functions and classes
Press F5 to save and run the current file, F12 to make, F9 to make in background F12 compiles your project even if Makefile is in a higher directory. F9 runs 'make' in background, allowing you to keep editing while your project compiles.
This is an simple plugin to extend text manipulation in Micro If you have a selection, the plugin will change all of the selection.
The following commands currently exists. Insert them with Ctrl-e:
upper: UPPERCASElower: lowercasereverse: Reversesbase64enc: Base64 encodesbase64dec: Base64 decodesrot13: ROT-13incNum: Increase number by onedecNum: Decrease number by onecapital: Capitalize First Letterbrace: Adds brackets around selectioncurly: Curly brackets ({ })square: Square brackets ([ ])angle: Angle brackets (< >)dquote: Double quotes (" ")squote: Single quotes (' ')
- Run
fmtto format the current file. - Files will be formatted on save, unless
fmt-onsaveis set to false (withCtrl-e > set fmt-onsave false).
No idea
Press [ or { or ' or " while having text selected
| Up | CursorUp |
|---|---|
| Down | CursorDown |
| Right | CursorRight |
| Left | CursorLeft |
| ShiftUp | SelectUp |
| ShiftDown | SelectDown |
| ShiftLeft | SelectLeft |
| ShiftRight | SelectRight |
| AltLeft | WordLeft |
| AltRight | WordRight |
| AltUp | MoveLinesUp |
| AltDown | MoveLinesDown |
| CtrlShiftRight | SelectWordRight |
| CtrlShiftLeft | SelectWordLeft |
| AltLeft | StartOfTextToggle |
| AltRight | EndOfLine |
| AltShiftRight | SelectWordRight |
| AltShiftLeft | SelectWordLeft |
| CtrlLeft | StartOfText |
| CtrlRight | EndOfLine |
| AltShiftLeft | SelectToStartOfTextToggle |
| CtrlShiftLeft | SelectToStartOfTextToggle |
| ShiftHome | SelectToStartOfTextToggle |
| AltShiftRight | SelectToEndOfLine |
| CtrlShiftRight | SelectToEndOfLine |
| ShiftEnd | SelectToEndOfLine |
| CtrlUp | CursorStart |
| CtrlDown | CursorEnd |
| CtrlShiftUp | SelectToStart |
| CtrlShiftDown | SelectToEnd |
| Alt-{ | ParagraphPrevious |
| Alt-} | ParagraphNext |
| Enter | InsertNewline |
| Ctrl-h | Backspace |
| Backspace | Backspace |
| Alt-CtrlH | DeleteWordLeft |
| Alt-Backspace | DeleteWordLeft |
| Tab | Autocomplete|IndentSelection|InsertTab |
| Backtab | OutdentSelection|OutdentLine |
| Ctrl-o | OpenFile |
| Ctrl-s | Save |
| Ctrl-f | Find |
| Alt-F | FindLiteral |
| Ctrl-n | FindNext |
| Ctrl-p | FindPrevious |
| Ctrl-z | Undo |
| Ctrl-y | Redo |
| Ctrl-c | CopyLine|Copy |
| Ctrl-x | Cut |
| Ctrl-k | CutLine |
| Ctrl-d | DuplicateLine |
| Ctrl-v | Paste |
| Ctrl-a | SelectAll |
| Ctrl-t | AddTab |
| Alt-, | PreviousTab |
| Alt-. | NextTab |
| Home | StartOfText |
| End | EndOfLine |
| CtrlHome | CursorStart |
| CtrlEnd | CursorEnd |
| PageUp | CursorPageUp |
| PageDown | CursorPageDown |
| CtrlPageUp | PreviousTab |
| CtrlPageDown | NextTab |
| Ctrl-g | ToggleHelp |
| Alt-g | ToggleKeyMenu |
| Ctrl-r | ToggleRuler |
| Ctrl-l | command-edit goto |
| Delete | Delete |
| Ctrl-b | ShellMode |
| Ctrl-q | Quit |
| Ctrl-e | CommandMode |
| Ctrl-w | NextSplit |
| Ctrl-u | ToggleMacro |
| Ctrl-j | PlayMacro |
| Insert | ToggleOverwriteMode |
| // Emacs-style keybindings | |
| Alt-f | WordRight |
| Alt-b | WordLeft |
| Alt-a | StartOfLine |
| Alt-e | EndOfLine |
| // Integration with file managers | |
| F2 | Save |
| F3 | Find |
| F4 | Quit |
| F7 | Find |
| F10 | Quit |
| Esc | Escape |
| // Mouse bindings | |
| MouseWheelUp | ScrollUp |
| MouseWheelDown | ScrollDown |
| MouseLeft | MousePress |
| MouseMiddle | PastePrimary |
| Ctrl-MouseLeft | MouseMultiCursor |
| Alt-n | SpawnMultiCursor |
| AltShiftUp | SpawnMultiCursorUp |
| AltShiftDown | SpawnMultiCursorDown |
| Alt-m | SpawnMultiCursorSelect |
| Alt-p | RemoveMultiCursor |
| Alt-c | RemoveAllMultiCursors |
| Alt-x | SkipMultiCursor |
Micro provides the following commands that can be executed at the command-bar
by pressing Ctrl-e and entering the command. Arguments are placed in single
quotes here but these are not necessary when entering the command in micro.
-
bind 'key' 'action': creates a keybinding from key to action. See thekeybindingsdocumentation for more information about binding keys. This command will modifybindings.jsonand overwrite any bindings tokeythat already exist. -
help 'topic'?: opens the corresponding help topic. If no topic is provided opens the default help screen. Help topics are stored as.mdfiles in theruntime/helpdirectory of the source tree, which is embedded in the final binary. -
save 'filename'?: saves the current buffer. If the file is provided it will 'save as' the filename. -
quit: quits micro. -
goto 'line': jumps to the given line number. A negative number can be passed to jump inward from the end of the file; for example, -5 jumps to the 5th-last line in the file. -
replace 'search' 'value' 'flags'?: This will replacesearchwithvalue. Theflagsare optional. Possible flags are:-a: Replace all occurrences at once-l: Do a literal search instead of a regex search
Note that
searchmust be a valid regex (unless-lis passed). If one of the arguments does not have any spaces in it, you may omit the quotes. -
replaceall 'search' 'value': this will replace all occurrences ofsearchwithvaluewithout user confirmation.See
replacecommand for more information. -
set 'option' 'value': sets the option to value. See theoptionshelp topic for a list of options you can set. This will modify yoursettings.jsonwith the new value. -
setlocal 'option' 'value': sets the option to value locally (only in the current buffer). This will not modifysettings.json. -
show 'option': shows the current value of the given option. -
run 'sh-command': runs the given shell command in the background. The command's output will be displayed in one line when it finishes running. -
vsplit 'filename': opens a vertical split withfilename. If no filename is provided, a vertical split is opened with an empty buffer. -
hsplit 'filename': same asvsplitbut opens a horizontal split instead of a vertical split. -
tab 'filename': opens the given file in a new tab. -
tabmove '[-+]?n': Moves the active tab to another slot.nis an integer. Ifnis prefixed with-or+, then it represents a relative position (e.g.tabmove +2moves the tab to the right by2). Ifnhas no prefix, it represents an absolute position (e.g.tabmove 2moves the tab to slot2). -
tabswitch 'tab': This command will switch to the specified tab. Thetabcan either be a tab number, or a name of a tab. -
textfilter 'sh-command': filters the current selection through a shell command as standard input and replaces the selection with the stdout of the shell command. For example, to sort a list of numbers, first select them, and then execute> textfilter sort -n. -
log: opens a log of all messages and debug statements. -
plugin list: lists all installed plugins. -
plugin install 'pl': install a plugin. -
plugin remove 'pl': remove a plugin. -
plugin update 'pl': update a plugin (if no arguments are provided updates all plugins). -
plugin search 'pl': search available plugins for a keyword. -
plugin available: show available plugins that can be installed. -
reload: reloads all runtime files. -
cd 'path': Change the working directory to the givenpath. -
pwd: Print the current working directory. -
open 'filename': Open a file in the current buffer. -
reset 'option': resets the given option to its default value -
retab: Replaces all leading tabs with spaces or leading spaces with tabs depending on the value oftabstospaces. -
raw: micro will open a new tab and show the escape sequence for every event it receives from the terminal. This shows you what micro actually sees from the terminal and helps you see which bindings aren't possible and why. This is most useful for debugging keybindings. -
showkey: Show the action(s) bound to a given key. For example running> showkey Ctrl-cwill displayCopy. -
term exec?: Open a terminal emulator running the given executable. If no executable is given, this will open the default shell in the terminal emulator.
Created by Jinsku Kripta from Kripta-Studios.