Skip to content

Latest commit

 

History

History
631 lines (479 loc) · 24.9 KB

keymaps.md

File metadata and controls

631 lines (479 loc) · 24.9 KB

Neovim Keymaps

Info

Note

I use a German keyboard layout (qwertz), so I have adjusted some key mappings.

for example: [ -> ü, ] -> +, , -> ö

Keymap Groups

Keymap Description
<Leader>c +Code
<Leader>g +Git
<Leader>t +Toggle
<Leader>x +Trouble
ö +Telescope

General

Options

Global options

Mode Keymap Description
<F7> Toggle line wrapping
<F8> Toggle relative line numbers
<F9> Toggle line numbers
<F10> Toggle spell checking

Local options

Mode Keymap Description
n <Leader>tow Toggle line wrapping
n <Leader>ton Toggle line numbers between absolute, relative and off

Goodies

Mode Keymap Description
n <Esc><Esc> Remove search highlights
i jj, <C-c> Exit insert mode
i jk Exit insert mode and save
n <C-a> Select all
x J Move selection down
x K Move selection up
n, x <Leader>ss Search and replace template
n <Leader>sw Search and replace word under cursor
n oo Insert line below (normal mode)
n OO Insert line above (normal mode)

Code Navigation

Mode Keymap Description
n üm Prev method start
n +m Next method start
n üM Prev method end
n +M Next method end
n Ü Prev empty line
n Ä Next empty line

Diagnostics

Mode Keymap Description
n <Leader>td Toggle diagnostics visibility
n +d Next diagnostic
n üd Previous diagnostic

Quickfix/Location List

Mode Keymap Description
n <Leader>xq Toggle quickfix list
n +q Next quickfix
n üq Previous quickfix
n <Leader>xl Toggle location list
n +l Next location
n ül Prev location

Spelling

Mode Keymap Description
n <Leader>tos Toggle spell checking (local)
n +s Next spelling mistake
n üs Previous spelling mistake

Buffers

Mode Keymap Description
n üb Prev Buffer
n +b Next Buffer

Tabs

Mode Keymap Description
n gt Next tab
n gT Previous tab

Windows

Mode Keymap Description
n sh Split window horizontally
n sv Split window vertically
n <C-h> Go to the left window
n <C-j> Go to the lower window
n <C-k> Go to the upper window
n <C-l> Go to the right window
n <C-w>x Swap current with the next
n <C-w>= Equally width and height
n <C-w>q Close current window
n <C-w><Left> Decrease window width
n <C-w><Right> Increase window width
n <C-w><Down> Decrease window height
n <C-w><Up> Increase window height

Others

Mode Keymap Description
n <Leader>ui Inspect Pos (Treesitter highlights)
n <Leader>uI Inspect Tree (Treesitter highlights)

Plugins

LSP/CMP/Snippets

Completion:

Mode Keymap Description
i <C-Space> Show completion menu
i <C-e> Hide completion menu
i <CR> Accept
i <C-j>, <C-n>, <Down> Select next
i <C-k>, <C-p>, <Up> Select previous
i <C-y> Select and accept
i <C-Space> Show/Hide documentation (if completion menu is visible)
i <C-b> Scroll documentation up
i <C-f> Scroll documentation down

Snippets:

Mode Keymap Description
i, s <Tab> Go to next snippet placeholder
i, s <S-Tab> Go to previous snippet placeholder
Mode Keymap Description P
n K Show hover information
i <C-k> Show hover information
n gK Show signature help
i <C-k> Show signature help
n ti Toggle inlay hints
n gs Show symbols in current buffer T
n gss Show symbols in workspace (sbt) T
n gr Show references (wuc) T
n gd Go to definition(s) (wuc) T
n gD Go to declaration (wuc)
n gdt Go to type definition(s) (wuc) T
n gI Go to implementation(s) T
n <Leader>ca Show code actions
n <Leader>rN Rename with all references (wuc)
-> inc-rename.nvim
n <Leader>f Format current buffer
-> conform.nvim
n <Leader>d Show line diagnostics
n <Leader>dd Show diagnostics for current buffer T
n <Leader>da Show diagnostics for all buffers T
n <Leader>rs Restart LSP servers for current buffer
  • wuc ... Word under cursor
  • sbt ... Same buffer (file) type?
  • T ... telescope.nvim
