VIM Engine
Status
Needs design
Design in progress
Needs implementation
Implementation in progress
Stable
Goals
- Make VIM users comfortable in Builder
Bring powerful modal editing to GtkSourceView
Implementation
We do not plan on using upstream VIM. Abstracting the source editor is more complexity than we are interested in maintaining. However, implementing VIM modal editing on top of GtkSourceView is something we are interested in.
You can find the implementation of VIM mode here.
Supported Features
- Mode Keys
- Escape
- Control+[ (alias for Escape)
- i (switch to insert mode, before cursor)
- a (switch to insert mode, after cursor)
- A (switch to insert mode, at end of line)
- A (switch to insert mode, at first non-whitespace in line)
- : (switch to command mode)
- Movement Keys
- h (move backward one character)
- j (move down one line, preserving column)
- k (move up one line, preserving column)
- l (move forward one character)
- w (beginning of word, moving forwards)
- b (beginning of word, moving backwards)
- e (end of word, moving forwards)
- 0 (zero, first character in line)
- ^ (first non-whitespace character in line)
- $ (end of line)
- * (move to next search result)
- # (move to previous search result)
- gg (first line of file)
- G (last line of file)
- {N}G (jump to line N)
- Selections
- Shift+v (select entire line)
- v (select current character)
- Paging Keys
- Control+e
- Control-y
- z followed by (z, t, b) for (center, top, bottom)
Control+f (VIM style page down, not GtkTextView style)
Control+b (VIM style page up, not GtkTextView style)
- Changes
- d{movement} (delete, followed by a movement)
- dd (delete current line)
- x (delete character under cursor or selection)
- Control+a (increment number under cursor)
- Control+x (decrement number under cursor)
- Control+u (when in insert mode, delete from cursor to first non-whitespace)
- o (insert line after current, maybe auto-indent, switch to insert mode)
- O (insert line before current, maybe auto-indent, switch to insert mode)
- Copy and Paste
- y (copy current selection)
- yy (copy current line)
- y{movement} (copy the following movement)
- p (paste after current line)
- P (past before current line, but not implemented yet)
- Undo and Redo
- u (undo last change)
- Control+r (redo last change)
- Commands
- :w (save file)
- :sort (sort selected lines using g_strcmp0)