Rafael Bodill's Neovim Config
Lean mean Neovim machine, 30-45ms startup time. Works best with Neovim β₯0.8
I encourage you to fork this repo and create your own experience. Learn how to tweak and change Neovim to the way YOU like it. This is my cultivation of years of tweaking, use it as a git remote and stay in-touch with upstream for reference or cherry-picking.
Table of Contents (π Click to expand/collapse)
Features
- Fast startup time β plugins are almost entirely lazy-loaded!
- Robust, yet light-weight
- Plugin management with folke/lazy.nvim. Use with
:Lazy
or Space+l - Install LSP, DAP, linters, and formatters. Use with
:Mason
or Space+mm - LSP configuration with nvim-lspconfig
- telescope.nvim centric work-flow with lists (try ;+fβ¦)
- Custom context-menu (try it! ;+c)
- Auto-complete extensive setup with nvim-cmp (try Tab or Ctrl+Space in insert-mode)
- Structure view with simrat39/symbols-outline.nvim
- Git features using lewis6991/gitsigns.nvim, sindrets/diffview.nvim, and more
- Auto-save and restore sessions with olimorris/persisted.nvim
- Unobtrusive, yet informative status & tab lines
- Premium color-schemes
- Remembers last-used colorscheme
Screenshot
Prerequisites
Optional, but highly recommended:
- bat (
brew install bat
) - fd (
brew install fd
) - fzf (
brew install fzf
) - ripgrep (
brew install ripgrep
) - zoxide (
brew install zoxide
)
Install
1. Let's clone this repo! Clone to ~/.config/nvim
mkdir -p ~/.config
git clone [email protected]:rafi/vim-config.git ~/.config/nvim
cd ~/.config/nvim
2. Run nvim
(will install all plugins the first time).
It's highly recommended running :checkhealth
to ensure your system is healthy
and meet the requirements.
Enjoy! π
Install LSP, DAP, Linters, Formatters
Use :Mason
to install and manage LSP servers, DAP servers, linters and
formatters. See :h mason.nvim
and williamboman/mason.nvim for more
information.
Language-Server Protocol (LSP)
You can install LSP servers using :Mason
UI, or :MasonInstall <name>
,
or :LspInstall <name>
(use Tab to list available servers).
See Mason's PACKAGES.md
for the official list, and the Language server mapping
list. You can also view at :h mason-lspconfig-server-map
You'll need utilities like npm
and curl
to install some extensions, see
requirements
(or :h mason-requirements
) for more information.
See lua/rafi/plugins/lsp/init.lua for custom key-mappings and configuration for some language-servers.
Recommended LSP
:MasonInstall ansible-language-server bash-language-server css-lsp
:MasonInstall dockerfile-language-server gopls html-lsp json-lsp
:MasonInstall lua-language-server marksman pyright sqlls
:MasonInstall svelte-language-server typescript-language-server
:MasonInstall tailwindcss-language-server
:MasonInstall vim-language-server yaml-language-server
and moreβ¦
Recommended Linters
:MasonInstall vint shellcheck editorconfig-checker flake8 gitlint hadolint
:MasonInstall markdownlint mypy selene shellharden write-good yamllint
Recommended Formatters
:MasonInstall black fixjson gofumpt golines isort
:MasonInstall shfmt sql-formatter stylua
Recommended Fonts
- Pragmata Pro (β¬19 β β¬1,990): My preferred font
- Any of the Nerd Fonts
On macOS with Homebrew, choose one of the Nerd Fonts, for example, here are some popular fonts:
brew tap homebrew/cask-fonts
brew search nerd-font
brew install --cask font-victor-mono-nerd-font
brew install --cask font-iosevka-nerd-font-mono
brew install --cask font-hack-nerd-font
brew install --cask font-fira-code
Upgrade
To upgrade packages and plugins:
- Neovim plugins:
:Lazy update
- Mason packages:
:Mason
and press U
To update Neovim configuration from my repo:
git pull --ff --ff-only
Structure
- init.lua β Entry-point, plugin initialization.
- neoconf.json β LSP servers options.
- after/ β Language specific custom settings and plugins.
- lua/ β Lua configurations
- config/ β Custom user configuration
- plugins/ β Custom user plugins (or
lua/plugins.lua
) - lsp/ β Custom user LSP configurations
- rafi/
- config/ β Neovim configurations
- autocmd.lua β Auto-commands
- init.lua β initialization
- keymaps.lua β Key-mappings
- options.lua β Editor settings
- lib/ β Libraries
- plugins/ β Plugins and configurations
- config/ β Neovim configurations
- snippets/ β Personal code snippets
- themes/ β Colorscheme overrides
Extending
Extend: Config
There are 2 distinct ways to extend configuration:
-
The first option is to fork this repository and create a directory
lua/config
with one or more of these files: (Optional)lua/config/autocmds.lua
β Custom auto-commandslua/config/options.lua
β Custom optionslua/config/keymaps.lua
β Custom key-mappingslua/config/setup.lua
β Override config, see extend defaults.
Adding plugins or override existing options:
lua/plugins/*.lua
orlua/plugins.lua
β Plugins (See lazy.nvim for syntax)
This option is recommended if you're not planning on customizing a lot, or you'd like to keep a close look of source-code.
-
Create your own clean
~/.config/nvim
, and leverage lazy.nvim to import my configuration specs. You can use LazyVim/starter and just changelua/plugins/example.lua
to:return { { "rafi/vim-config", -- Will load ALL my plugins and config/* import = "rafi.plugins", opts = true, }, { import = "plugins" }, -- Your local lua/plugins* }
This will import and set up my
lua/rafi/config/*
,lua/rafi/plugins/*
and then yours.If you'd rather import only specific plugins or specs, and not the entire plugin catalog, use
import
and removeopts
. For example:return { { "rafi/vim-config", import = "rafi.plugins.colorscheme" }, { import = "rafi.plugins.editor" }, { import = "rafi.plugins.ui" }, { import = "plugins" }, -- Your local lua/plugins* }
This example will NOT load my
lua/rafi/config/*
, and only install plugins categorically fromcolorscheme.lua
,editor.lua
, andui.lua
. At last, it will load all your plugins defined inlua/plugins.lua
orlua/plugins/*
.This option has the advantage of partially importing different "plugin specs" from various sources.
Extend: Plugins
For installing/overriding/disabling plugins, create a lua/plugins/foo.lua
file (or lua/plugins/foo/bar.lua
or simply lua/plugins.lua
) and manage your
own plugin collection. You can add or override existing plugins' options, or
just disable them all-together. Here's an example:
return {
-- Import "extras" plugins. See "Extra Plugins" in README
{ import = 'rafi.plugins.extras.ui.incline' },
-- Disable builtin plugins
{ 'shadmansaleh/lualine.nvim', enabled = false },
{ 'limorris/persisted.nvim', enabled = false },
-- Change builtin plugins' options
{
'nvim-treesitter/nvim-treesitter',
opts = {
ensure_installed = {
'bash', 'comment', 'css', 'diff', 'dockerfile', 'fennel', 'fish',
'gitcommit', 'gitignore', 'gitattributes', 'git_rebase', 'go', 'gomod',
'gosum', 'gowork', 'graphql', 'hcl', 'html', 'javascript', 'jsdoc',
'json', 'json5', 'jsonc', 'jsonnet', 'lua', 'make', 'markdown',
'markdown_inline', 'nix', 'perl', 'php', 'pug', 'python', 'regex',
'rst', 'ruby', 'rust', 'scss', 'sql', 'svelte', 'terraform', 'toml',
'tsx', 'typescript', 'vim', 'vimdoc', 'vue', 'yaml', 'zig',
},
},
},
-- GitHub plugins
-- Choose only ONE of these statuslines ;)
{ 'itchyny/lightline.vim' },
{ 'vim-airline/vim-airline' },
{ 'glepnir/galaxyline.nvim' },
{ 'glepnir/spaceline.vim' },
{ 'liuchengxu/eleline.vim' },
}
Extend: Defaults
If you are using this distro as-is, and aren't importing it externally,
create lua/config/setup.lua
and return any of these functions:
override()
lazy_opts()
For example: (Default values are shown)
local M = {}
---@return table
function M.override()
return {
defaults = {
autocmds = true, -- Load lua/rafi/config/autocmds.lua
keymaps = true, -- Load lua/rafi/config/keymaps.lua
},
features = {
elite_mode = false, -- Set arrow-keys to window resize
window_q_mapping = true, -- Disable regular window closing with 'q'
},
icons = {
-- See lua/rafi/config/init.lua for icon configurationβ¦
},
}
end
---@return table
function M.lazy_opts()
return {}
end
return M
If you are importing this distro via lazy.nvim specs, you can use opts
.
For example:
return {
{
"rafi/vim-config",
import = "rafi.plugins",
opts = {
features = {
elite_mode = false,
window_q_mapping = true,
},
},
},
}
Note: rafi.config.options
can't be disabled here since it's loaded
prematurely. You can disable loading options.lua
with the following line at
the top of your lua/config/setup.lua
or init.lua
:
package.loaded['rafi.config.options'] = true
Extend: LSP Settings
To override LSP configurations, you can do either:
-
Customize per project's
.neoconf.json
-
Or, override server options with nvim-lspconfig plugin, for example:
{ 'neovim/nvim-lspconfig', opts = { servers = { yamlls = { filetypes = { 'yaml', 'yaml.ansible', 'yaml.docker-compose' }, }, lua_ls = { settings = { Lua = { workspace = { checkThirdParty = false }, completion = { callSnippet = 'Replace' }, }, }, }, }, } }
-
Or, create a
lua/lsp/<server_name>.lua
file. Must return a table withconfig
function. For example, createlua/lsp/go.lua
:local opts = { settings = { gopls = { staticcheck = true } } } return { config = function() return opts end }
Plugin Highlights
- Plugin management with cache and lazy loading for speed
- Auto-completion with Language-Server Protocol (LSP)
- Project-aware tabline
- Extensive syntax highlighting with nvim-treesitter.
Note that 95% of the plugins are lazy-loaded.
Plugins Included
List of plugins (π Click to expand/collapse)
Completion & Code-Analysis
Name | Description |
---|---|
neovim/nvim-lspconfig | Quickstart configurations for the Nvim LSP client |
folke/neoconf.nvim | Manage global and project-local settings |
folke/neodev.nvim | Neovim setup for init.lua and plugin development |
williamboman/mason.nvim | Portable package manager for Neovim |
williamboman/mason-lspconfig.nvim | Mason extension for easier lspconfig integration |
hrsh7th/cmp-nvim-lsp | nvim-cmp source for neovim builtin LSP client |
mhartington/formatter.nvim | Format runner |
dnlhc/glance.nvim | Pretty window for navigating LSP locations |
Editor Plugins
Name | Description |
---|---|
folke/lazy.nvim | Modern plugin manager for Neovim |
nmac427/guess-indent.nvim | Automatic indentation style detection |
christoomey/tmux-navigator | Seamless navigation between tmux panes and vim splits |
tweekmonster/helpful.vim | Display vim version numbers in docs |
lambdalisue/suda.vim | An alternative sudo for Vim and Neovim |
olimorris/persisted.nvim | Simple session management for Neovim with git branching |
RRethy/vim-illuminate | Highlights other uses of the word under the cursor |
mbbill/undotree | Ultimate undo history visualizer |
ggandor/flit.nvim | Enhanced f/t motions for Leap |
ggandor/leap.nvim | General-purpose motion plugin |
kana/vim-niceblock | Make blockwise Visual mode more useful |
haya14busa/vim-edgemotion | Jump to the edge of block |
folke/zen-mode.nvim | Distraction-free coding for Neovim |
folke/which-key.nvim | Create key bindings that stick |
folke/todo-comments.nvim | Highlight, list and search todo comments in your projects |
folke/trouble.nvim | Pretty lists to help you solve all code diagnostics |
akinsho/toggleterm.nvim | Persist and toggle multiple terminals |
simrat39/symbols-outline.nvim | Tree like view for symbols using LSP |
s1n7ax/nvim-window-picker | Window picker |
rest-nvim/rest.nvim | Fast Neovim http client written in Lua |
mickael-menu/zk-nvim | Extension for the zk plain text note-taking assistant |
nvim-pack/nvim-spectre | Find the enemy and replace them with dark power |
echasnovski/mini.bufremove | Helper for removing buffers |
mzlogin/vim-markdown-toc | Generate table of contents for Markdown files |
Coding Plugins
Name | Description |
---|---|
hrsh7th/nvim-cmp | Completion plugin for neovim written in Lua |
hrsh7th/cmp-buffer | nvim-cmp source for buffer words |
hrsh7th/cmp-path | nvim-cmp source for path |
hrsh7th/cmp-emoji | nvim-cmp source for emoji |
saadparwaiz1/cmp_luasnip | Luasnip completion source for nvim-cmp |
andersevenrud/compe-tmux | Tmux completion source for nvim-compe/cmp |
L3MON4D3/LuaSnip | Snippet Engine written in Lua |
rafamadriz/friendly-snippets | Preconfigured snippets for different languages |
ziontee113/SnippetGenie | Snippet creation tool |
danymat/neogen | Annotation generator |
echasnovski/mini.pairs | Automatically manage character pairs |
echasnovski/mini.surround | Fast and feature-rich surround actions |
JoosepAlviste/nvim-ts-context-commentstring | Set the commentstring based on the cursor location |
echasnovski/mini.comment | Fast and familiar per-line commenting |
echasnovski/mini.trailspace | Trailing whitespace highlight and remove |
echasnovski/mini.ai | Extend and create a /i textobjects |
echasnovski/mini.splitjoin | Split and join arguments |
AndrewRadev/linediff.vim | Perform diffs on blocks of code |
AndrewRadev/dsf.vim | Delete surrounding function call |
Colorscheme Plugins
Name | Description |
---|---|
rafi/neo-hybrid.vim | Modern dark colorscheme, hybrid improved |
rafi/awesome-colorschemes | Awesome color-schemes |
AlexvZyl/nordic.nvim | Nord for Neovim, but warmer and darker |
folke/tokyonight.nvim | Clean, dark Neovim theme |
rebelot/kanagawa.nvim | Inspired by the colors of the famous painting by Katsushika Hokusai |
olimorris/onedarkpro.nvim | OneDarkPro theme |
EdenEast/nightfox.nvim | Highly customizable theme |
catppuccin/nvim | Soothing pastel theme |
nyoom-engineering/oxocarbon.nvim | Dark and light theme inspired by IBM Carbon |
Git Plugins
Name | Description |
---|---|
lewis6991/gitsigns.nvim | Git signs written in pure lua |
sindrets/diffview.nvim | Tabpage interface for cycling through diffs |
NeogitOrg/neogit | Magit clone for Neovim |
FabijanZulj/blame.nvim | Git blame visualizer |
rhysd/git-messenger.vim | Reveal the commit messages under the cursor |
ruifm/gitlinker.nvim | Browse git repositories |
rhysd/committia.vim | Pleasant editing on Git commit messages |
Misc Plugins
Name | Description |
---|---|
hoob3rt/lualine.nvim | statusline plugin written in pure lua |
nvim-neo-tree/neo-tree.nvim | File explorer written in Lua |
nvim-telescope/telescope.nvim | Find, Filter, Preview, Pick. All lua. |
jvgrootveld/telescope-zoxide | Telescope extension for Zoxide |
rafi/telescope-thesaurus.nvim | Browse synonyms from thesaurus.com |
nvim-lua/plenary.nvim | Lua functions library |
Treesitter & Syntax
Name | Description |
---|---|
nvim-treesitter/nvim-treesitter | Nvim Treesitter configurations and abstraction layer |
nvim-treesitter/nvim-treesitter-textobjects | Textobjects using treesitter queries |
nvim-treesitter/nvim-treesitter-context | Show code context |
RRethy/nvim-treesitter-endwise | Wisely add "end" in various filetypes |
windwp/nvim-ts-autotag | Use treesitter to auto close and auto rename html tag |
andymass/vim-matchup | Modern matchit and matchparen |
iloginow/vim-stylus | Better vim plugin for stylus |
chrisbra/csv.vim | Handling column separated data |
mustache/vim-mustache-handlebars | Mustache and handlebars syntax |
lifepillar/pgsql.vim | PostgreSQL syntax and indent |
MTDL9/vim-log-highlighting | Syntax highlighting for generic log files |
reasonml-editor/vim-reason-plus | Reason syntax and indent |
vmchale/just-vim | Syntax highlighting for Justfiles |
UI Plugins
Name | Description |
---|---|
nvim-tree/nvim-web-devicons | Lua fork of vim-devicons |
MunifTanjim/nui.nvim | UI Component Library |
rafi/tabstrip.nvim | Minimal and opinionated tabline |
rafi/theme-loader.nvim | Use last-used colorscheme |
folke/noice.nvim | Replaces the UI for messages, cmdline and the popupmenu |
stevearc/dressing.nvim | Improve the default vim-ui interfaces |
SmiteshP/nvim-navic | Shows your current code context in winbar/statusline |
rcarriga/nvim-notify | Fancy notification manager for NeoVim |
chentau/marks.nvim | Interacting with and manipulating marks |
lukas-reineke/indent-blankline.nvim | Visually display indent levels |
tenxsoydev/tabs-vs-spaces.nvim | Hint and fix deviating indentation |
t9md/vim-quickhl | Highlight words quickly |
kevinhwang91/nvim-bqf | Better quickfix window in Neovim |
uga-rosa/ccc.nvim | Super powerful color picker/colorizer plugin |
itchyny/calendar.vim | Calendar application |
Extra Plugins
List of extras (π Click to expand/collapse)
These plugins aren't enabled by default. You'll have to import them using specs. See Extend: Plugins on how to add plugins.
For example:
return {
{ import = 'rafi.plugins.extras.ui.incline' },
{ import = 'rafi.plugins.extras.org.vimwiki' },
}
Extra Plugins: Coding
Spec: rafi.plugins.extras.coding.<name>
Name | Repository | Description |
---|---|---|
autopairs |
windwp/nvim-autopairs | Autopairs for neovim written by lua |
cmp-git |
petertriho/cmp-git | Git source for nvim-cmp |
copilot |
zbirenbaum/copilot.lua | Fully featured & enhanced copilot |
editorconfig |
sgur/vim-editorconfig | EditorConfig plugin written entirely in Vimscript |
emmet |
mattn/emmet-vim | Provides support for expanding abbreviations alΓ‘ emmet |
sandwich |
machakann/vim-sandwich | Search, select, and edit sandwich text objects |
Extra Plugins: Diagnostics
Spec: rafi.plugins.extras.diagnostics.<name>
Name | Description |
---|---|
proselint |
proselint: null-ls source and mason package |
write-good |
write-good: null-ls source and mason package |
Extra Plugins: Editor
Spec: rafi.plugins.extras.editor.<name>
Name | Repository | Description |
---|---|---|
anyjump |
pechorin/any-jump.vim | Jump to any definition and references without overhead |
flybuf |
glepnir/flybuf.nvim | List buffers in a float window |
sidebar |
sidebar-nvim/sidebar.nvim | Generic and modular lua sidebar |
ufo |
kevinhwang91/nvim-ufo | Make folds look modern and keep a high performance |
Extra Plugins: Formatting
Spec: rafi.plugins.extras.formatting.<name>
Name | Description |
---|---|
prettier |
prettier: null-ls source and mason package |
Extra Plugins: Lang
Spec: rafi.plugins.extras.lang.<name>
Name | Description |
---|---|
go |
go syntax, lsp, dap and test |
json |
json syntax, lsp and schemas |
python |
python syntax, lsp, dap, test and rafi/neoconf-venom.nvim |
yaml |
yaml syntax, lsp and schemas |
Extra Plugins: Linting
Spec: rafi.plugins.extras.linting.<name>
Name | Description |
---|---|
ruff |
ruff for python |
Extra Plugins: LSP
Spec: rafi.plugins.extras.lsp.<name>
Key | Name | Description |
---|---|---|
gtd |
hrsh7th/nvim-gtd | LSP's go-to definition plugin |
inlayhints |
lvimuser/lsp-inlayhints.nvim | Partial implementation of LSP inlay hint |
lightbulb |
kosayoda/nvim-lightbulb | VSCode π‘ for neovim's built-in LSP |
null-ls |
jose-elias-alvarez/null-ls.nvim | Inject LSP diagnostics, code actions, and more |
yaml-companion |
yaml-companion.nvim | Get, set and autodetect YAML schemas in your buffers |
Extra Plugins: Org
Spec: rafi.plugins.extras.org.<name>
Key | Name | Description |
---|---|---|
vimwiki |
vimwiki/vimwiki | Personal Wiki for Vim |
Extra Plugins: Treesitter
Spec: rafi.plugins.extras.treesitter.<name>
Key | Name | Description |
---|---|---|
treesj |
Wansmer/treesj | Splitting and joining blocks of code |
Extra Plugins: UI
Spec: rafi.plugins.extras.ui.<name>
Key | Name | Description |
---|---|---|
barbecue |
utilyre/barbecue.nvim | VS Code like winbar |
bufferline |
akinsho/bufferline.nvim | Snazzy tab/bufferline |
cursorword |
itchyny/cursorword | Underlines word under cursor |
cybu |
ghillb/cybu.nvim | Cycle buffers with a customizable notification window |
deadcolumn |
Bekaboo/deadcolumn.nvim | Show colorcolumn dynamically |
goto-preview |
rmagatti/goto-preview | Preview definitions using floating windows |
incline |
b0o/incline.nvim | Floating statuslines |
minimap |
echasnovski/mini.map | Window with buffer text overview, scrollbar and highlights |
statuscol |
luukvbaal/statuscol.nvim | Configurable 'statuscolumn' and click handlers |
Custom Key-mappings
Note that,
- Leader key set as Space
- Local-Leader key set as ; and used for navigation and search (Telescope and Neo-tree)
- Disable β β β β in normal mode by enabling
elite_mode
.
Key-mappings (π Click to expand/collapse)
Modes: π=normal π=visual π=select π=insert π=operator π=commandNavigation
Key | Mode | Action | Plugin or Mapping |
---|---|---|---|
j / k | π π | Cursor moves through display-lines | g j/k |
g+j / k | π π π | Jump to edge upward/downward | haya14busa/vim-edgemotion |
gh / gl | π π | Easier line-wise movement | g ^/$ |
Space+Space | π π | Toggle visual-line mode | V / Escape |
zl / zh | π | Scroll horizontally and vertically wider | z4 l/h |
Ctrl+j | π | Move to split below | christoomey/tmux-navigator |
Ctrl+k | π | Move to upper split | christoomey/tmux-navigator |
Ctrl+h | π | Move to left split | christoomey/tmux-navigator |
Ctrl+l | π | Move to right split | christoomey/tmux-navigator |
Return | π | Toggle fold | za |
Shift+Return | π | Focus the current fold by closing all others | zMzvzt |
]a or [a | π | Next/previous on location-list | :lnext / :lprev |
]m or [m | π | Next/previous function | nvim-treesitter-textobjects |
]s or [s | π | Next/previous whitespace error | config/keymaps.lua |
]g or [g | π | Next/previous Git hunk | lewis6991/gitsigns.nvim |
]] or [[ | π | Next/previous reference | RRethy/vim-illuminate |
Ctrl+f | π | Move cursor forwards in command | Right |
Ctrl+b | π | Move cursor backwards in command | Left |
Ctrl+h | π | Move cursor to the beginning in command | Home |
Ctrl+l | π | Move cursor to the end in command | End |
File Operations
Key | Mode | Action | Plugin or Mapping |
---|---|---|---|
Space+cd | π | Switch to the directory of opened buffer | :tcd %:p:h |
Space+w | π | Write buffer to file | :write |
Ctrl+s | π π π | Write buffer to file | :write |
Auto-Completion
Key | Mode | Action | Plugin or Mapping |
---|---|---|---|
Tab / Shift-Tab | π | Navigate/open completion-menu | nvim-cmp |
Tab / Shift-Tab | π π | Navigate snippet placeholders | nvim-cmp |
Ctrl+Space | π | Open completion menu | nvim-cmp |
Enter | π | Select completion item or expand snippet | nvim-cmp |
Ctrl+p/n | π | Movement in completion pop-up | nvim-cmp |
Ctrl+b/f | π | Scroll documentation | nvim-cmp |
Ctrl+e | π | Abort selection and close pop-up | nvim-cmp |
Ctrl+l | π | Expand snippet at cursor | L3MON4D3/LuaSnip |
Space cc | π | Generate annotations | danymat/neogen |
LSP
Key | Mode | Action | Plugin or Mapping |
---|---|---|---|
gD | π | Go to declaration | plugins/lsp/keymaps.lua |
gd | π | Go to definition | plugins/lsp/keymaps.lua |
gr | π | Go to references | plugins/lsp/keymaps.lua |
gy | π | Go to type definition | plugins/lsp/keymaps.lua |
gi | π | Go to implementation | plugins/lsp/keymaps.lua |
K | π | Show hover help or collapsed fold | plugins/lsp/keymaps.lua |
gK | π | Show signature help | plugins/lsp/keymaps.lua |
Ctrl+g h | π | Show signature help | plugins/lsp/keymaps.lua |
]d or [d | π | Jump to next/prev diagnostics | plugins/lsp/keymaps.lua |
]e or [e | π | Jump to next/prev diagnostics | plugins/lsp/keymaps.lua |
Space cl | π | Open LSP info window | plugins/lsp/keymaps.lua |
Space cf | π π | Format | plugins/lsp/keymaps.lua |
Space cr | π | Rename | plugins/lsp/keymaps.lua |
Space ce | π | Open diagnostics window | plugins/lsp/keymaps.lua |
Space ca | π π | Code action | plugins/lsp/keymaps.lua |
Space cA | π | Source action | plugins/lsp/keymaps.lua |
Space uh | π | Toggle inlay-hints | plugins/lsp/keymaps.lua |
Space ud | π | Toggle buffer diagnostics | plugins/lsp/keymaps.lua |
Space uD | π | Toggle global diagnostics | plugins/lsp/keymaps.lua |
,wa | π | Add workspace folder | plugins/lsp/keymaps.lua |
,wr | π | Remove workspace folder | plugins/lsp/keymaps.lua |
,wl | π | List workspace folders | plugins/lsp/keymaps.lua |
gpd | π | Glance definitions | dnlhc/glance.nvim |
gpr | π | Glance references | dnlhc/glance.nvim |
gpy | π | Glance type definitions | dnlhc/glance.nvim |
gpi | π | Glance implementations | dnlhc/glance.nvim |
Edit
Key | Mode | Action | Plugin or Mapping |
---|---|---|---|
Shift+Return | π | Start new line from any cursor position | <C-o>o |
< | π | Indent to left and re-select | <gv |
> | π | Indent to right and re-select | `>gv |
Tab | π | Indent to right and re-select | `>gv |
Shift+Tab | π | Indent to left and re-select | <gv |
gc | π π | Comment prefix | echasnovski/mini.comment |
gcc | π π | Toggle comments | echasnovski/mini.comment |
Space+v | π π | Toggle single-line comments | echasnovski/mini.comment |
Space+j or k | π π | Move lines down/up | :m β¦ |
Space+d | π π | Duplicate line or selection | config/keymaps.lua |
Space+cp | π | Duplicate paragraph | yap<S-}>p |
Space+cw | π | Remove all spaces at EOL | echasnovski/mini.trailspace |
sj / sk | π | Join/split arguments | echasnovski/mini.splitjoin |
dsf / csf | π | Delete/change surrounding function call | AndrewRadev/dsf.vim |
I / gI | π | Blockwise insert | kana/vim-niceblock |
A | π | Blockwise append | kana/vim-niceblock |
Search & Replace
Key | Mode | Action | Plugin or Mapping |
---|---|---|---|
* / # | π π | Search partial words | g* / g# |
g* / g# | π π | Search whole-word forward/backward | * / # |
Backspace | π | Match bracket | % |
gpp | π | Select last paste | config/keymaps.lua |
sg | π | Replace within selected area | :s/β΄/gc |
Ctrl+r | π | Replace selection with step-by-step confirmation | :%s/\V/β΄/gc |
ss / SS | π π | Leap forward/backward | ggandor/leap.nvim |
f / F / t / T | π π | Enhanced motions | ggandor/flit.nvim |
Clipboard
Key | Mode | Action | Plugin or Mapping |
---|---|---|---|
p or P | π | Paste without yank | :let @+=@0 |
Space+y | π | Copy relative file-path to clipboard | config/keymaps.lua |
Space+Y | π | Copy absolute file-path to clipboard | config/keymaps.lua |
Command & History
Key | Mode | Action | Plugin or Mapping |
---|---|---|---|
! | π | Shortcut for shell command | :! |
g! | π | Read vim command into buffer | :put=execute('β΄') |
Ctrl+n / p | π | Switch history search pairs | β / β |
β / β | π | Switch history search pairs | Ctrl n /p |
Diagnostics
Key | Mode | Action | Plugin or Mapping |
---|---|---|---|
;+dt | π | Open TODO Telescope list | folke/todo-comments.nvim |
Space+xt | π | Open TODO list | folke/todo-comments.nvim |
Space+xT | π | Open TODO/FIXME list | folke/todo-comments.nvim |
Space+e | π | Open Trouble document | folke/trouble.nvim |
Space+r | π | Open Trouble workspace | folke/trouble.nvim |
Space+xQ | π | Open Quickfix via Trouble | folke/trouble.nvim |
Space+xL | π | Open Locationlist via Trouble | folke/trouble.nvim |
Editor UI
Key | Mode | Action | Plugin or Mapping |
---|---|---|---|
Space uf | π | Toggle format on Save | config/keymaps.lua |
Space us | π | Toggle spell-checker | :setlocal spell! |
Space ul | π | Toggle line numbers | :setlocal nonumber! |
Space uo | π | Toggle hidden characters | :setlocal nolist! |
Space uu | π | Toggle highlighted search | :set hlsearch! |
Space uw | π | Toggle wrap | :setlocal wrap! β¦ |
Space ue | π | Toggle indentation lines | lukas-reineke/indent-blankline.nvim |
Space ui | π | Show highlight groups for word | vim.show_pos |
Space uC | π | Select colorscheme | config/keymaps.lua |
Space un | π | Dismiss all notifications | rcarriga/nvim-notify |
Space ur | π | Redraw, clear hlsearch, and diff update | config/keymaps.lua |
g1 | π | Go to first tab | :tabfirst |
g9 | π | Go to last tab | :tablast |
g5 | π | Go to previous tab | :tabprevious |
Ctrl+Tab | π | Go to next tab | :tabnext |
Ctrl+ShiftTab | π | Go to previous tab | :tabprevious |
Alt+j | π | Go to next tab | :tabnext |
Alt+k | π | Go to previous tab | :tabprevious |
Alt+{ | π | Move tab backward | :-tabmove |
Alt+} | π | Move tab forward | :+tabmove |
Custom Tools & Plugins
Key | Mode | Action | Plugin or Mapping |
---|---|---|---|
;+c | π | Open context-menu | lua/rafi/lib/contextmenu.lua |
gCtrl+o | π | Navigate to previous file on jumplist | lib/edit.lua |
gCtrl+i | π | Navigate to next file on jumplist | lib/edit.lua |
s+p | π | Choose a window to edit | s1n7ax/nvim-window-picker |
s+w | π | Switch editing window with selected | s1n7ax/nvim-window-picker |
Space l | π | Open Lazy | folke/lazy.nvim |
Space o | π | Open structure window | simrat39/symbols-outline.nvim |
Space f | π | Show current structure scope in winbar | SmiteshP/nvim-navic |
Space ? | π | Open the macOS dictionary on current word | :!open dict:// |
Space P | π | Use Marked 2 for real-time Markdown preview | Marked 2 |
Space cp | π | Open color-picker | uga-rosa/ccc.nvim |
Space tt | π | Open terminal (root dir) | config/keymaps.lua |
Space tT | π | Open terminal (cwd) | config/keymaps.lua |
Space tg | π | Open Lazygit (root dir) | config/keymaps.lua |
Space tG | π | Open Lazygit (cwd) | config/keymaps.lua |
Space cc | π | Generate doc | danymat/neogen |
Space gu | π | Open undo-tree | mbbill/undotree |
Space gd | π | Git diff | sindrets/diffview.nvim |
Space gb | π | Git blame | FabijanZulj/blame.nvim |
Space go | π π | Open SCM detailed URL in browser | ruifm/gitlinker.nvim |
Space ml | π | Append modeline to end of buffer | config/keymaps.lua |
Space mda | π | Sequentially mark region for diff | AndrewRadev/linediff.vim |
Space mdf | π | Mark region for diff and compare if more than one | AndrewRadev/linediff.vim |
Space mds | π | Shows the comparison for all marked regions | AndrewRadev/linediff.vim |
Space mdr | π | Removes the signs denoting the diff regions | AndrewRadev/linediff.vim |
Space mh | π | Open HTTP Rest UI | rest-nvim/rest.nvim |
Space mt | π π | Toggle highlighted word | t9md/vim-quickhl |
Space zz | π | Toggle distraction-free writing | folke/zen-mode.nvim |
Window Management
Key | Mode | Action | Plugin or Mapping |
---|---|---|---|
q | π | Quit window (if last window, quit nvim) | :quit |
Ctrl+x | π | Rotate window placement | C-w x |
sv | π | Horizontal split | :split |
sg | π | Vertical split | :vsplit |
st | π | Open new tab | :tabnew |
so | π | Close other windows | :only |
sb | π | Previous buffer | :b# |
sc | π | Close current buffer | :close |
sd | π | Delete buffer | :bdelete |
sq | π | Quit window | :quit |
sx | π | Delete buffer, leave blank window | :enew β bdelete |
sz | π | Toggle window zoom | :vertical resize β resize |
sh | π | Toggle colorscheme background=dark/light | :set background β¦ |
Plugin: Mini.Surround
See echasnovski/mini.surround for more mappings and usage information.
Key | Mode | Action |
---|---|---|
ds | π | Delete around with query |
dss | π | Delete around automatically |
cs | π | Change around with query |
css | π | Change around automatically |
sa | π π π | Trigger add operator |
sd | π π | Trigger delete operator |
sdb | π | Delete around automatically |
sr | π π | Trigger replace operator |
srb | π | Replace around automatically |
ir | π π | Inner automatically |
ab | π π | Around automatically |
Plugin: Gitsigns
See lewis6991/gitsigns.nvim for more mappings and usage information.
Key | Mode | Action |
---|---|---|
]g or ]g | π | Next/previous Git hunk |
gs | π | Preview hunk |
Space hp | π | Preview hunk inline |
Space hb | π | Blame line |
Space hs | π π | Stage hunk |
Space hu | π | Undo stage hunk |
Space hr | π π | Reset hunk |
Space hR | π | Reset buffer |
Space hd | π | Toggle deleted |
Space hw | π | Toggle word diff |
Space hl | π | Publish hunks to location-list |
Plugin: Telescope
See telescope.nvim for more mappings and usage information.
Key | Mode | Action |
---|---|---|
;r | π | Results of the previous picker |
;R | π | List of the previous pickers |
;f | π | File search |
;g | π | Grep search |
;b | π | Buffers |
;x | π | Old files |
;v | π π | Yank history |
;m | π | Marks |
;n | π | Plugins |
;j | π | Jump points |
;k | π | Thesaurus |
;u | π | Spelling suggestions |
;o | π | Vim options |
;s | π | Sessions |
;t | π | LSP workspace symbols |
;h | π | Highlights |
;w | π | Zk notes |
;z | π | Zoxide directories |
;; | π | Command history |
;/ | π | Search history |
;dd | π | LSP definitions |
;di | π | LSP implementations |
;dr | π | LSP references |
;da | π π | LSP code actions |
Space / | π | Buffer fuzzy find |
Space gs | π | Git status |
Space gr | π | Git branches |
Space gl | π | Git commits |
Space gL | π | Git buffer commits |
Space gh | π | Git stashes |
Space gt | π | Find symbols matching word under cursor |
Space gf | π | Find files matching word under cursor |
Space gg | π π | Grep word under cursor |
Space sd | π | Document diagnostics |
Space sD | π | Workspace diagnostics |
Space sh | π | Help tags |
Space sk | π | Key-maps |
Space sm | π | Man pages |
Space ss | π | LSP document symbols |
Space sS | π | LSP workspace symbols |
Space st | π | Todo list |
Space sT | π | Todo/Fix/Fixme list |
Space sw | π | Grep string |
Space sc | π | Colorschemes |
Within Telescope window | ||
? | π | Keymaps help screen |
Ctrl+Space | π | Move from none fuzzy search to fuzzy |
jj or Escape | π | Leave Insert mode |
i | π | Enter Insert mode (filter input) |
q or Escape | π | Exit denite window |
Tab or Shift+Tab | π π | Next/previous candidate |
Ctrl+d/u | π π | Scroll down/upwards |
Ctrl+f/b | π π | Scroll preview down/upwards |
J or K | π | Select candidates up/downwards |
st | π | Open in a new tab |
sg | π | Open in a vertical split |
sv | π | Open in a split |
w | π | Smart send to quickfix list |
e | π | Send to quickfix list |
dd | π | Delete entry (buffer list) |
Plugin: Neo-Tree
See nvim-neo-tree/neo-tree.nvim for more mappings and usage information.
Key | Mode | Action |
---|---|---|
;e | π | Open file-explorer (toggle) |
;a | π | Focus current file in file-explorer |
Within Neo-Tree window | ||
g? | π | Show help |
q | π | Close window |
j or k | π | Move up and down the tree |
Tab or Shift+Tab | π | Next or previous source |
]g or [g | π | Jump to next/previous git modified node |
l | π | Toggle collapse/expand directory or open file |
h | π | Collapse directory tree |
Return | π | Select window to open file |
gr | π | Grep in current position |
gf | π | Find files in current position |
. | π | Set as root directory |
Backspace | π | Change into parent directory |
sv or S | π | Open file in a horizontal split |
sg or s | π | Open file in a vertical split |
st or t | π | Open file in new tab |
p | π | Preview toggle |
a | π | Create new directories and/or files |
N | π | Create new directory |
r | π | Rename file or directory |
dd | π | Delete |
c / m | π | Copy/move |
y / x / P | π | Clipboard copy/cut/paste |
! | π | Filter |
D | π | Filter directories |
# | π | Fuzzy sorter |
F | π | Filter on submit |
Ctrl+c | π | Clear filter |
Ctrl+r or R | π | Refresh |
fi / fe | π | Include/exclude |
H | π | Toggle hidden files |
e | π | Toggle auto-expand window width |
w | π | Toggle window width |
z | π | Collapse all nodes |
Plugin: Zk
See mickael-menu/zk-nvim and zk for more mappings and usage information.
Key | Mode | Action |
---|---|---|
Space+zn | π | Ask for title and create new note |
Space+zo | π | Browse notes sorted by modification time |
Space+zt | π | Browse tags |
Space+zf | π | Search notes |
Space+zf | π | Search notes with selection |
Space+zb | π | Show backlinks |
Space+zl | π | Show links |
Plugin: Spectre
See nvim-pack/nvim-spectre for more mappings and usage information.
Key | Mode | Action |
---|---|---|
Space+sp | π | Open spectre window (search & replace) |
Space+sp | π | Open spectre with selection |
Plugin: Marks
See chentau/marks.nvim for more mappings and usage information.
Key | Mode | Action |
---|---|---|
m, | π | Set the next available alphabetical (lowercase) mark |
m; | π | Toggle the next available mark at the current line |
m a-z | π | Set mark |
dm a-z | π | Remove mark |
dm- | π | Delete all marks on the current line |
dm<Space> | π | Delete all marks in the current buffer |
m] | π | Move to next mark |
m[ | π | Move to previous mark |
m: a-z | π | Preview mark |
m/ | π | List marks from all opened buffers |