Aller au contenu

Keybinding Reference

Fern ships with four built-in keybinding presets modelled on popular editors. Press ? at any time inside Fern to open the in-app quick reference.


Changing your preset

Via the Settings Editor

The easiest way to switch preset is through the built-in Settings Editor without leaving Fern:

  1. Open the command palette with ctrl+p.
  2. Select Settings: Edit Global Settings.
  3. In the table, find the preset row under the [keybindings] section.
  4. Enter your chosen preset name in the value column: vim, emacs, helix, or arrows.
  5. Tab to the Save button and press enter.

The new preset takes effect immediately - no restart or vault reload needed.

Via the config file

You can also set the preset directly in ~/.config/fern/config.toml. Changes made this way take effect on the next launch (or :vaultSwitch).

[keybindings]
preset = "vim"   # vim, emacs, helix, or arrows

If preset is not set in either place, Fern auto-detects a suitable preset from the $EDITOR environment variable:

$EDITOR value(s) Preset used
vim, nvim, vi, gvim, and variants vim
emacs, emacsclient, mg, zile, and variants emacs
hx, helix helix
nano, code, micro, or anything else arrows

Application keybindings

These keys work everywhere in Fern and are independent of the active preset.

Fixed keys

Key Action
ctrl+q Quit
/ Open search
: Open command bar
? Show keybinding help

Configurable app keys

Override any of these in the [keybindings] section of your config.

Config key Default Action
sidebar ctrl+b Toggle sidebar
close_tab ctrl+w Close active tab
next_tab ] Next tab
prev_tab [ Previous tab
move_tab_left { Move tab left
move_tab_right } Move tab right
palette ctrl+p Open command palette

Viewer / editor keybindings

Select your preset to see its default bindings. All of these can be individually overridden - see Customising individual bindings below.

Navigation

ActionKey(s)
Move downj, down
Move upk, up
Move lefth, left
Move rightl, right
Word forwardctrl+right
Word backwardctrl+left
Line start0, home
Line end$, end
Half page downctrl+d
Half page upctrl+u
Go to top / go to line (prefix)g
Go to end of documentG

Editing

ActionKey(s)
Enter insert modei
Append after cursora
Append at line endA
Insert at line startI
Enter replace modeR
New line belowo
New line aboveO
Delete characterx
Delete (motion prefix)d
Replace character (prefix)r
Undou, ctrl+z
Redoctrl+r, ctrl+y
Indent>
Dedent<

Selection & clipboard

ActionKey(s)
Visual mode (character)v
Visual line modeV
Yank / copyy, ctrl+c
Cutd, x
Pastep, ctrl+v
Change (delete & enter insert)c
Search selections
Enclose selection (prefix)S

Checkboxes

ActionKey(s)
Toggle checkbox statet
Insert checkboxT

Folding

ActionKey(s)
Expand foldl, right
Collapse foldh, left

Search

ActionKey(s)
Search nextn
Search previousN
Cancel / escapeesc

Navigation

ActionKey(s)
Move downctrl+n, down
Move upctrl+p, up
Move leftctrl+b, left
Move rightctrl+f, right
Word forwardalt+f, ctrl+right
Word backwardalt+b, ctrl+left
Line startctrl+a, home
Line endctrl+e, end
Half page downctrl+v
Half page upalt+v
Go to top / go to line (prefix)alt+g
Go to end of documentalt+>

Editing

ActionKey(s)
Enter insert modei
Append after cursora
Append at line endA
Insert at line startI
Enter replace modeR
New line belowo
New line aboveO
Delete characterctrl+d
Delete (motion prefix)d
Replace character (prefix)r
Undoctrl+/, ctrl+z
Redoctrl+y
Indent>
Dedent<

Selection & clipboard

ActionKey(s)
Visual mode (character)v
Visual line modeV
Yank / copyalt+w, ctrl+c
Cutctrl+w, ctrl+x
Pastectrl+y
Change (delete & enter insert)c
Search selections
Enclose selection (prefix)S

Checkboxes

ActionKey(s)
Toggle checkbox statet
Insert checkboxT

Folding

ActionKey(s)
Expand foldl, right
Collapse foldh, left

Search

ActionKey(s)
Search nextn
Search previousN
Cancel / escapeesc, ctrl+g

Navigation

ActionKey(s)
Move downj, down
Move upk, up
Move lefth, left
Move rightl, right
Word forwardw, ctrl+right
Word backwardb, ctrl+left
Line startgh, home
Line endgl, end
Half page downctrl+d
Half page upctrl+u
Go to top / go to line (prefix)g
Go to end of documentG

Editing

ActionKey(s)
Enter insert modei
Append after cursora
Append at line endA
Insert at line startI
Enter replace modeR
New line belowo
New line aboveO
Delete characterdel
Delete (motion prefix)d
Replace character (prefix)r
Undou, ctrl+z
RedoU, ctrl+r
Indent>
Dedent<

Selection & clipboard

ActionKey(s)
Visual mode (character)v
Visual line modeV
Yank / copyy, ctrl+c
Cutd, x
Pastep, ctrl+v
Change (delete & enter insert)c
Search selections
Enclose selection (prefix)S

Checkboxes

ActionKey(s)
Toggle checkbox statet
Insert checkboxT

Folding

ActionKey(s)
Expand foldl, right
Collapse foldh, left

Search

ActionKey(s)
Search nextn
Search previousN
Cancel / escapeesc

Navigation

ActionKey(s)
Move downdown
Move upup
Move leftleft
Move rightright
Word forwardctrl+right
Word backwardctrl+left
Line starthome
Line endend
Half page downpgdown, ctrl+d
Half page uppgup, ctrl+u
Go to top / go to line (prefix)g
Go to end of documentG

Editing

ActionKey(s)
Enter insert modei
Append after cursora
Append at line endA
Insert at line startI
Enter replace modeR
New line belowo
New line aboveO
Delete characterdel
Delete (motion prefix)d
Replace character (prefix)r
Undoctrl+z
Redoctrl+y
Indent>
Dedent<

Selection & clipboard

ActionKey(s)
Visual mode (character)v
Visual line modeV
Yank / copyctrl+c
Cutctrl+x
Pastectrl+v
Change (delete & enter insert)c
Search selections
Enclose selection (prefix)S

Checkboxes

ActionKey(s)
Toggle checkbox statet
Insert checkboxT

Folding

ActionKey(s)
Expand foldright
Collapse foldleft

Search

ActionKey(s)
Search nextn
Search previousN
Cancel / escapeesc

Enclosing a selection

In Visual mode, press S followed by a bracket or marker character to wrap the selected text with a matching pair:

Key after S Result
( or ) (selection)
[ [selection]
{ or } {selection}
" "selection"
' 'selection'
` `selection`
* *selection*
_ _selection_
~ ~~selection~~ (strikethrough)
b **selection** (bold)

Press Esc after S to cancel without changing the selection.


Customising individual bindings

Any viewer key can be overridden under [keybindings.viewer] without switching the whole preset. Separate multiple keys for the same action with commas.

[keybindings]
preset = "vim"

[keybindings.viewer]
move_down = "j,down,ctrl+j"
move_up   = "k,up,ctrl+k"

The full list of configurable viewer key names is shown (commented out) in the auto-generated config file at ~/.config/fern/config.toml.

See Configuring Fern for details on the config file and the Settings Editor.