How to use

June 28, 2026 ยท View on GitHub

Table of Contents

Exiting

Check the command line
KeysDescription
: wWrite file
: qQuit
: w qWrite and quit
: q !Force quit
: q aQuit all windows
: w q aWrite 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 qQuit with non-zero exit code

Normal mode

The Default Mode
KeysDescription
hGo left
jGo down
Ctrl jGo down
kGo up
lGo right
wGo forwards to the start of a word
eGo forwards to the end of a word
g eGo backwards to the end of a word
bGo backwards to the start of a word
rReplace a character at the cursor
Page UpPage Up
Page DownPage Down
g gGo 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
GGo to the last line
0Go 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
HMove to the top line of the screen
MMove to the center line of the screen
LMove to the bottom line of the screen
Ctrl bPage Up
Ctrl fPage Down
Ctrl uHalf Page Up
Ctrl dHalf Page Down
%Move to matching pair of paren
d $ OR DDelete until the end of the line
CChange until the end of the line
y y OR YCopy a line
y {Yank to the previous blank line
y }Yank to the next blank line
y lYank a character
y t Any keyYank characters to a any character
pPaste the clipboard
PPaste the clipboard before the cursor
nSearch forwards
NSearch backwards
g nGo to next search match and select it visually
g NGo to previous search match and select it visually
d g nDelete next search match
d g NDelete previous search match
] cJump to next git change hunk
[ cJump to previous git change hunk
] xJump to next git merge conflict block
[ xJump to previous git merge conflict block
:Start command mode
uUndo
Ctrl rRedo
Ctrl aIncrease number under cursor
Ctrl xDecrease number under cursor
>Indent
<Unindent
= =Auto indent
JJoin lines
d dDelete a line
xDelete current character
X OR d hDelete the character before the cursor
~Toggle case of character under cursor
g uLowercase (operator)
g UUppercase (operator)
S OR c cDelete the characters in the current line and start insert mode
s OR c lDelete 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 wDelete the current word and enter insert mode
c i WDelete 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 wDelete a word (with surrounding whitespace) and enter insert mode
c a WDelete 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 keyDelete characters to the any character and enter insert mode
c t Any keyDelete 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 wDelete the current word
d i WDelete 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 wDelete a word (including surrounding whitespace)
d a WDelete 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 keyDelete characters until the character
y i wYank the current word
y i WYank 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 wYank a word (including surrounding whitespace)
y a WYank a WORD (including surrounding whitespace)
*****Search forwards for the word under cursor
#Search backwards for the word under cursor
fMove to next any character on the current line
FMove to previous any character on the current line
tMove to the left of the any character on the current line
TMove 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 kMove to the next window
Ctrl w jMove to the previous window
z tScroll the screen so the cursor is at the top
z bScroll the screen so the cursor is at the bottom
z .Center the screen on the cursor
z zCenter the screen on the cursor
Z ZWrite current file and exit
Z QSame as :q!
Ctrl w cClose 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 xSwap window with next window
/Search forwards
?Search backwards
\ rQuickRun
g aShow current character info
.Repeat the last normal mode command
q Any keyStart recording operations for Macros
qStop recoding operations
@ Any keyExec a macro
@ :Repeat the last command mode command
KHover (LSP)
g cGoto Declaration (LSP)
g dGoto Definition (LSP)
g yGoto Type Definition (LSP)
g iGoto Implementation (LSP)
g rReferences (LSP)
g hOpen Call hierarchy viewer (LSP)
g HOutgoing call hierarchy (LSP)
g lDocument Link (LSP)
g fOpen URI/file under cursor
Space rRename (LSP)
g LCode Lens (LSP)
z oOpen fold
z cClose fold
z aToggle fold
z ROpen all folds
z MClose all folds
z dDelete folding lines
z DDelete all folding lines
Ctrl sSelection Range (LSP)
Space oDocument Symbol (LSP)
g tSwitch to the next buffer
g TSwitch to the previous buffer
Ctrl oJump Back (Jumplist)
Ctrl iJump Forward (Jumplist)
m mToggle bookmark on current line
m nJump to next bookmark
m pJump to previous bookmark
m cClear all bookmarks in current buffer

Register

Register operations
KeysDescription
" Any key y yYank a line to a named register
" Any key y lYank a character to a named register
" Any key y wYank 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 pPaste from a named register after cursor
" Any key PPaste from a named register before cursor
" Any key d dDelete a line to a named register
" Any key d wDelete a word to a named register
" Any key d $Delete to end of line to a named register
" Any key d 0Delete to beginning of line to a named register
" Any key d GDelete to end of file to a named register
" Any key d g gDelete 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 keyDelete inside to a named register
" Any key d hDelete a character before cursor to a named register
" Any key c l OR " Any key sChange a character to a named register
" Any key c i Any keyChange inside to a named register

Visual mode

Visual Selection
KeysDescription
d OR xDelete text
cChange (delete selection and enter insert mode)
yCopy text
rReplace character
SSurround selection with character
JJoin lines
uConvert to lowercase
UConvert to uppercase
>Indent
<Unindent
~Toggle case of character under cursor
Ctrl aIncrease number under cursor
Ctrl xDecrease number under cursor
IInsert character, multiple lines
z fFold selected lines
Ctrl sSelection Range (LSP)
EscGo to Normal mode

Replace mode

Replace Text
KeysDescription
EscGo to Normal mode
BackspaceUndo

Insert mode

Insert Text
KeysDescription
Ctrl eInsert the character which is below the cursor
Ctrl yInsert the character which is above the cursor
Ctrl iInsert a Tab
Ctrl h OR BackspaceDelete the character before the cursor
Ctrl tAdd an indent in current line
Ctrl dRemove an indent in current line
Ctrl wDelete the word before the cursor
Ctrl uDelete all characters before the cursor in the current line
Ctrl rSignature Help (LSP)
Ctrl oExecute one Normal mode command and return to Insert mode
EscGo to Normal mode

Backupmanager mode

Backup File Manager
KeysDescription
jGo down
kGo up
g gGo to the first line
GGo to the last line
EnterOpen diff
RRestore backup file
DDelete backup file
rReload backup files

References mode

References mode
KeysDescription
jGo down
kGo up
g gGo to the first line
GGo to the last line
EnterJump to the destination
EscQuit References mode

Call Hierarchy mode

Call Hierarchy
KeysDescription
jGo down
kGo up
g gGo to the first line
GGo to the last line
EnterJump to the destination
iIncoming call
oOutgoing call

Filer mode

File Manager
KeysDescription
jGo down
kGo up
g gGo to the first line
GGo to the last line
lEnter directory or open file
iDetail Information
.Toggle hidden files
DDelete file
vSplit window and open file or directory
hSplit 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.

KeysDescription
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

KeysDescription
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

KeysDescription
C
Change root to selected directory
u
Move root up one level
KeysDescription
/
Start incremental search
n
Jump to next search match
N
Jump to previous search match

Misc

KeysDescription
.
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.

KeysDescription
Ctrl \ Ctrl nSwitch to Terminal-Normal sub-mode

Terminal-Normal sub-mode

KeysDescription
iReturn to Terminal-Input sub-mode
aReturn to Terminal-Input sub-mode
:Enter command mode

Configuration mode

Configuration mode
KeysDescription
w
Save the current configs to the configuration file

Command mode

Command mode
CommandDescription
numberJump to line number; e.g. :10
! shell commandShell command execution
bgPause the editor and show the recent terminal output
man argumentsShow the given UNIX manual page, if available; e.g. :man man
e filenameOpen file
eReload current file (error if unsaved changes)
e!Force reload current file (discard unsaved changes)
e! filenameOpen file (discard unsaved changes)
eneCreate a new empty buffer
newCreate a new empty buffer in a horizontally split window
vnewCreate a new empty buffer in a vertically split window
deleteDelete current line and copy to register
lsDisplay all buffers
bprevSwitch to the previous buffer
bnextSwitch to the next buffer
bfirstSwitch to the first buffer
blastSwitch to the last buffer
bd or bd numberDelete buffer
vsVertical split window
vs filenameOpen in a vertical split window
spHorizontal split window
sp filenameOpen in a horizontal split window
onlyClose all other windows
theme themeNameChange color theme; e.g. theme dark
nohTurn off search highlights
stripwhitespaceDelete trailing spaces
%s/keyword1/keyword2/Replace text (normal mode only)
%dDelete all lines and copy to register
1,10dDelete lines in range and copy to register
set number or set nonumberShow/hide line numbers (alias: nu, nonu)
set relativenumber or set norelativenumberShow/hide relative line numbers (alias: rnu, nornu)
set cursorline or set nocursorlineHighlight the current line (alias: cul, nocul)
set cursorcolumn or set nocursorcolumnHighlight the current column (alias: cuc, nocuc)
set statusline or set nostatuslineShow/hide status line (alias: stl, nostl)
set syntax or set nosyntaxEnable/disable syntax highlighting (alias: syn, nosyn)
set indentationlines or set noindentationlinesEnable/disable indentation guide lines (alias: indl, noindl)
set autoindent or set noautoindentEnable/disable auto indent (alias: ai, noai)
set autocloseparen or set noautocloseparenEnable/disable auto close paren (alias: acp, noacp)
set autodeleteparen or set noautodeleteparenEnable/disable auto delete paren (alias: adp, noadp)
set clipboard or set noclipboardEnable/disable system clipboard (alias: cb, nocb)
set smoothscroll or set nosmoothscrollEnable/disable smooth scroll (alias: sms, nosms)
set livereload or set nolivereloadEnable/disable live reload of config (alias: lr, nolr)
set icon or set noiconShow/hide icons in filer mode (alias: icons, noicons)
set highlightcurrentline or set nohighlightcurrentlineHighlight the current line (alias: hcl, nohcl)
set highlightcurrentword or set nohighlightcurrentwordHighlight other uses of the current word (alias: hcw, nohcw)
set highlightfullspace or set nohighlightfullspaceHighlight full width space (alias: hfs, nohfs)
set highlightparen or set nohighlightparenHighlight matching paren (alias: hp, nohp)
set highlightfindchar or set nohighlightfindcharHighlight f/F/t/T matches (alias: hfc, nohfc)
set highlightcolorcode or set nohighlightcolorcodeHighlight inline color codes (#RRGGBB, #RGB) with their actual color (alias: hcc, nohcc)
set highlightgitconflict or set nohighlightgitconflictHighlight git merge conflict blocks (<<<<<<< / ======= / >>>>>>>) (alias: hgc, nohgc)
set highlightgitconflicttwocolor or set nohighlightgitconflicttwocolorUse two-color (ours/theirs) conflict scheme; disable for single-color fallback (alias: hgctc, nohgctc)
set multistatusline or set nomultistatuslineEnable/disable multiple status line (alias: msl, nomsl)
set ignorecase or set noignorecaseEnable/disable ignorecase (alias: ic, noic)
set smartcase or set nosmartcaseEnable/disable smartcase (alias: scs, noscs)
set incsearch or set noincsearchEnable/disable incremental search (alias: is, nois)
set hlsearch or set nohlsearchEnable/disable search highlighting (alias: hls, nohls)
set buildonsave or set nobuildonsaveEnable/disable build on save (alias: bos, nobos)
set showgitinactive or set noshowgitinactiveShow/hide git branch in inactive window (alias: sgi, nosgi)
set wrap or set nowrapEnable/disable line wrap
set expandtab or set noexpandtabEnable/disable expand tab to spaces (alias: et, noet)
set scrollbar or set noscrollbarEnable/disable scrollbar
set scrollbarwidth=numberChange scrollbar width (0 = hidden); e.g. set scrollbarwidth=1
set tabstop=numberChange tab stop width; e.g. set tabstop=4 (alias: ts)
set shiftwidth=numberChange indent width; e.g. set shiftwidth=4 (alias: sw)
set softtabstop=numberChange soft tab stop width; e.g. set softtabstop=4 (alias: sts)
set scrollfriction=numberChange smooth scroll friction; e.g. set scrollfriction=80.0 (alias: sfr)
set scrollairdrag=numberChange smooth scroll air drag; e.g. set scrollairdrag=2.0 (alias: sad)
buildBuild the current buffer
lspfoldLSP Folding Range
lspformatLSP Document Formatting
logOpen a log viewer for editor log
lsplogOpen a log viewer for LSP log
lsprestartRestart the current LSP server
lspcallhierarchyincomingShow incoming calls (callers) at cursor
lspcallhierarchyoutgoingShow outgoing calls (callees) at cursor
helpOpen this help
putconfigfilePut a sample configuration file in ~/.config/moe
moercOpen the configuration file (moerc.toml) for editing
quickrunQuick run
recentOpen recent file selection mode (Only supported on Linux)
backupOpen backup file manager
configOpen configuration mode
debugOpen debug mode
filetreeToggle FileTree sidebar
filetree pathToggle FileTree sidebar with specified root path
jumpOpen Jump list viewer
terminalOpen terminal emulator (default shell)
terminal commandRun command in terminal emulator
changesShow Change list
bookmarksShow bookmark list
conflictnextJump to next git merge conflict block
conflictprevJump 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.

CommandDescription
nmap {lhs} {rhs}Map keys (Normal mode)
nmapList all Normal mode mappings
imap {lhs} {rhs}Map keys (Insert mode)
imapList all Insert mode mappings
vmap {lhs} {rhs}Map keys (Visual modes)
vmapList all Visual mode mappings
rmap {lhs} {rhs}Map keys (Replace mode)
rmapList all Replace mode mappings
cmap {lhs} {rhs}Map keys (Command mode)
cmapList all Command mode mappings
map {lhs} {rhs}Map keys (all modes)
mapList 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)
nmapclearClear mappings (Normal mode)
imapclearClear mappings (Insert mode)
vmapclearClear mappings (Visual modes)
rmapclearClear mappings (Replace mode)
cmapclearClear mappings (Command mode)
mapclearClear 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:

NotationMeaning
a, j, 0Regular keys
C-s, M-xModifier keys (C=Ctrl, M=Alt, S=Shift)
Escape, Enter, TabSpecial keys
Up, Down, F1-F12Arrow and function keys
SpaceSpace key
j j, g gMulti-key sequences (space-separated)
jj, ggVim-style concatenated keys (equivalent to j j, g g)

The {rhs} can take any of these forms:

RHS formMeaning
<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

Go To Top