- Installation
- Dependencies
- GUI (Optional)
- Plugins used
- Colorschemes installed
- Keymaps
- General Keymaps
- Plugin keymaps
alpha(Dashboard)better-escape(escape insert mode)boole(manipulate numbers and booleans)bufferlineandbufdelete(buffer tabs)nvim-cmp(autocompletion)floaterm(floating terminal)huez(colorscheme picker)gitsigns(Git integration)lazygit(Git client)leap(document navigation)nvim-lspconfig(language server)neo-tree(file explorer)surround(wrap text with pairs of characters)fzf-lua(fuzzy finder)telescope(find things)todo-comments(to-do tags in comments)trouble(diagnostics)
-
Clone this repository:
git clone https://github.com/PeterShaws/nvim-setup.git ~/.config/nvim -
Enter your Neovim configuration directory:
cd ~/.config/nvim
-
Launch Neovim (
nvim) and wait for Lazy's UI to appear, then wait for it to sync all plugins; -
You should be good to go; if not, relaunch Neovim.
-
nodejs/npm, to download LSPs, formatters, etc.; -
rg, for fuzzy finding; -
fd, for finding files; -
lazygit, for interacting with Git; -
ydiff, a pager that can show diffs side-by-side (optional).~/.config/lazygit/config.yml:gui: nerdFontsVersion: 3 sidePanelWidth: 0.2 theme: selectedLineBgColor: - "#444444" git: paging: colorArg: never pager: ydiff -p cat -s --wrap --width={{columnWidth}} os: editPreset: "nvim"
Use Neovide as a GUI for Neovim.
~/.config/neovide/config.toml:
[font]
normal = { "family" = "JetBrainsMono Nerd Font", "style" = "Light" }
bold = { "family" = "JetBrainsMono Nerd Font", "style" = "SemiBold" }
italic = { "family" = "JetBrainsMono Nerd Font", "style" = "Light Italic" }
bold_italic = { "family" = "JetBrainsMono Nerd Font", "style" = "SemiBold Italic" }
size = 16
hinting = "none"
edging = "subpixelantialias"
[font.features]
"JetBrainsMono Nerd Font" = ["+zero"]This Neovim setup has keymaps for copying/pasting in Neovide while in terminal mode (useful e.g. for LazyGit).
akinsho/bufferline.nvimbrenoprata10/nvim-highlight-colorsdavidmh/cspell.nvimfamiu/bufdelete.nvimfolke/lsp-colors.nvimfolke/neodev.nvimfolke/noice.nvimfolke/todo-comments.nvimfolke/trouble.nvimfolke/which-key.nvimggandor/leap.nvimgoolord/alpha-nvimhedyhli/markdown-toc.nvimhrsh7th/cmp-nvim-lsphrsh7th/cmp-pathhrsh7th/nvim-cmpibhagwan/fzf-luakdheepak/lazygit.nvimL3MON4D3/LuaSniplewis6991/gitsigns.nvimmax397574/better-escape.nvimMunifTanjim/nui.nvimnat-418/boole.nvimneovim/nvim-lspconfignumToStr/Comment.nvimnvim-lua/plenary.nvimnvim-lualine/lualine.nvimnvim-neo-tree/neo-tree.nvimnvim-telescope/telescope-ui-select.nvimnvim-telescope/telescope.nvimnvim-tree/nvim-web-deviconsnvim-treesitter/nvim-treesitternvim-treesitter/nvim-treesitter-textobjectsnvimdev/lspsaga.nvimnvimtools/none-ls.nvimrafamadriz/friendly-snippetsrcarriga/nvim-notifys1n7ax/nvim-window-pickersaadparwaiz1/cmp_luasniptpope/vim-fugitivetpope/vim-surroundvague2k/huez.nvimvoldikss/vim-floatermwilliamboman/mason-lspconfig.nvimwilliamboman/mason.nvimwindwp/nvim-autopairs
AlexvZyl/nordic.nvimatelierbram/Base2Tone-nvimcatppuccin/nvimcocopon/iceberg.vimdeparr/tairiki.nvimEdenEast/nightfox.nvimellisonleao/gruvbox.nvimfolke/tokyonight.nvimgmr458/vscode_modern_theme.nvimjacoborus/tender.vimkepano/flexoki-neovimliuchengxu/space-vim-darkloctvl842/monokai-pro.nvimlunacookies/vim-colors-xcodelunarvim/horizon.nvimmarko-cerovac/material.nvimMofiqul/dracula.nvimMofiqul/vscode.nvimneanias/everforest-nvimNLKNguyen/papercolor-themenyoom-engineering/oxocarbon.nvimolimorris/onedarkpro.nvimpatstockwell/vim-monokai-tastyprojekt0n/github-nvim-themerebelot/kanagawa.nvimribru17/bamboo.nvimrose-pine/neovimsainnhe/edgesainnhe/sonokaisavq/melange-nvimShatur/neovim-ayushaunsingh/nord.nvim
Note: Most if not all of these should be covered by the
which-keyplugin.
Note: In the tables below,
LeadermeansSpacewith this configuration.
| Modes | Keys | Description |
|---|---|---|
| i | Alt+h |
Move cursor left |
| i | Alt+j |
Move cursor down |
| i | Alt+k |
Move cursor up |
| i | Alt+l |
Move cursor right |
| Modes | Keys | Description |
|---|---|---|
| n | Ctrl+c |
Close current window |
| n | Ctrl+h |
Focus window to the left |
| n | Ctrl+j |
Focus window below |
| n | Ctrl+k |
Focus window above |
| n | Ctrl+l |
Focus window to the right |
| n | Ctrl+Shift+H |
Move window to the left |
| n | Ctrl+Shift+J |
Move window below |
| n | Ctrl+Shift+K |
Move window above |
| n | Ctrl+Shift+L |
Move window to the right |
| n | Ctrl+< |
Decrease window width |
| n | Ctrl+> |
Increase window width |
| n | Ctrl+- |
Decrease window height |
| n | Ctrl++ |
Increase window height |
| Modes | Keys | Description |
|---|---|---|
| n | Leader bd |
Change to current buffer’s directory |
| n | Leader bw |
Write the current buffer |
| n | Leader ba |
Write all open buffers |
| n | Leader qa |
Close all open buffers |
| n | Leader qq |
Quit Neovim without writing anything |
| n | Leader qw |
Quit Neovim, writing everything |
| n | F5 |
Source current lua file |
| Modes | Keys | Description |
|---|---|---|
| n | Leader A |
Select all text |
| n, x | gy |
Copy to clipboard |
| n, x | gp |
Paste from clipboard (after cursor) |
| n, x | gP |
Paste from clipboard (before cursor) |
| t | Ctrl+Shift+c |
Copy from terminal into clipboard |
| t | Ctrl+Shift+v |
Paste from clipboard into terminal |
| n, x | x |
Delete |
| n, x | X |
Delete |
| n | Alt+w |
Toggle word wrap |
| n | Alt+Shift+P |
Toggle whitespace |
| n | Leader cq |
Double quotes to single |
| n | Leader cQ |
Single quotes to double |
| n | Leader ci |
Reindent file |
| n | Esc |
Clear search highlight |
| n | Leader cc |
Conceal |
| n | Leader cr |
Reveal |
| Modes | Keys | Description |
|---|---|---|
| n | Leader a |
Dashboard |
| Modes | Keys | Description |
|---|---|---|
| i | jk |
Escape insert mode |
| Modes | Keys | Description |
|---|---|---|
| n | Ctrl+a |
Increment |
| n | Ctrl+x |
Decrement |
| Modes | Keys | Description |
|---|---|---|
| n | Alt+1 |
Go to 1st buffer |
| n | Alt+2 |
Go to 2nd buffer |
| n | Alt+3 |
Go to 3rd buffer |
| n | Alt+4 |
Go to 4th buffer |
| n | Alt+5 |
Go to 5th buffer |
| n | Alt+6 |
Go to 6th buffer |
| n | Alt+7 |
Go to 7th buffer |
| n | Alt+8 |
Go to 8th buffer |
| n | Alt+9 |
Go to 9th buffer |
| n | Alt+0 |
Go to last buffer |
| n | Alt+p |
Pick open buffer |
| n | Alt+h |
Go to previous buffer |
| n | Alt+l |
Go to next buffer |
| n | Alt+Shift+o |
Close other buffers |
| n | Alt+Shift+l |
Close buffers to the left |
| n | Alt+Shift+r |
Close buffers to the right |
| n | Alt+c |
Close current buffer |
| Modes | Keys | Description |
|---|---|---|
| n | Up |
Select previous item |
| n | Down |
Select next item |
| n | Ctrl+p |
Select previous item |
| n | Ctrl+n |
Select next item |
| n | Ctrl+u |
Scroll docs up |
| n | Ctrl+d |
Scroll docs down |
| n | Ctrl+Space |
Complete |
| n | Ctrl+e |
Abort |
| n | Return |
Confirm |
| n | Ctrl+f |
Next snippet jump point |
| n | Ctrl+b |
Previous snippet jump point |
| n | Tab |
Select next item |
| n | Shift+Tab |
Select previous item |
| Modes | Keys | Description |
|---|---|---|
| n, t | F12 |
Toggle floating terminal |
| Modes | Keys | Description |
|---|---|---|
| n | Leader hs |
Colorschemes |
| Modes | Keys | Description |
|---|---|---|
| n | ]c |
Next changed hunk |
| n | [c |
Previous changed hunk |
| n | Leader hs |
Stage hunk |
| n | Leader hr |
Reset hunk |
| v | Leader hs |
Stage hunk |
| v | Leader hr |
Reset hunk |
| n | Leader hS |
Stage buffer |
| n | Leader hu |
Unstage hunk |
| n | Leader hR |
Reset buffer |
| n | Leader hp |
Preview hunk |
| n | Leader hb |
Blame line |
| n | Leader tb |
Toggle current line blame |
| n | Leader hd |
Compare to base |
| n | Leader hD |
Compare to last commit |
| n | Leader td |
Toggle deleted |
| o, x | ih |
Select hunk |
| Modes | Keys | Description |
|---|---|---|
| n | F7 |
Open LazyGit |
| Modes | Keys | Description |
|---|---|---|
| n, x, o | s |
Leap forward |
| n, x, o | S |
Leap backward |
| n, x, o | gs |
Leap from window |
| Modes | Keys | Description |
|---|---|---|
| n | [d |
Previous diagnostic |
| n | ]d |
Next diagnostic |
| n | Leader e |
Show diagnostic |
| n | Leader E |
Open diagnostics list |
| n | Leader lr |
Rename symbol |
| n, v | Leader ca |
Code actions |
| n | Leader lc |
Code actions |
| n | Leader lp |
Peek definition |
| n | Leader lP |
Peek type definition |
| n | Leader lg |
Go to definition |
| n | Leader lG |
Go to type definition |
| n | Leader lh |
Incoming calls |
| n | Leader lH |
Outgoing calls |
| n | Leader lF |
Find references |
| n | Leader lo |
Outline |
| n | Leader ld |
Definition |
| n | Leader lR |
References |
| n | Leader li |
Implementations |
| n | Leader lD |
Type definition |
| n | Leader ls |
Document symbols |
| n | Leader lw |
Workspace symbols |
| n | Leader lf |
Format buffer |
| n | K |
Hover documentation |
| n | <C-k> |
Signature documentation |
| n | gD |
Go to declaration |
| n | Leader wf |
Add workspace folder |
| n | Leader wr |
Remove workspace folder |
| n | Leader wl |
List workspace folders |
| Modes | Keys | Description |
|---|---|---|
| n | F2 |
File explorer |
| n | F3 |
Git Status |
| n | F4 |
Document Symbols |
| n | Shift+F2 |
Close file explorer |
| Modes | Keys | Description |
|---|---|---|
| n | gz |
Get Surround |
| n | gZ |
Get Indented Surround |
| n | gzr |
Get Surround Replaced |
| n | gZr |
Get Indented Surround Replaced |
| n | gzd |
Get Surround Deleted |
| n | gzz |
Get String Surround |
| n | gZZ |
Get Indented String Surround |
| v | gz |
Visual Surround |
| v | gZ |
Visual Indented Surround |
| Modes | Keys | Description |
|---|---|---|
| n | Ctrl+\ |
Buffers |
| n | Ctrl+g |
Grep |
| n | Ctrl+p |
Files |
| n | Ctrl+i |
Live grep |
| Modes | Keys | Description |
|---|---|---|
| n | Leader ff |
Find files |
| n | Leader fg |
Live grep |
| n | Leader fb |
Open buffers |
| n | Leader fh |
Help tags |
| n | Leader fk |
Key maps |
| n | Leader fc |
Colorschemes |
| n | Leader ft |
To-do list |
| n | Leader fd |
Diagnostics |
| n | Leader f/ |
Search current buffer |
| n | Leader fm |
Messages |
| n | Leader fT |
Themes |
| Modes | Keys | Description |
|---|---|---|
| n | ]t |
Next to-do comment |
| n | [t |
Previous to-do comment |
| Modes | Keys | Description |
|---|---|---|
| n | Leader xx |
Toggle Trouble |
| n | Leader xw |
Workspace diagnostics |
| n | Leader xd |
Document diagnostics |
| n | Leader xq |
Quickfix |
| n | Leader xl |
Location list |
| n | Leader xr |
LSP References |
| n | Leader xt |
LSP References |