Vim, tmux and Emacs Keys
Look up how to do a task in Vim, tmux or Emacs, or compare all three: save, search and replace, copy and paste, split panes, switch windows and record macros.
ทำงานในเบราว์เซอร์ของคุณ ไฟล์ไม่ออกจากอุปกรณ์ ดูวิธีตรวจสอบ
…
วิธีทำ
- 1Search a task
Type what you want to do.
- 2Pick columns
Show all three tools or one.
- 3Set the tmux prefix
Ctrl+b or Ctrl+a.
- 4Read the keys
Follow the notation notes.
- 5Practise
Use a few keys deliberately.
- 6Keep it handy
Print or copy the table.
เกี่ยวกับเครื่องมือนี้
Vim, Emacs and tmux are the classic keyboard-driven tools of the terminal, and many developers use at least two of them every day. Their shortcuts are powerful but notoriously hard to remember, and switching between them causes muscle-memory mix-ups. This reference lists thirty common tasks, from saving and quitting to splitting windows, moving between panes, copy mode, search and replace and macros, with the key sequence for each tool in its own column. Search by task, show one tool only, and set your tmux prefix to Ctrl+b or Ctrl+a so the table matches your setup. It is a quick way to learn one tool through another you already know, for example finding the Emacs equivalent of a Vim command.
Notation
- Vim: commands in normal mode unless they start with a colon (command-line mode). - tmux: prefix means press Ctrl+b (or your chosen prefix), release, then press the next key. Copy mode starts with prefix [. - Emacs: C- is Ctrl, M- is Meta (Alt, or Esc then the key). C-x C-s means Ctrl+x then Ctrl+s.
Learning tips
Learn a handful of moves at a time and use them deliberately for a week. In Vim, run vimtutor; in Emacs, press C-h t for the built-in tutorial; in tmux, prefix ? lists every binding.
Making them work together
Many people run Vim inside tmux and bind the same keys for moving between Vim splits and tmux panes, using a plugin such as vim-tmux-navigator. Emacs users often replace tmux with Emacs's own windows and terminal buffers.
Copy and paste between tools
Vim yanks into registers; "+y copies to the system clipboard when Vim is built with clipboard support. tmux copy mode keeps its own buffer, which you paste with prefix ]. Emacs uses the kill ring, cycled with M-y after C-y. Matching these up is the most common source of confusion when switching tools.
Splits and windows
All three let you split the screen. Vim splits share buffers, tmux panes run separate shells or programs, and Emacs windows show buffers inside one frame. Knowing which layer you are in avoids pressing Vim keys in a tmux pane running a shell.
Exiting Vim
:q quits, :q! quits without saving, :wq or ZZ saves and quits. If you are stuck in insert mode, press Esc first.
Limits
Defaults are shown; your configuration, plugins (such as Evil mode in Emacs) and distribution may change bindings. Neovim and Vim share these core keys. This is not an official manual; use each tool's built-in help for details.
ตัวอย่างพร้อมวิธีทำ
Searching "split" lists split horizontally (:split, prefix ", C-x 2), split vertically (:vsplit, prefix %, C-x 3), moving between splits and closing a split, side by side.
สรุปสั้น ๆ
- หมวดหมู่: นักพัฒนาและข้อมูล
- ทำงานในเบราว์เซอร์ ไม่ต้องสมัคร ไม่ต้องอัปโหลด
- ข้อมูลที่คุณกรอกอยู่บนอุปกรณ์ของคุณ
- มีภาษาอังกฤษ
- ตรวจสอบเนื้อหาล่าสุด:
- แหล่งข้อมูลทางการ: Vim user manual, tmux manual page and GNU Emacs manual
คำถามที่พบบ่อย
How do I quit Vim?
Press Esc, then :q to quit, :q! to discard changes or :wq to save and quit.
What is the tmux prefix?
A key combination pressed before each tmux command, Ctrl+b by default.
What does M- mean in Emacs?
The Meta key, usually Alt, or Esc pressed before the key.
Can I print the table?
Yes. Use your browser's print, or copy the table.
Does it cover Neovim?
The core keys are the same as Vim.
Are my settings saved?
Yes, the chosen columns and prefix are remembered on this device.
