From 1b81735bf7507da5ea3e4105c7c652a335bc8cd6 Mon Sep 17 00:00:00 2001 From: Oz Date: Fri, 31 Jul 2026 17:33:03 +0000 Subject: [PATCH] docs: document Vim indent and dedent operators in the code editor The Vim keybindings reference is an exhaustive list of supported functionality, but it omitted the > and < operators. Verified against crates/vim/src/vim.rs. Co-Authored-By: Oz --- .../code-editor-vim-keybindings.mdx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/content/docs/code/code-editor/code-editor-vim-keybindings.mdx b/src/content/docs/code/code-editor/code-editor-vim-keybindings.mdx index 0d7db88df..e12986640 100644 --- a/src/content/docs/code/code-editor/code-editor-vim-keybindings.mdx +++ b/src/content/docs/code/code-editor/code-editor-vim-keybindings.mdx @@ -79,9 +79,28 @@ See [Vim docs: motion](https://vimdoc.sourceforge.net/htmldoc/motion.html) for m | `.` | repeat last edit | | `gcc` | toggle comments on current line | | `gc` | toggle comments on visual selection | +| `>`, `<` | indent or dedent a range or object | +| `>>`, `<<` | indent or dedent the current line | See [Vim docs: editing](https://vimdoc.sourceforge.net/htmldoc/editing.html) for more information. +#### Indenting and dedenting + +`>` and `<` are operators, so they combine with any supported motion or text object the same way `d` and `y` do: + +| Command | Description | +| --------- | -------------------------------------------------------- | +| `>>` | indent the current line | +| `<<` | dedent the current line | +| `>j` | indent the current line and the line below | +| `>ap` | indent the current paragraph | +| `3>>` | indent the current line and the two below it | +| `>` / `<` | indent or dedent the selection in visual or visual line mode | + +In visual mode, `>` and `<` shift the selected lines and return to Normal mode. + +See [Vim docs: shifting text](https://vimdoc.sourceforge.net/htmldoc/change.html#%3E) for more information. + #### Text objects | Command(s) | Description |