Mode Keymap Description
n +b Go to next buffer
n üb Go to previous buffer
n +t Go to next tab
n üt Go to previous tab
Mode Keymap Description
n gcc Toggle linewise comment for current line
n gbc Toggle blockwise comment for current line
x gc Toggle linewise comment for selection
x gb Toggle blockwise comment for selection
n gco Insert comment to the next line
n gcO Insert comment to the previous line
n gcA Insert comment to end of the current line
n gc} Toggle until the next blank line
n gcip Toggle inside of paragraph
n gca} Toggle around curly brackets
Mode Keymap Description
n, x <Leader>cf Format buffer/file or selection
n <Leader>tf Toggle format on save
Mode Keymap Description P
n <Leader>gp Show (preview) git hunk
n <Leader>gs Stage git hunk
n <Leader>gu Unstage git hunk
n <Leader>gR Reset git hunk
n +g Next git hunk
n üg Previous git hunk
n <Leader>gl Show git hunks in location list (TR)
Mode Keymap Description
n <Leader>h Open Harpoon quick menu
n <Leader>H Add (harpoon) file to quick menu
n <Leader>1 .. <Leader>5 Select file 1 to 9 directly
Mode Keymap Description
n <Leader>tha Toggle Hardtime
Mode Keymap Description
n <Leader>rn Rename with all references (wuc)
Mode Keymap Description
n <Leader>thi Toggle mini.hipatterns
Mode Keymap Description
n <Leader>cn Generate Annotations
Mode Keymap Description
n <Leader>l Lint current buffer/file
Mode Keymap Description
n <Leader>ws Save session (Working directory)
n <Leader>wl Load session (Working directory)
Mode Keymap Description
n <C-h> Go to the left window/pane
<C-j> Go to the lower window/pane
<C-k> Go to the upper window/pane
<C-l> Go to the right window/pane
<C-\\> Go to the previous window/pane
<C-Space> Go to the next window/pane
Mode Keymap Description
n,x <Leader>i Invert text/operand
Mode Keymap Description
n <Leader>e Toggle file explorer
Keymap Description
g? Show help (exit with q)
Mode Keymap Description
n <CR> Init selection (current node)
x <CR> Expand selection to outer (parent) node
x <BS> Reduce selection to inner (child) node
Mode Keymap Description
n <Leader>o Toggle outline of symbols
Mode Keymap Description
n <Leader>tp Toggle Precognition
Mode Keymap Description
n <Leader>tm Toggle Render Markdown
Mode Keymap Description
n <Leader>ts Toggle Supermaven
i <Tab> Accept suggestion
i <C-e> Clear suggestion
i <C-f> Accept word
Mode Keymap Description
n öf Find files in (cwd)
n ör Find recent (old) files (cwd)
n öb Find open buffers
n ög Find string (buffer)
n ögg Find string (cwd)
n, x öw Find current cursor (cwd)
n öh Find help tags
n öd Find diagnostics (buffer)
n ödd Find diagnostics (buffers)
n ö: Find commands
n ö:: Find command history
n ö/ Find search history
n öc Find git commits (buffer)
n öcc Find git commits
n ös Find treesitter symbols
n öR Find registers
n öö Reopen previous search
n ööb Find telescope builtin

In Telescope (Default Mappings):

Mode Keymap Description
i,n <CR> Confirm selected item
i <C-j> (<C-n>/<Down>) Move down
i <C-k> (<C-p>/<Up>) Move up
n q (<Esc>) Close Telescope
i <Esc> (<C-c>) Close Telescope
i <Tab> Toggle selection and move to next selection
i <S-Tab> Toggle selection and move to prev selection
i <C-r> Toggle (reverse) selection of all items
i <C-q> Send all or selected items to quickfix list
i <C-h> Show help
<C-x> Go to file selection as a split
<C-v> Go to file selection as a vsplit
<C-u> Scroll up in preview window
<C-d> Scroll down in preview window
!<C-f> Scroll left in preview window
!<C-b> Scroll right in preview window
Mode Keymap Description P
n öt Find in TODO comments T
n <Leader>xt Show TODO comments TR
Mode Keymap Description
n äj Down
n äk Up
n äh Left
n äl Right
Mode Keymap Description
n <Leader>xx Toggle workspace diagnostics
n <Leader>xX Toggle document diagnostics
n <Leader>cs Toggle symbols sidebar
n <Leader>cl Toggle lsp definitions, references sidebar
n <Leader>xL Toggle location list
n <Leader>xQ Toggle quickfix list
n +t Next item
n üt Previous item
Mode Keymap Description
n ++ Next reference
n üü Previous reference
Mode Keymap Description
n <Leader>? Show local buffer keymaps
n <Leader>?? Show global keymaps
Mode Keymap Description
n <Leader>z Toggle zen mode

Deactivated

  • Currently deactivated
Mode Keymap Description
n <Leader>tc Toggle Codeium
i <Tab> Accept completion
i <C-e> Cancel/Clear current completions
f <C-f> Cycle completions forwards
  • ? <S-Tab> for Cancel
  • ? <C-e> for Cancel/Clear like CMP
Mode Keymap Description
i, s <C-f> Go to next snippet placeholder
i, s <C-b> Go to previous snippet placeholder

CMP - Completion Menu:

Mode Keymap Description
i <CR>, <C-y> Confirm completion
i <C-e> Cancel completion
i <S-CR>, <C-r> Confirm completion with replace
i <C-Space> Trigger completion menu
i <C-j>, <Down> Go to the next item
i <C-k>, <Up> Go to the previous item
i <C-n> Go to the next item (trigger completion menu)
i <C-p> Go to the previous item (trigger completion menu)
<C-u> Scroll completion documentation up
<C-d> Scroll completion documentation down

ftplugin

AsciiDoc

Mode Keymap Description
n <Leader>Ah Find headers (from level 2)
n <Leader>AH Find headers (from level 2) to location list

Help

Mode Keymap Description
n gh Go to help tag (definition) like <C-]>

Markdown

Mode Keymap Description
n <Leader>A1 Fix TOC generated from Marksman
n <Leader>Ah Find headers (from level 2)
n <Leader>AH Find headers (from level 2) to location list