Read this in other languages: 简体中文
The project monkey-vim, aims to make a powerful and fast terminal-native IDE.
Positioning: monkey-vim targets pure terminal environments — no GUI, no gvim, no built-in terminal multiplexing. Use it in:
| Environment | Description |
|---|---|
| Linux Terminal | xterm, kitty, alacritty, wezterm, gnome-terminal, etc. |
| macOS Terminal | Terminal.app, iTerm2, kitty, etc. |
| WSL | Windows Subsystem for Linux (WSL2 recommended) |
| Server TTY | Bare Linux console (tty1–tty63), 256-color fallback |
| kmscon | Kernel Mode Setting console — modern TTY replacement with true color and Unicode support |
Window/split management is delegated to tmux or your terminal emulator's native tabs.
- vim 9.0+
- A terminal environment (no GUI / gvim support)
git clone https://github.com/QMonkey/monkey-vim.git| Tool | Purpose | Required |
|---|---|---|
| curl | Plugin manager bootstrap | Yes |
| git | Plugin manager, vim-fugitive | Yes |
| ripgrep (rg) | ctrlsf code search + LeaderF Rg backend | Yes |
| universal-ctags | gutentags tag generation | Yes |
| cmake | Build LeaderF C extension | Yes (compile-time only) |
# Ubuntu/Debian
sudo apt-get install curl git ripgrep universal-ctags cmake
# Arch Linux
sudo pacman -S curl git ripgrep ctags cmake
# macOS
brew install curl git ripgrep universal-ctags cmakeLanguage Server Protocol support is provided by yegappan/lsp. Install the servers for languages you use:
| Language | LSP Server | Install |
|---|---|---|
| C/C++ | clangd | sudo apt-get install clangd or brew install llvm |
| Go | gopls | go install golang.org/x/tools/gopls@latest |
| Python | python-lsp-server | pip install python-lsp-server |
| Rust | rust-analyzer | rustup component add rust-analyzer |
| Lua | lua-language-server | sudo apt-get install lua-language-server or brew install lua-language-server |
| Shell | bash-language-server | npm install -g bash-language-server |
| Vim | vim-language-server | npm install -g vim-language-server |
| JavaScript | typescript-language-server | npm install -g typescript-language-server typescript |
| TypeScript | typescript-language-server | npm install -g typescript-language-server typescript |
| JSON | vscode-json-language-server | npm install -g vscode-langservers-extracted |
| YAML | yaml-language-server | npm install -g yaml-language-server |
| Markdown | marksman | sudo apt-get install marksman or brew install marksman |
# Ubuntu
sudo apt-get install gcc g++ clangd clang-format
# macOS
brew install gcc llvm clang-format# Install the latest version of Go, then:
go install golang.org/x/tools/gopls@latestpip install python-lsp-server
# Optional: formatters/linters
pip install autopep8 flake8 pylint# Install LSP server
npm install -g typescript-language-server typescript# Install rust-analyzer via rustup
rustup component add rust-analyzer# Install LSP server
npm install -g yaml-language-serverPreview Markdown in browser via WSL/glow:
# Option 1: glow (terminal Markdown renderer)
# https://github.com/charmbracelet/glow
brew install glow # or: go install github.com/charmbracelet/glow@latest
# Option 2: Open in Windows browser (WSL only)
# :!explorer.exe %Vim uses common Unicode characters (⎇, │, 🔒, ▸, ·, ¬) and works without extra fonts. A Nerd Font (e.g. Hack Nerd Font) is optional if you prefer the Powerline-style look.
- Linux, Mac, WSL, and kmscon
cd monkey-vim
ln -s $(pwd)/.vimrc ~/.vimrc
vimkmscon is a Linux KMS/DRM-based system console that replaces the legacy tty with full Unicode support, multi-seat capability, and true color rendering. It is an excellent companion for monkey-vim on headless servers.
# Ubuntu/Debian
sudo apt-get install kmscon
# Arch Linux
sudo pacman -S kmscon
# Build from source
git clone https://github.com/dvdhrm/kmscon.git
cd kmscon
./autogen.sh
./configure --prefix=/usr
make
sudo make installTo make kmscon the default system console instead of the legacy tty/getty, replace agetty with kmscon on the desired tty:
# Stop the existing getty on tty1
sudo systemctl stop getty@tty1.service
sudo systemctl disable getty@tty1.service
# Create a kmscon service for tty1
sudo mkdir -p /etc/systemd/system/getty.target.wants
sudo ln -s /usr/lib/systemd/system/kmsconvt@.service \
/etc/systemd/system/getty.target.wants/kmsconvt@tty1.service
# Start kmscon on tty1
sudo systemctl start kmsconvt@tty1.serviceAfter reboot, press Ctrl+Alt+F1 to switch to the kmscon-enhanced tty1. You can repeat this for tty2–tty6 as needed.
To preserve the ability to run a text-based autologin (e.g. for a headless coding server):
# Override the kmscon service to enable autologin
sudo systemctl edit kmsconvt@tty1.service
# Add the following lines:
[Service]
ExecStart=
ExecStart=/usr/bin/kmscon "--vt=%I" --seats=seat0 --no-switchvt \
--login -- /usr/bin/agetty --autologin your-username --noclear %IThen Ctrl+Alt+F1 will drop you directly into a kmscon session with vim-ready true color and Unicode.
Manually, for a one-off session:
# Start kmscon on a spare tty and run vim directly
sudo kmscon --login -- /usr/bin/vim
# Or switch to an existing kmscon session and launch vim
sudo kmscon --switchkmscon supports true color (24-bit). monkey-vim detects this automatically via has('termguicolors') and renders GUI colors directly.
If you fall back to a traditional Linux tty (tty1–tty63), monkey-vim degrades to 256-color mode with molokai's rehash256 palette for accurate color approximation.
kmscon uses the system's built-in font renderer. If you prefer Powerline-style icons, install a Nerd Font:
# Download and install Hack Nerd Font system-wide
wget https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Hack.zip
sudo unzip -o Hack.zip -d /usr/share/fonts/truetype/hack
sudo fc-cache -fvcd monkey-vim
git pull:PlugInstall
:PlugUpdate
:PlugUpgrade
:PlugClean| Plugin | Purpose |
|---|---|
| yegappan/lsp | Language Server Protocol client |
| hrsh7th/vim-vsnip | Snippet engine |
| Yggdroot/LeaderF | Fuzzy file/buffer/tag finder |
| dyng/ctrlsf.vim | Async code search (rg/ag backend) |
| skywind3000/asyncrun.vim | Async command runner |
| itchyny/lightline.vim | Status line |
| tomasr/molokai | Colorscheme |
| mg979/vim-visual-multi | Multiple cursors |
| monkoose/vim9-stargate | Easy motion (replaces vim-sneak) |
| tpope/vim-fugitive | Git wrapper |
| airblade/vim-gitgutter | Git diff in sign column |
| ludovicchabant/vim-gutentags | Automatic ctags generation |
| justinmk/vim-dirvish | Directory viewer (replaces netrw) |
| tpope/vim-surround | Surround text with parens/quotes/etc |
| svermeulen/vim-subversive | Substitute with clipboard |
| andymass/vim-matchup | Extended % matching |
| wellle/targets.vim | Additional text objects |
| michaeljsmith/vim-indent-object | Indent-based text objects |
| cohama/lexima.vim | Auto-close brackets/parens |
| tpope/vim-repeat | Repeat plugin maps with . |
| tpope/vim-eunuch | UNIX shell helpers (:W for sudo write) |
| tpope/vim-obsession | Session management |
| Konfekt/FastFold | Faster folding for large files |
| haya14busa/vim-asterisk | Improved * / # search |
| kshenoy/vim-signature | Visual marks |
| airblade/vim-rooter | Auto-change working directory |
| romainl/vim-qf | Quickfix/Location list helpers |
The "Leader" key below means comma key.
s Replace a motion/text object with clipboard content (e.g. siw)
S Replace from cursor to end of line with clipboard content
Y Copy from the cursor position to the end of the line, same as y$
H To the first non-blank character of the line, same as ^
L To the last character of the line, same as $
U Redo, same as Ctrl-r
; Enter command line mode, same as :
q Quit current window, same as :q
Shift+q Quit vim, same as :qa
t Recording, same as the original q (normal and visual mode)
j Move down one display line (gj), works on wrapped lines
k Move up one display line (gk), works on wrapped lines
f Search 1 char to jump (stargate)
F Search 2 consecutive chars to jump (stargate)
The following remaps work in both Insert mode and Command-line mode:
Ctrl+p Move up (Up)
Ctrl+n Move down (Down)
Ctrl+b Move left (Left)
Ctrl+f Move right (Right)
Ctrl+a Jump to start (Home)
Ctrl+e Jump to end (End)
Ctrl+h Backspace (BackSpace)
Ctrl+d Delete forward (Del)
F1 Open CtrlSF search prompt
F2 Toggle CtrlSF search window
F3 Open async Make prompt
F4 Open AsyncRun prompt
Leader+o Open a new buffer with given file path in current window
[+b Jump to previous buffer
]+b Jump to next buffer
Leader+s Open a horizontal split with given file path in current window
Leader+v Open a vertical split with given file path in current window
Ctrl+h Jump to the left split
Ctrl+j Jump to the below split
Ctrl+k Jump to the above split
Ctrl+l Jump to the right split
Leader+z Toggle zoom
Leader+t Open a tab with given file path in current window
[+t Jump to previous tab
]+t Jump to next tab
Leader+1~9 Jump to the 1~9 tab
Leader+[ Jump to first tab
Leader+] Jump to last tab
Pressing * or # highlights all occurrences of the word under cursor without moving. Press again to jump normally.
* Highlight current word without moving (press again to jump)
g* Same as *, partial match
# Same as *, search backward
g# Same as g*, search backward
s{textobj} Replace a text object with clipboard content (e.g. siw to replace current word)
ss Replace entire current line with clipboard content
S Replace from cursor to end of line with clipboard content
K Hover documentation for symbol under cursor
gh Show hover in popup
gd Go to definition
gc Go to declaration
gt Go to type definition
gi Go to implementation
gr Show references
Leader+gd Peek definition
Leader+gc Peek declaration
Leader+gt Peek type definition
Leader+gi Peek implementation
Leader+gr Peek references
Leader+rn Rename symbol
[d Previous diagnostic
]d Next diagnostic
[D First diagnostic
]D Last diagnostic
Leader+gh Show current line diagnostics
Ctrl+p Search files
Ctrl+m Search buffers
Ctrl+t Search buffer tags
Ctrl+y Search function in buffer
Ctrl+e Search line in buffer
These are standard Vim built-in keys enhanced by FastFold for performance:
za When on a closed fold, open it. When on an open fold, close it and set 'foldenable'
zc Close one fold under the cursor
zo Open one fold under the cursor
zR Open all folds
zM Close all folds
m[a-zA-Z] Toggle mark and display it in the leftmost column
m, Place the next available mark
m. If no mark on line, place the next available mark. Otherwise, remove (first) existing mark
dm[a-zA-Z] Delete mark[a-zA-Z]
m- Delete all marks in current line
m<Space> Delete all marks in current buffer
'[a-zA-Z] Jump to the mark
]` Jump to next mark
[` Jump to prev mark
`] Jump by alphabetical order to next mark
`[ Jump by alphabetical order to prev mark
m/ View all marks in Location List
m[0-9] Toggle the corresponding marker !@#$%^&*()
m<S-[0-9]> Remove all markers of the same type
m<BS> Remove all markers
]- Jump to next line having a marker of the same type
[- Jump to prev line having a marker of the same type
]= Jump to next line having a marker of any type
[= Jump to prev line having a marker of any type
m? Open location list and display markers from current buffer
- Open file directory in current window
~ Open project root or home directory in current window
<CR> Enter directory or open file
o Open in current window (edit)
a Open in horizontal split
i Open in vertical split
t Open in new tab
- Go up one directory
Leader+a Search current word in current directory
ys+textobj+surroundA Add surround A for the region of textobj
yss+surroundA Add surround A for current line
ds+surroundA Delete surround A
cs+surroundA+surroundB Change surround A to B
F3 Async make
F4 Async run arbitrary command
Leader+bs Save session
Leader+rs Remove session
'. Jump to last changes
'' To the position before the latest jump, or where the last "m'" or "m`" command was given
Ctrl+o Go to [count] Older cursor position in jump list
Ctrl+i Go to [count] newer cursor position in jump list
Ctrl+^ Edit the alternate file. Mostly the alternate file is the previously edited file
cod Toggle diff
cop Toggle paste
col Toggle list
con Clear search highlight
Leader+cr Change project root
Leader+space Strip trailing whitespace
Leader+Leader+space Strip trailing whitespace + \\r (DOS newlines)
Leader+q Toggle quickfix
Leader+l Toggle location list
Ctrl+j Expand snippet or jump to next placeholder
Ctrl+l Expand snippet or jump forward
Tab Jump to next placeholder
Shift+Tab Jump to previous placeholder
s Replace selected text with clipboard content
; Enter command line mode, same as :
< Decrease indent, keep selection
> Increase indent, keep selection
* Search selected text forward (standard vim behavior, enhanced by vim-asterisk)
# Search selected text backward (standard vim behavior, enhanced by vim-asterisk)
# '\r' standard for newline
s{textobj} Replace a text object with clipboard content (e.g. siw)
ss Replace entire current line with clipboard content
S Replace from cursor to end of line with clipboard content
f Search 1 character to jump to specific word
F Search 2 consecutive characters to jump (reverse direction)
Leader+a Search selected text in current directory
S+surroundA Add surround A for selected text (vim-surround built-in)
Ctrl+p Previous command
Ctrl+n Next command
Ctrl+a Jump to the begin of the command line
Ctrl+e Jump to the end of the command line
" Save file with root permission
:W" Search recursively in current directory for the pattern
" Jump to the first result unless ! is given.
:CtrlSF[!] [PATTERN]" Generate tags for current file
:GutentagsUpdate
" Generate tags for current project
:GutentagsUpdate!" Search files
:LeaderfFile [QUERY]
" Search buffers
:LeaderfBuffer [QUERY]
" Search tags in the project
:LeaderfTag [QUERY]
" Search buffer tags
:LeaderfBufTag [QUERY]
" Search functions
:LeaderfFunction [QUERY]
" Search marks
:LeaderfMarks [QUERY]1. git for vim: vim-fugitive
" Run an arbitrary git command. Similar to :!git [args] but chdir to the repository tree first.
" Recommended over :Gstatus, :Gcommit, :Gdiff, etc.
:Git [args]
" Common examples:
:Git status
:Git diff
:Git commit
:Git log
:Git blame
:Git pull
:Git push
:Git checkout %
" More help, please refer the video
https://github.com/tpope/vim-fugitive#screencasts
" or the official doc
:h fugitive.txt2. Git commit browser: gv.vim
" Open git commit browser
:GV- monkey-vim defaults to 8-width tab indentation using hard tabs. If you prefer 4-width spaces, change:
set tabstop=8
set softtabstop=8
set shiftwidth=8
set noexpandtabto
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab- Vim clipboard integration
monkey-vim sets clipboard=unnamed,unnamedplus so vim's yank/delete automatically syncs to the system clipboard. Copied text persists in the system clipboard after vim exits (the system clipboard is owned by the display server / Wayland compositor / terminal, not by vim).
If you use a standalone clipboard manager (optional):
| Tool | Platform | Purpose |
|---|---|---|
| parcellite | X11 | Lightweight clipboard manager with persistent history |
| cliphist | Wayland | Clipboard history for wlroots-based compositors |
| Built-in | macOS/WSL | System clipboard persists by default — no extra tool needed |
-
Use vim to view man doc in shell, put this in your bashrc:
export MANPAGER="env MAN_PN=1 vim -R +MANPAGER -"