vi-sql logo

Vim Mode

vi-sql has two keybinding profiles: vim (default) and normal. Vim mode uses hjkl navigation, sequence motions like gg, and vim-style copy/delete. Normal mode uses arrow keys and familiar terminal shortcuts.

Switch profiles by setting ui.vimMode in ~/.config/vi-sql/config.yaml:

yaml
ui:
  vimMode: true   # true = vim, false = normal
tip
Currently only 2-key sequences are supported in vim mode (e.g. gg, dd). Longer sequences are on the roadmap.
ActionVim modeNormal mode
Move upk
Move downj
Move lefth
Move rightl
Go to first itemggCtrl+Home
Go to last itemGCtrl+End
Focus panel upCtrl+kAlt+↑
Focus panel downCtrl+jAlt+↓
Focus panel leftCtrl+hAlt+←
Focus panel rightCtrl+lAlt+→

Common actions

ActionVim modeNormal mode
DeleteddCtrl+d
Copyyyc
PasteCtrl+vCtrl+v
ConfirmCtrl+sCtrl+Enter
Filter//
RefreshCtrl+rCtrl+r
Close / cancelEscEsc

Global

KeyAction
Ctrl+cQuit
F1Full-screen help
Ctrl+oOpen connection dialog
Alt+tChange theme
Alt+fExpand / collapse footer

Main view

KeyAction
: (vim) / Ctrl+Space (normal)Actions palette
gt (vim) / Ctrl+g (normal)Go to table
Ctrl+tNew tab
Ctrl+xClose tab
F2Rename tab
|Hide / show schema panel
Alt+sServer info
Alt+iImport CSV
ge (vim) / Ctrl+/ (normal)Focus schema tree

Schema tree

KeyAction
eExpand table
EExpand all
WCollapse all
sOpen structure
iOpen indexes
RRename table

Data view

KeyAction
KeyAction
-------------
o / EnterPeek row
OFull-page peek
EEdit row
DDuplicate row
yc (vim) / c (normal)Copy cell
yy (vim) / C (normal)Copy row
VMulti-select
EscClear selection
sToggle sort bar
SSort by column
HHide column
rReset hidden columns
Alt+eExplain query
Alt+mExport data
gd (vim) / Ctrl+b (normal)Follow foreign key
gr (vim) / Alt+r (normal)Find references

Row viewer (peeker)

KeyAction
EnterExpand field
vOpen value viewer
fToggle full screen
CCopy highlighted text

Structure view

KeyAction
RRename column
pToggle DDL pane

Explain viewer

KeyAction
tToggle ANALYZE mode

History

KeyAction
cCopy query
Alt+dPurge history

Index form

KeyAction
Ctrl+eToggle SQL editor
Ctrl+aAdd column

SQL editor

KeyAction
Alt+zToggle fullscreen editor
Alt+rQuery history
Ctrl+eOpen query in $EDITOR

Customizing keybindings

Edit ~/.config/vi-sql/keybindings-vim.yaml (vim mode) or ~/.config/vi-sql/keybindings-normal.yaml (normal mode) to remap any action. Both files are created with defaults on first launch.