Skip to content
/
Try

Terminal text editors with mouse support

Click, drag, Alt+click for cursors, scroll, switch tabs.

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.

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.

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
" Vim: ~/.vimrc
set mouse=a
set ttymouse=sgr
-- Neovim: init.lua (already on for n, v, i)
vim.opt.mouse = "a"
~/.nanorc
set mouse
~/.config/helix/config.toml
[editor]
mouse = true

Why 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 on to ~/.tmux.conf so 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=sgr in Vim).
  • Old or odd TERM: set it to xterm-256color (or tmux-256color inside tmux).
  • Build features: run :version in Vim and look for +mouse.

For Vim and Neovim in depth: how to use mouse clicks in Vim and Neovim.

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.

  • 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.
  • Tabs: click to switch, click the x or 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”.
  • 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.

Terminal window
curl -fsSL https://skink.cc/install.sh | sh
skink .

Details: mouse and trackpad guide. Comparisons: Skink vs nano, Skink vs Micro, Skink vs Helix.