From Vim
Select, then act
In Vim you type the action first and the motion second.
In dk you select the text first and then act on the selection.
w, b and e select by words, and x selects the lines of each selection.
Then d deletes the selection, c deletes it and enters Insert mode, and y yanks it.
Three rows of the table below show what that looks like:
- Vim’s
ddisx din dk:xselects the line andddeletes it. - Vim’s
dwisw din dk:wselects to the start of the next word andddeletes it. - Vim’s
yyisx yin dk:xselects the line andyyanks it.
Keys
| Task | Vim | dk |
|---|---|---|
| move left | h | h |
| move down | j | j |
| move up | k | k |
| move right | l | l |
| go to the start of the next word | w | w |
| go to the start of the previous word | b | b |
| go to the end of the next word | e | e |
| go to the start of the next long word | W | W |
| go to the start of the previous long word | B | B |
| go to the end of the next long word | E | E |
| go to the start of the line | 0 | g h |
| go to the first character of the line that is not whitespace | ^ | g s |
| go to the end of the line | $ | g l |
| go to the first line | gg | g g |
| go to the last line, or to line N with a count | G | G |
| go to the next paragraph | } | ] p |
| go to the previous paragraph | { | [ p |
| go to the bracket that matches the one at the cursor | % | m m |
| go to the top of the view | H | H |
| go to the middle of the view | M | M |
| go to the bottom of the view | L | L |
| find the next match of a character | f{char} | f |
| find the character before the next match of a character | t{char} | t |
| find the previous match of a character | F{char} | F |
| find the character after the previous match of a character | T{char} | T |
| repeat the last find | ; | A-. |
| scroll down one page | CTRL-F | C-f |
| scroll up one page | CTRL-B | C-b |
| scroll down half a page | CTRL-D | C-d |
| scroll up half a page | CTRL-U | C-u |
| scroll the view down one line | CTRL-E | C-e |
| scroll the view up one line | CTRL-Y | C-y |
| put the cursor line on the middle row of the view | zz | z z |
| put the cursor line on the first row of the view | zt | z t |
| put the cursor line on the last row of the view | zb | z b |
| go back to the jump before | CTRL-O | C-o |
| go to the next jump | CTRL-I | C-i |
| save the position to go back to later | m{A-Za-z} | C-s |
| delete the selection | d{motion} | d |
| change the selection | c{motion} | c |
| yank the selection | y{motion} | y |
| delete a character | x | d |
| delete a word | dw | w d |
| change to the end of a word | cw | e c |
| delete a line | dd | x d |
| change a line | cc | x c |
| yank a line | yy | x y |
| delete to the end of the line | D | v g l d |
| change to the end of the line | C | v g l c |
| yank to the end of the line | Y | v g l y |
| delete the word at the cursor | diw | m i w d |
| delete the word at the cursor and the white space next to it | daw | m a w d |
| change the word at the cursor | ciw | m i w c |
| yank the word at the cursor | yiw | m i w y |
| delete the paragraph | dip | m i p d |
| delete the paragraph and the blank lines after it | dap | m a p d |
| delete the text in the parentheses | di( | m i ( d |
| delete the parentheses and the text in them | da( | m a ( d |
| paste after the cursor | p | p |
| paste before the cursor | P | P |
| use a register for the next command | "{register} | " |
| yank a line into register a | "ayy | x " a y |
| paste register a after the cursor | "ap | " a p |
| replace a character | r{char} | r |
| switch the case | ~ | ~ |
| indent a line | >> | x > |
| unindent a line | << | x < |
| join lines | J | J |
| join lines with no space | gJ | g J |
| fill the lines to the text width | gq{motion} | g q |
| add a number to the number at the cursor | CTRL-A | C-a |
| subtract a number from the number at the cursor | CTRL-X | C-x |
| filter the line through a shell command | !!{filter} | x | |
| undo | u | u |
| redo | CTRL-R | U |
| go to an older text state | g- | g minus |
| go to a newer text state | g+ | g + |
| repeat the last change | . | . |
| insert before the cursor | i | i |
| insert after the cursor | a | a |
| insert at the first character of the line | I | I |
| insert at the end of the line | A | A |
| insert where Insert mode ended the last time | gi | g I |
| open a line below | o | o |
| open a line above | O | O |
| start Visual mode, or Select mode in dk | v | v |
| select whole lines | V | x |
| start blockwise Visual mode, or Block mode in dk | CTRL-V | C-v |
| select the whole document | ggVG | % |
| select the last selection again | gv | g v |
| select the word at the cursor | viw | m i w |
| search forward | /{pattern}<CR> | / |
| search backward | ?{pattern}<CR> | ? |
| go to the next match | n | n |
| go to the previous match | N | N |
| search forward for the word at the cursor | * | m i w * n |
| search backward for the word at the cursor | # | m i w * N |
| search forward for the word at the cursor, also inside a longer word | g* | m i w g * n |
| search backward for the word at the cursor, also inside a longer word | g# | m i w g * N |
| go to the next change of a diff | ]c | ] g |
| go to the previous change of a diff | [c | [ g |
| go to the definition of the word at the cursor | CTRL-] | g d |
| show docs for the word at the cursor | K | space k |
| open the file named at the cursor | gf | g f |
| show the code of the character at the cursor | g8 | g 8 |
| split the view: the new view goes below | CTRL-W s | C-w s |
| split the view: the new view goes to the right | CTRL-W v | C-w v |
| focus the next view | CTRL-W w | C-w w |
| focus the view to the left | CTRL-W h | C-w h |
| focus the view below | CTRL-W j | C-w j |
| focus the view above | CTRL-W k | C-w k |
| focus the view to the right | CTRL-W l | C-w l |
| move the view to the far left | CTRL-W H | C-w H |
| move the view to the bottom | CTRL-W J | C-w J |
| move the view to the top | CTRL-W K | C-w K |
| move the view to the far right | CTRL-W L | C-w L |
| make the view taller | CTRL-W + | C-w + |
| make the view shorter | CTRL-W - | C-w minus |
| make the view wider | CTRL-W > | C-w > |
| make the view narrower | CTRL-W < | C-w < |
| make the view as tall as it can be | CTRL-W _ | C-w _ |
| make the view as wide as it can be | CTRL-W | | C-w | |
| give the views equal sizes | CTRL-W = | C-w = |
| close the view | CTRL-W q | C-w q |
| close every other view | CTRL-W o | C-w o |
| go to the next tab page | gt | g t |
| go to the previous tab page | gT | g T |
| stop the editor and go back to the shell | CTRL-Z | C-z |
| write the document and quit | ZZ | :write-quit |
| quit with no write | ZQ | :quit! |
| write the document | :w[rite] | :write |
| write each changed document | :wa[ll] | :write-all |
| quit | :q[uit] | :quit |
| quit every view | :qa[ll] | :quit-all |
| write the document and quit | :wq | :write-quit |
| write each changed document and quit | :wqa[ll] | :write-quit-all |
| open a file | :e[dit] | :open |
| open an empty document | :ene[w] | :open-empty-document |
| close the document | :bd[elete] | :close-document |
| show the next document | :bn[ext] | :goto-next-document |
| show the previous document | :bp[revious] | :goto-previous-document |
| split the view: the new view goes below | :sp[lit] | :split-view-below |
| split the view: the new view goes to the right | :vs[plit] | :split-view-right |
| open a file in a new tab page | :tabe[dit] | :open-tab |
| close the tab page | :tabc[lose] | :close-tab |
| close every other tab page | :tabo[nly] | :close-other-tabs |
| go to the next tab page | :tabn[ext] | :goto-next-tab |
| go to the previous tab page | :tabp[revious] | :goto-previous-tab |
| move the tab page | :tabm[ove] | :move-tab |
| set an option | :se[t] | :set-option |
| set an option of the document | :setl[ocal] | :set-document-option |
| set the theme | :colo[rscheme] | :set-theme |
| run a shell command | :! | :run-shell-command |
| show the messages | :mes[sages] | :show-messages |
| show the working directory | :pw[d] | :show-directory |
| show help | :h[elp] | :help |
| check the health of the setup | :che[ckhealth] | :check-health |
| compare the document in a diff | :difft[his] | :diff-this |
| end the diff | :diffo[ff] | :end-diff |
| get the change from the other document of the diff | :diffg[et] | :get-diff-change |
| put the change into the other document of the diff | :diffpu[t] | :put-diff-change |
Commands, folds, marks and registers
:opens the prompt, and many typed commands have a short alias, such as:w,:q,:wqand:e.- dk has no folds yet.
C-ssaves your place on the jumplist,C-ogoes back to it,C-igoes forward again, andspace jlists the saved places."and a character pick the register for the next command, so"ayyanks to registeraand"appastes from it.
Themes
dk ships Vim’s colorschemes as themes named vim_<name>,
and Neovim’s default colors as neovim and neovim_light.
A colorscheme with a dark and a light variant becomes two themes:
vim_<name> from the dark one and vim_<name>_light from the light one.
The Vim themes are
vim_blue, vim_catppuccin, vim_catppuccin_light, vim_darkblue, vim_delek,
vim_desert, vim_elflord, vim_evening, vim_habamax, vim_industry, vim_koehler,
vim_lunaperche, vim_lunaperche_light, vim_morning, vim_murphy, vim_novum,
vim_novum_light, vim_pablo, vim_peachpuff, vim_quiet, vim_quiet_light,
vim_retrobox, vim_retrobox_light, vim_ron, vim_shine, vim_slate, vim_sorbet,
vim_torte, vim_unokai, vim_wildcharm, vim_wildcharm_light, vim_zaibatsu
and vim_zellner.
To use one, put theme = "vim_habamax" in config.toml.
:set-theme vim_habamax switches to it right away,
until dk quits or reads the config again.
Type :set-theme and a space, and Tab and S-Tab step through the theme names and draw each one.
Esc gives you back the theme you had.