All essential commands in one place. Click the printer icon to save as PDF.
Combine operator + motion: d+w = delete word. Double = whole line.
| Op | Name | Example |
|---|---|---|
| d | Delete (cut) | dw d$ dd |
| y | Yank (copy) | yw y3j yy |
| c | Change | cw c$ cc |
| > | Indent → | >> >j |
| < | Indent ← | << <j |
| = | Auto-indent | == =G |
| gu | Lowercase | guiw guu |
| gU | Uppercase | gUiw gUU |
| g~ | Toggle case | g~iw |
i = inner | a = around (includes delimiter)
Combine: ciw · da{ · yip · vat
Requires github/copilot.vim or zbirenbaum/copilot.lua
-- lazy.nvim
{ "github/copilot.vim" }
:Copilot setup-- lazy.nvim
{ "zbirenbaum/copilot.lua",
opts = {
suggestion = { auto_trigger = true },
}
}
-- adds Copilot as a cmp source
{ "zbirenbaum/copilot-cmp",
config = true
}
"copilot" to cmp sourcesvim.keymap.set("i", "<Tab>", function()
if require("copilot.suggestion")
.is_visible() then
require("copilot.suggestion")
.accept()
else
return "<Tab>"
end
end, { expr = true })
3j = down 3 lines |
5dw = delete 5 words |
10@a = macro 10 times |
2yy = yank 2 lines |
4>> = indent 4 lines
dd line dw word d$ to EOLdgg to top dG to bottomd2j 3 lines dip paragraph
ciw inner word ci" in quotesct, change to comma C to EOLcip paragraph
yy line yiw word y$ to EOLyip paragraph y3j 4 linesyi{ inside braces
>> line << unindent>3j 4 lines =G to bottom