How to use
June 28, 2026 ยท View on GitHub
Table of Contents
- Exiting
- Normal Mode
- Register
- Visual Mode
- Replace Mode
- Insert Mode
- Backupmanager Mode
- References Mode
- Call Hierarchy Mode
- Filer Mode
- FileTree Mode
- Terminal Mode
- Configuration Mode
- Command Mode
- Runtime Key Mapping
Exiting
Check the command line
| Keys | Description |
|---|---|
| : w | Write file |
| : q | Quit |
| : w q | Write and quit |
| : q ! | Force quit |
| : q a | Quit all windows |
| : w q a | Write and quit all windows |
| : q a ! | Force quit all windows |
| : w ! | Force write |
| : w q ! | Force write and quit window |
| : w q a ! | Force write and quit all windows |
| : c q | Quit with non-zero exit code |
Normal mode
The Default Mode
| Keys | Description |
|---|---|
| h | Go left |
| j | Go down |
| Ctrl j | Go down |
| k | Go up |
| l | Go right |
| w | Go forwards to the start of a word |
| e | Go forwards to the end of a word |
| g e | Go backwards to the end of a word |
| b | Go backwards to the start of a word |
| r | Replace a character at the cursor |
| Page Up | Page Up |
| Page Down | Page Down |
| g g | Go to the first line |
| g _ | Go to the last non-blank character of the line |
| g ; | Go to the previous change position |
| g , | Go to the next change position |
| G | Go to the last line |
| 0 | Go to the first character of the line |
| $ | Go to the end of the line |
| ^ | Go to the first non-blank character of the line |
| { | Go to the previous blank line |
| } | Go to the next blank line |
| H | Move to the top line of the screen |
| M | Move to the center line of the screen |
| L | Move to the bottom line of the screen |
| Ctrl b | Page Up |
| Ctrl f | Page Down |
| Ctrl u | Half Page Up |
| Ctrl d | Half Page Down |
| % | Move to matching pair of paren |
| d $ OR D | Delete until the end of the line |
| C | Change until the end of the line |
| y y OR Y | Copy a line |
| y { | Yank to the previous blank line |
| y } | Yank to the next blank line |
| y l | Yank a character |
| y t Any key | Yank characters to a any character |
| p | Paste the clipboard |
| P | Paste the clipboard before the cursor |
| n | Search forwards |
| N | Search backwards |
| g n | Go to next search match and select it visually |
| g N | Go to previous search match and select it visually |
| d g n | Delete next search match |
| d g N | Delete previous search match |
| ] c | Jump to next git change hunk |
| [ c | Jump to previous git change hunk |
| ] x | Jump to next git merge conflict block |
| [ x | Jump to previous git merge conflict block |
| : | Start command mode |
| u | Undo |
| Ctrl r | Redo |
| Ctrl a | Increase number under cursor |
| Ctrl x | Decrease number under cursor |
| > | Indent |
| < | Unindent |
| = = | Auto indent |
| J | Join lines |
| d d | Delete a line |
| x | Delete current character |
| X OR d h | Delete the character before the cursor |
| ~ | Toggle case of character under cursor |
| g u | Lowercase (operator) |
| g U | Uppercase (operator) |
| S OR c c | Delete the characters in the current line and start insert mode |
| s OR c l | Delete the current character and enter insert mode |
| c i " | Delete the inside of double quotes and enter insert mode |
| c i ' | Delete the inside of single quotes and enter insert mode |
| c i w | Delete the current word and enter insert mode |
| c i W | Delete the current WORD and enter insert mode |
| c i ( OR c i ) | Delete the inside of round brackets and enter insert mode |
| c i [ OR c i ] | Delete the inside of square brackets and enter insert mode |
| c i { OR c i } | Delete the inside of curly brackets and enter insert mode |
| c a " | Delete around double quotes and enter insert mode |
| c a ' | Delete around single quotes and enter insert mode |
| c a w | Delete a word (with surrounding whitespace) and enter insert mode |
| c a W | Delete a WORD (with surrounding whitespace) and enter insert mode |
| c a ( OR c a ) | Delete around round brackets and enter insert mode |
| c a [ OR c a ] | Delete around square brackets and enter insert mode |
| c a { OR c a } | Delete around curly brackets and enter insert mode |
| c f Any key | Delete characters to the any character and enter insert mode |
| c t Any key | Delete characters until the character and enter insert mode |
| d i " | Delete the inside of double quotes |
| d i ' | Delete the inside of single quotes |
| d i w | Delete the current word |
| d i W | Delete the current WORD |
| d i ( OR d i ) | Delete the inside of round brackets |
| d i [ OR d i ] | Delete the inside of square brackets |
| d i { OR d i } | Delete the inside of curly brackets |
| d a " | Delete around double quotes (including quotes) |
| d a ' | Delete around single quotes (including quotes) |
| d a w | Delete a word (including surrounding whitespace) |
| d a W | Delete a WORD (including surrounding whitespace) |
| d a ( OR d a ) | Delete around round brackets (including brackets) |
| d a [ OR d a ] | Delete around square brackets (including brackets) |
| d a { OR d a } | Delete around curly brackets (including brackets) |
| d t Any key | Delete characters until the character |
| y i w | Yank the current word |
| y i W | Yank the current WORD |
| y i " | Yank the inside of double quotes |
| y i ' | Yank the inside of single quotes |
| y i ( OR y i ) | Yank the inside of round brackets |
| y i [ OR y i ] | Yank the inside of square brackets |
| y i { OR y i } | Yank the inside of curly brackets |
| y a w | Yank a word (including surrounding whitespace) |
| y a W | Yank a WORD (including surrounding whitespace) |
| ***** | Search forwards for the word under cursor |
| # | Search backwards for the word under cursor |
| f | Move to next any character on the current line |
| F | Move to previous any character on the current line |
| t | Move to the left of the any character on the current line |
| T | Move to the right of the back any character on the current line |
| ; | Repeat last f/F/t/T |
| , | Repeat last f/F/t/T in reverse |
| Ctrl w k | Move to the next window |
| Ctrl w j | Move to the previous window |
| z t | Scroll the screen so the cursor is at the top |
| z b | Scroll the screen so the cursor is at the bottom |
| z . | Center the screen on the cursor |
| z z | Center the screen on the cursor |
| Z Z | Write current file and exit |
| Z Q | Same as :q! |
| Ctrl w c | Close current window |
| Ctrl w + | Increase window height |
| Ctrl w - | Decrease window height |
| Ctrl w > | Increase window width |
| Ctrl w < | Decrease window width |
| Ctrl w = | Equalize window sizes |
| Ctrl w x | Swap window with next window |
| / | Search forwards |
| ? | Search backwards |
| \ r | QuickRun |
| g a | Show current character info |
| . | Repeat the last normal mode command |
| q Any key | Start recording operations for Macros |
| q | Stop recoding operations |
| @ Any key | Exec a macro |
| @ : | Repeat the last command mode command |
| K | Hover (LSP) |
| g c | Goto Declaration (LSP) |
| g d | Goto Definition (LSP) |
| g y | Goto Type Definition (LSP) |
| g i | Goto Implementation (LSP) |
| g r | References (LSP) |
| g h | Open Call hierarchy viewer (LSP) |
| g H | Outgoing call hierarchy (LSP) |
| g l | Document Link (LSP) |
| g f | Open URI/file under cursor |
| Space r | Rename (LSP) |
| g L | Code Lens (LSP) |
| z o | Open fold |
| z c | Close fold |
| z a | Toggle fold |
| z R | Open all folds |
| z M | Close all folds |
| z d | Delete folding lines |
| z D | Delete all folding lines |
| Ctrl s | Selection Range (LSP) |
| Space o | Document Symbol (LSP) |
| g t | Switch to the next buffer |
| g T | Switch to the previous buffer |
| Ctrl o | Jump Back (Jumplist) |
| Ctrl i | Jump Forward (Jumplist) |
| m m | Toggle bookmark on current line |
| m n | Jump to next bookmark |
| m p | Jump to previous bookmark |
| m c | Clear all bookmarks in current buffer |
Register
Register operations
| Keys | Description |
|---|---|
| " Any key y y | Yank a line to a named register |
| " Any key y l | Yank a character to a named register |
| " Any key y w | Yank a word to a named register |
| " Any key y } | Yank to the next blank line to a named register |
| " Any key y { | Yank to the previous blank line to a named register |
| " Any key p | Paste from a named register after cursor |
| " Any key P | Paste from a named register before cursor |
| " Any key d d | Delete a line to a named register |
| " Any key d w | Delete a word to a named register |
| " Any key d $ | Delete to end of line to a named register |
| " Any key d 0 | Delete to beginning of line to a named register |
| " Any key d G | Delete to end of file to a named register |
| " Any key d g g | Delete to beginning of file to a named register |
| " Any key d { | Delete to the previous blank line to a named register |
| " Any key d } | Delete to the next blank line to a named register |
| " Any key d i Any key | Delete inside to a named register |
| " Any key d h | Delete a character before cursor to a named register |
| " Any key c l OR " Any key s | Change a character to a named register |
| " Any key c i Any key | Change inside to a named register |
Visual mode
Visual Selection
| Keys | Description |
|---|---|
| d OR x | Delete text |
| c | Change (delete selection and enter insert mode) |
| y | Copy text |
| r | Replace character |
| S | Surround selection with character |
| J | Join lines |
| u | Convert to lowercase |
| U | Convert to uppercase |
| > | Indent |
| < | Unindent |
| ~ | Toggle case of character under cursor |
| Ctrl a | Increase number under cursor |
| Ctrl x | Decrease number under cursor |
| I | Insert character, multiple lines |
| z f | Fold selected lines |
| Ctrl s | Selection Range (LSP) |
| Esc | Go to Normal mode |
Replace mode
Replace Text
| Keys | Description |
|---|---|
| Esc | Go to Normal mode |
| Backspace | Undo |
Insert mode
Insert Text
| Keys | Description |
|---|---|
| Ctrl e | Insert the character which is below the cursor |
| Ctrl y | Insert the character which is above the cursor |
| Ctrl i | Insert a Tab |
| Ctrl h OR Backspace | Delete the character before the cursor |
| Ctrl t | Add an indent in current line |
| Ctrl d | Remove an indent in current line |
| Ctrl w | Delete the word before the cursor |
| Ctrl u | Delete all characters before the cursor in the current line |
| Ctrl r | Signature Help (LSP) |
| Ctrl o | Execute one Normal mode command and return to Insert mode |
| Esc | Go to Normal mode |
Backupmanager mode
Backup File Manager
| Keys | Description |
|---|---|
| j | Go down |
| k | Go up |
| g g | Go to the first line |
| G | Go to the last line |
| Enter | Open diff |
| R | Restore backup file |
| D | Delete backup file |
| r | Reload backup files |
References mode
References mode
| Keys | Description |
|---|---|
| j | Go down |
| k | Go up |
| g g | Go to the first line |
| G | Go to the last line |
| Enter | Jump to the destination |
| Esc | Quit References mode |
Call Hierarchy mode
Call Hierarchy
| Keys | Description |
|---|---|
| j | Go down |
| k | Go up |
| g g | Go to the first line |
| G | Go to the last line |
| Enter | Jump to the destination |
| i | Incoming call |
| o | Outgoing call |
Filer mode
File Manager
| Keys | Description |
|---|---|
| j | Go down |
| k | Go up |
| g g | Go to the first line |
| G | Go to the last line |
| l | Enter directory or open file |
| i | Detail Information |
| . | Toggle hidden files |
| D | Delete file |
| v | Split window and open file or directory |
| h | Split window horizontally and open file |
FileTree mode
File Tree Sidebar
Open the fileTree sidebar with :filetree command. If already open, it will close and reopen.
Navigation
| Keys | Description |
|---|---|
| j OR Down | Move selection down |
| k OR Up | Move selection up |
| g g | Move to first item |
| G | Move to last item |
| p | Move to parent node |
Open / Expand / Collapse
| Keys | Description |
|---|---|
| Enter | Open file, or toggle expand/collapse directory |
| o OR l | Open file, or expand directory |
| x OR h | Collapse directory (or move to parent) |
Root Navigation
| Keys | Description |
|---|---|
| C | Change root to selected directory |
| u | Move root up one level |
Search
| Keys | Description |
|---|---|
| / | Start incremental search |
| n | Jump to next search match |
| N | Jump to previous search match |
Misc
| Keys | Description |
|---|---|
| . | Toggle hidden files visibility |
| R | Refresh tree |
| : | Enter command mode |
Terminal mode
Built-in Terminal Emulator
Terminal-Input sub-mode (default)
All keystrokes are forwarded to the running shell/command.
| Keys | Description |
|---|---|
| Ctrl \ Ctrl n | Switch to Terminal-Normal sub-mode |
Terminal-Normal sub-mode
| Keys | Description |
|---|---|
| i | Return to Terminal-Input sub-mode |
| a | Return to Terminal-Input sub-mode |
| : | Enter command mode |
Configuration mode
Configuration mode
| Keys | Description |
|---|---|
| w | Save the current configs to the configuration file |
Command mode
Command mode
| Command | Description |
|---|---|
number | Jump to line number; e.g. :10 |
! shell command | Shell command execution |
bg | Pause the editor and show the recent terminal output |
man arguments | Show the given UNIX manual page, if available; e.g. :man man |
e filename | Open file |
e | Reload current file (error if unsaved changes) |
e! | Force reload current file (discard unsaved changes) |
e! filename | Open file (discard unsaved changes) |
ene | Create a new empty buffer |
new | Create a new empty buffer in a horizontally split window |
vnew | Create a new empty buffer in a vertically split window |
delete | Delete current line and copy to register |
ls | Display all buffers |
bprev | Switch to the previous buffer |
bnext | Switch to the next buffer |
bfirst | Switch to the first buffer |
blast | Switch to the last buffer |
bd or bd number | Delete buffer |
vs | Vertical split window |
vs filename | Open in a vertical split window |
sp | Horizontal split window |
sp filename | Open in a horizontal split window |
only | Close all other windows |
theme themeName | Change color theme; e.g. theme dark |
noh | Turn off search highlights |
stripwhitespace | Delete trailing spaces |
%s/keyword1/keyword2/ | Replace text (normal mode only) |
%d | Delete all lines and copy to register |
1,10d | Delete lines in range and copy to register |
set number or set nonumber | Show/hide line numbers (alias: nu, nonu) |
set relativenumber or set norelativenumber | Show/hide relative line numbers (alias: rnu, nornu) |
set cursorline or set nocursorline | Highlight the current line (alias: cul, nocul) |
set cursorcolumn or set nocursorcolumn | Highlight the current column (alias: cuc, nocuc) |
set statusline or set nostatusline | Show/hide status line (alias: stl, nostl) |
set syntax or set nosyntax | Enable/disable syntax highlighting (alias: syn, nosyn) |
set indentationlines or set noindentationlines | Enable/disable indentation guide lines (alias: indl, noindl) |
set autoindent or set noautoindent | Enable/disable auto indent (alias: ai, noai) |
set autocloseparen or set noautocloseparen | Enable/disable auto close paren (alias: acp, noacp) |
set autodeleteparen or set noautodeleteparen | Enable/disable auto delete paren (alias: adp, noadp) |
set clipboard or set noclipboard | Enable/disable system clipboard (alias: cb, nocb) |
set smoothscroll or set nosmoothscroll | Enable/disable smooth scroll (alias: sms, nosms) |
set livereload or set nolivereload | Enable/disable live reload of config (alias: lr, nolr) |
set icon or set noicon | Show/hide icons in filer mode (alias: icons, noicons) |
set highlightcurrentline or set nohighlightcurrentline | Highlight the current line (alias: hcl, nohcl) |
set highlightcurrentword or set nohighlightcurrentword | Highlight other uses of the current word (alias: hcw, nohcw) |
set highlightfullspace or set nohighlightfullspace | Highlight full width space (alias: hfs, nohfs) |
set highlightparen or set nohighlightparen | Highlight matching paren (alias: hp, nohp) |
set highlightfindchar or set nohighlightfindchar | Highlight f/F/t/T matches (alias: hfc, nohfc) |
set highlightcolorcode or set nohighlightcolorcode | Highlight inline color codes (#RRGGBB, #RGB) with their actual color (alias: hcc, nohcc) |
set highlightgitconflict or set nohighlightgitconflict | Highlight git merge conflict blocks (<<<<<<< / ======= / >>>>>>>) (alias: hgc, nohgc) |
set highlightgitconflicttwocolor or set nohighlightgitconflicttwocolor | Use two-color (ours/theirs) conflict scheme; disable for single-color fallback (alias: hgctc, nohgctc) |
set multistatusline or set nomultistatusline | Enable/disable multiple status line (alias: msl, nomsl) |
set ignorecase or set noignorecase | Enable/disable ignorecase (alias: ic, noic) |
set smartcase or set nosmartcase | Enable/disable smartcase (alias: scs, noscs) |
set incsearch or set noincsearch | Enable/disable incremental search (alias: is, nois) |
set hlsearch or set nohlsearch | Enable/disable search highlighting (alias: hls, nohls) |
set buildonsave or set nobuildonsave | Enable/disable build on save (alias: bos, nobos) |
set showgitinactive or set noshowgitinactive | Show/hide git branch in inactive window (alias: sgi, nosgi) |
set wrap or set nowrap | Enable/disable line wrap |
set expandtab or set noexpandtab | Enable/disable expand tab to spaces (alias: et, noet) |
set scrollbar or set noscrollbar | Enable/disable scrollbar |
set scrollbarwidth=number | Change scrollbar width (0 = hidden); e.g. set scrollbarwidth=1 |
set tabstop=number | Change tab stop width; e.g. set tabstop=4 (alias: ts) |
set shiftwidth=number | Change indent width; e.g. set shiftwidth=4 (alias: sw) |
set softtabstop=number | Change soft tab stop width; e.g. set softtabstop=4 (alias: sts) |
set scrollfriction=number | Change smooth scroll friction; e.g. set scrollfriction=80.0 (alias: sfr) |
set scrollairdrag=number | Change smooth scroll air drag; e.g. set scrollairdrag=2.0 (alias: sad) |
build | Build the current buffer |
lspfold | LSP Folding Range |
lspformat | LSP Document Formatting |
log | Open a log viewer for editor log |
lsplog | Open a log viewer for LSP log |
lsprestart | Restart the current LSP server |
lspcallhierarchyincoming | Show incoming calls (callers) at cursor |
lspcallhierarchyoutgoing | Show outgoing calls (callees) at cursor |
help | Open this help |
putconfigfile | Put a sample configuration file in ~/.config/moe |
moerc | Open the configuration file (moerc.toml) for editing |
quickrun | Quick run |
recent | Open recent file selection mode (Only supported on Linux) |
backup | Open backup file manager |
config | Open configuration mode |
debug | Open debug mode |
filetree | Toggle FileTree sidebar |
filetree path | Toggle FileTree sidebar with specified root path |
jump | Open Jump list viewer |
terminal | Open terminal emulator (default shell) |
terminal command | Run command in terminal emulator |
changes | Show Change list |
bookmarks | Show bookmark list |
conflictnext | Jump to next git merge conflict block |
conflictprev | Jump to previous git merge conflict block |
Runtime Key Mapping
Runtime key mapping commands
Map, unmap, and clear runtime key mappings. The :map-family commands expand the
right-hand side recursively (a remapped key on the RHS is itself re-expanded),
while the :noremap-family commands map keys verbatim (non-recursive). Unmapping
with :unmap or clearing with :mapclear restores the built-in default for the
affected keys.
Mappings are session-only and not persisted across restarts.
For persistent key mappings, use the [KeyMapping] section in moerc.toml. See configfile.md.
| Command | Description |
|---|---|
nmap {lhs} {rhs} | Map keys (Normal mode) |
nmap | List all Normal mode mappings |
imap {lhs} {rhs} | Map keys (Insert mode) |
imap | List all Insert mode mappings |
vmap {lhs} {rhs} | Map keys (Visual modes) |
vmap | List all Visual mode mappings |
rmap {lhs} {rhs} | Map keys (Replace mode) |
rmap | List all Replace mode mappings |
cmap {lhs} {rhs} | Map keys (Command mode) |
cmap | List all Command mode mappings |
map {lhs} {rhs} | Map keys (all modes) |
map | List all mode mappings |
nunmap {lhs} | Unmap keys (Normal mode) |
iunmap {lhs} | Unmap keys (Insert mode) |
vunmap {lhs} | Unmap keys (Visual modes) |
runmap {lhs} | Unmap keys (Replace mode) |
cunmap {lhs} | Unmap keys (Command mode) |
unmap {lhs} | Unmap keys (all modes) |
nmapclear | Clear mappings (Normal mode) |
imapclear | Clear mappings (Insert mode) |
vmapclear | Clear mappings (Visual modes) |
rmapclear | Clear mappings (Replace mode) |
cmapclear | Clear mappings (Command mode) |
mapclear | Clear mappings (all modes) |
noremap, nnoremap, inoremap, vnoremap, cnoremap map keys non-recursively
(the right-hand side is replayed verbatim, like Vim's noremap).
Key notation:
| Notation | Meaning |
|---|---|
a, j, 0 | Regular keys |
C-s, M-x | Modifier keys (C=Ctrl, M=Alt, S=Shift) |
Escape, Enter, Tab | Special keys |
Up, Down, F1-F12 | Arrow and function keys |
Space | Space key |
j j, g g | Multi-key sequences (space-separated) |
jj, gg | Vim-style concatenated keys (equivalent to j j, g g) |
The {rhs} can take any of these forms:
| RHS form | Meaning |
|---|---|
<command> | A registered command name (e.g. save-and-quit) |
<command> <args...> | A registered command with arguments |
<keys> | A key sequence replayed as input (e.g. Escape, g g) |
mode_switch <mode> | Switch to a mode (normal, insert, visual, replace, command) |
overlay_switch <overlay> | Open an overlay (command, search, rename) |
mode_switch and overlay_switch are reserved first words. The same RHS forms
work in the [KeyMapping] config section.
Examples:
:nmap C-s save-and-quit " Ctrl-S saves and quits (Normal mode)
:imap jj Escape " jj exits Insert mode
:nmap C-a g g " Ctrl-A goes to first line
:vmap C-c Escape " Ctrl-C exits Visual mode
:cmap C-a Home " Ctrl-A moves to line start (Command mode)
:nmap C-e mode_switch insert " Ctrl-E enters Insert mode
:nmap C-p overlay_switch command " Ctrl-P opens the command line
:nmap " List all Normal mode mappings
:map " List all mode mappings
:nunmap C-s " Remove Ctrl-S mapping in Normal mode
:nmapclear " Clear all Normal mode runtime mappings