Keymaps
IceNvim has set up a lot of reasonable and easy-to-remember keymaps already. Almost all of them can be checked out via the awesome which-key.nvim plugin either when you are typing them or by explicitly calling the WhichKey command.
This page lists only those keymaps that IceNvim has added. Some of the default keymaps that come with plugins are not included.
Core Keymaps¶
These keymaps do not rely on external plugins. The details can be viewed in lua/core/keymap.lua.
| key | description | modes |
|---|---|---|
| gcO | add comment above current line | normal |
| gco | add comment below current line | normal |
| gcA | add comment after current line | normal |
| J | if in normal mode, join v_count + 1 lines |
normal / visual |
| \ | black hole register | normal / visual |
| <A-b> | open current html / markdown / typst file | normal |
| <A-o> | insert line below current line and remain in normal mode | normal |
| <A-O> | insert line above current line and remain in normal mode | normal |
| <C-g> | clear command line | normal / insert / visual / terminal |
| <C-s> | save file | normal / insert / visual |
| <C-t> | open terminal | normal |
| <C-z> | undo | normal / insert / visual / terminal / command |
| <leader>bd | delete buffer | normal |
| <leader>bh | go to previous buffer | normal |
| <leader>bl | go to next buffer | normal |
Command Mode Keymaps¶
These are keymaps that are aimed at enhancing editting experience in the command line. You might notice some resemblance to emacs.
| key | description |
|---|---|
| <C-f> | move forward |
| <C-b> | move backward |
| <C-a> | start of the line |
| <C-e> | end of the line |
| <A-f> | move forward one word |
| <A-b> | move backward one word |
Plugin-Related Keymaps¶
These keymaps are only available when the corresponding plugins are loaded. If you start neovim with the --noplugin flag, they would not work. You can check them out in lua/plugins/keymap.lua and lua/plugins/config.lua.
These keymaps are mostly prefixed with the leader key (<SPC> ) and an additional key that gives you a glimpse of what the keymap might do. They include:
| prefix | group |
|---|---|
| <leader>a | avante |
| <leader>b | buffers |
| <leader>g | git |
| <leader>h | hop |
| <leader>l | lsp |
| <leader>t | telescope |
| <leader>u | utils |
The full list of these keymaps include:
Avante¶
| key | description | modes |
|---|---|---|
| <leader>awc | focus selected code | normal |
| <leader>awi | focus input | normal |
| <leader>awa | focus result | normal |
| <leader>aws | focus selected files | normal |
| <leader>awt | focus todo | normal |
Git¶
This part relies on the gitsigns.nvim and neogit plugins.
| key | description | modes |
|---|---|---|
| <leader>gB | stage buffer | normal |
| <leader>gb | git blame | normal |
| <leader>gl | git blame line | normal |
| <leader>gn | go to next hunk | normal |
| <leader>gP | preview hunk | normal |
| <leader>gp | go to previous hunk | normal |
| <leader>gr | restore hunk | normal |
| <leader>gs | stage hunk | normal |
| <leader>gt | open neogit | normal |
| <leader>gu | undo stage | normal |
Hop¶
This part relies on the hop.nvim plugin.
| key | description | modes |
|---|---|---|
| <leader>hp | hop word | normal |
Lsp¶
The keymaps would only work if the corresponding lsp / formatter / ... is set up properly.
| key | description | modes |
|---|---|---|
| <leader>lc | code action | normal |
| <leader>ld | go to definition | normal |
| <leader>lf | format code | normal |
| <leader>lh | view hover doc | normal |
| <leader>li | go to implementation | normal |
| <leader>ln | go to next diagnostic | normal |
| <leader>lP | show line diagnostic | normal |
| <leader>lp | go to previous diagnostic | normal |
| <leader>lR | show references | normal |
| <leader>lr | rename | normal |
| <leader>lt | toggle trouble.nvim | normal |
| <leader>ly | yank line diagnostic | normal |
Telescope¶
This part relies on the telescope.nvim plugin.
| key | description | modes |
|---|---|---|
| <leader>t<C-f> | find in pwd | normal |
| <leader>tf | find file | normal |
| <leader>bi | manage buffers | normal |
Specifically, in the telescope picker, you have these keymaps:
| key | description | modes |
|---|---|---|
| <C-j> | next selection | insert |
| <C-k> | previous selection | insert |
| <C-n> | next history | insert |
| <C-p> | previous history in pwd | insert |
| <C-c> | exit | insert |
| <C-u> | scroll up | insert |
| <C-d> | scroll down | insert |
In the buffer management picker, you also have this keymap:
| key | description | modes |
|---|---|---|
| <M-d> | delete buffer | insert |
For the buffer management / live grep / find file pickers, you also have these keymaps:
| key | description | modes |
|---|---|---|
| <M-v> | vsplit | insert |
| <M-s> | split | insert |
Utils¶
| key | description | modes |
|---|---|---|
| <leader>uc | select config file | normal |
| <leader>uf | toggle nvim-tree | normal |
| <leader>ug | use grug-far to find and replace | normal |
| <leader>ul | open lazy panel | normal |
| <leader>ut | find todo items | normal |
| <leader>uu | toggle undo tree | normal |
Misc¶
| key | description | modes |
|---|---|---|
| <C-k><C-t> | open colorscheme picker | normal |