Terminal text editors with mouse support
Most terminal editors support the mouse; the difference is whether it is on by default and how much it does. Micro, Helix, Neovim and Skink turn it on out of the box. Vim needs set mouse=a, nano needs set mouse (or nano -m), and Emacs in a terminal needs xterm-mouse-mode.
Terminal mouse support works through escape sequences, so it also works over SSH and inside tmux once tmux allows it.
How does the mouse work in a terminal?
Section titled “How does the mouse work in a terminal?”The editor asks the terminal to report mouse events (with an escape sequence). The terminal then sends clicks, drags and wheel movements as input, like keystrokes.
Modern terminals use the SGR encoding, which has no column limit. Because it is just input, it travels over SSH unchanged.
While an app has the mouse, your terminal’s own text selection is off. Most terminals let you hold a modifier (usually Shift) to select with the terminal instead.
Mouse support, editor by editor
Section titled “Mouse support, editor by editor”| Editor | Mouse by default | Turn it on | What you can do |
|---|---|---|---|
| Vim | Only via defaults.vim (skipped once you have a vimrc) |
set mouse=a, set ttymouse=sgr |
Click, drag to Visual select, wheel, resize splits |
| Neovim | Yes (mouse=nvi) |
vim.opt.mouse = "a" |
Same as Vim, plus a right-click menu |
| nano | No | set mouse in ~/.nanorc, or nano -m |
Click to place cursor, double-click sets the mark, wheel scrolls, click shortcuts |
| Micro | Yes | "mouse": true |
Click, drag, double and triple click, wheel, tabs and splits |
| Helix | Yes | mouse = true under [editor] |
Click, drag select, wheel |
Emacs (-nw) |
No | (xterm-mouse-mode 1) |
Click, drag, wheel, menus |
| Skink | Yes | Nothing to set | See below |
Config snippets to turn the mouse on
Section titled “Config snippets to turn the mouse on”" Vim: ~/.vimrcset mouse=aset ttymouse=sgr-- Neovim: init.lua (already on for n, v, i)vim.opt.mouse = "a"set mouse[editor]mouse = trueWhy doesn’t the mouse work in my terminal editor?
Section titled “Why doesn’t the mouse work in my terminal editor?”- tmux catches mouse events for itself. Add
set -g mouse onto~/.tmux.confso it forwards them to the program in the pane. - Over SSH, the remote editor uses the remote config. Your local vimrc or nanorc is not there.
- Wide windows: clicks beyond column 223 need the SGR encoding (
ttymouse=sgrin Vim). - Old or odd
TERM: set it toxterm-256color(ortmux-256colorinside tmux). - Build features: run
:versionin Vim and look for+mouse.
For Vim and Neovim in depth: how to use mouse clicks in Vim and Neovim.
What Skink does with the mouse
Section titled “What Skink does with the mouse”Skink is modeless, so a click never lands you in the wrong mode. It always captures the mouse and uses it for more than cursor placement.
In the text
Section titled “In the text”- Click places the cursor, drag selects, typing replaces the selection.
- Alt+click adds or removes a cursor.
- The wheel scrolls lines. Shift+wheel or a horizontal trackpad swipe scrolls long lines sideways while the line numbers stay put.
Around the text
Section titled “Around the text”- Tabs: click to switch, click the
xor middle-click to close. - Split panes: click to focus, drag the divider or a pane’s title row to resize.
- File tree: click or scroll to use it; drag its right border to make it wider or narrower.
- Gutter: click a git change mark to peek at it (stage, unstage, revert); click a fold mark to open the fold.
- Sticky scroll: click a header to jump to that block.
- Merge conflicts: click “Accept ours | theirs | both”.
In terminal tabs
Section titled “In terminal tabs”- Programs inside (htop, lazygit, an AI CLI) get mouse events too.
- Ctrl+click a
file:line[:col]to open it in the editor.
All of this works over SSH and in tmux. Copying with Ctrl+C also reaches your local clipboard through OSC 52.
Try it
Section titled “Try it”curl -fsSL https://skink.cc/install.sh | shskink .Details: mouse and trackpad guide. Comparisons: Skink vs nano, Skink vs Micro, Skink vs Helix.