Skip to content

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

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

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 bufferline
<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

Bufferline

This part relies on the bufferline.nvim plugin.

key description modes
<leader>bc bufferline pick close normal
<leader>bd bufferline close current buffer normal
<leader>bh bufferline previous buffer normal
<leader>bl bufferline next buffer normal
<leader>bo bufferline close other buffers normal
<leader>bp bufferline pick buffer normal
<leader>bm bufferline move buffer rightwards normal
<leader>bM bufferline move buffer leftwards 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

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