Editor Configuration Patterns
Purpose: Read this when configuring neovim, vim, or Zed, or when you need plugin layout, lazy.nvim, vim.pack, keymap design, blink.cmp, or Neovim 0.12+ guidance.
Contents
- Neovim configuration
- Vim configuration
- Keymap design principles
- Minimal vs full configuration
- Neovim 0.10 plus features
- Neovim 0.12 features
- blink.cmp
- Zed configuration
Neovim Configuration
Directory Structure
~/.config/nvim/
├── init.lua
├── lazy-lock.json
└── lua/
├── config/
│ ├── autocmds.lua
│ ├── keymaps.lua
│ ├── lazy.lua
│ └── options.lua
└── plugins/
├── colorscheme.lua
├── completion.lua
├── editor.lua
├── lsp.lua
├── telescope.luainit.lua Entry Point
require("config.options")
require("config.lazy")
vim.api.nvim_create_autocmd("User", {
pattern = "VeryLazy",
callback = function()
require("config.autocmds")
require("config.keymaps")
end,
})Core Options
local opt = vim.opt
opt.number = true
opt.relativenumber = true
opt.tabstop = 2
opt.shiftwidth = 2
opt.expandtab = true
opt.smartindent = true
opt.ignorecase = truelazy.nvim Bootstrap
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git", "clone", "--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins", {
defaults = { lazy = true },
install = { colorscheme = { "catppuccin" } },
checker = { enabled = true, notify = false },
})Key Mapping Design
local map = vim.keymap.set
vim.g.mapleader = " "
vim.g.maplocalleader = " "
map("n", "<C-h>", "<C-w>h", { desc = "Go to left window" })
map("n", "<C-j>", "<C-w>j", { desc = "Go to lower window" })
map("n", "<C-k>", "<C-w>k", { desc = "Go to upper window" })
map("n", "<C-l>", "<C-w>l", { desc = "Go to right window" })LSP Configuration
return {
{
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"mason.nvim",
"mason-lspconfig.nvim",
},
config = function()
vim.diagnostic.config({
virtual_text = { spacing = 4, prefix = "●" },
signs = true,
underline = true,
})
end,
},
}Essential Plugin Specs
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
event = { "BufReadPost", "BufNewFile" },
opts = {
ensure_installed = {
"lua", "vim", "vimdoc", "query",
"typescript", "javascript", "tsx",
"python", "rust", "go",
"json", "yaml", "toml", "markdown",
"bash", "html", "css",
},
highlight = { enable = true },
indent = { enable = true },
},
}Vim Configuration
Minimal .vimrc
set nocompatible
filetype plugin indent on
syntax enable
set number relativenumber
set cursorline
set signcolumn=yes
set scrolloff=8
set nowrap
set termguicolors
set tabstop=2 shiftwidth=2 expandtabvim-plug Setup
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin()
Plug 'catppuccin/vim', { 'as': 'catppuccin' }
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
call plug#end()Keymap Design Principles
- Use mnemonic prefixes such as
<leader>f,<leader>g, and<leader>l. - Keep the same key for the same action across plugins when possible.
- Prefer discoverability over density; use
which-keyor equivalent when available. - Check for conflicts before rebinding defaults.
- Put advanced actions behind leader prefixes rather than overriding core motions.
Common Leader Namespace
| Prefix | Domain | Examples |
|---|---|---|
<leader>f |
Find / files | ff, fg, fb |
<leader>g |
Git | gs, gb, gd |
<leader>l |
LSP | lr, la, ld |
<leader>b |
Buffer | bd, bp, bn |
<leader>w |
Window | wv, ws, wq |
<leader>t |
Toggle | tt, te, tz |
Minimal vs Full Configuration
| Aspect | Minimal | Standard | Full |
|---|---|---|---|
| Plugin count | 0-5 |
10-20 |
30-50+ |
| LSP | None | Primary language | Multi-language |
| Completion | Built-in | nvim-cmp or blink.cmp |
Completion plus AI |
| File finder | Built-in | telescope |
telescope + extensions |
| Startup time | <50ms |
<100ms |
<200ms |
| Use case | Quick edits | Daily driver | IDE replacement |
Neovim 0.10 Plus Features
Native Snippets (vim.snippet)
vim.snippet.expand("function ${1:name}(${2:params})\n\t${0}\nend")
vim.keymap.set({ "i", "s" }, "<Tab>", function()
if vim.snippet.active({ direction = 1 }) then
return "<cmd>lua vim.snippet.jump(1)<cr>"
end
return "<Tab>"
end, { expr = true })OSC 52 Clipboard
vim.opt.clipboard = "unnamedplus"This works over SSH and tmux on modern terminals without extra clipboard plugins.
Built-in Comment Toggling
gc{motion} toggle comment
gcc toggle current line
gc toggle selected linesNeovim 0.10+ can replace dedicated comment plugins for many setups.
Neovim 0.12 Features
Neovim 0.12.0 (released March 29, 2026) is a major release. Key changes:
Performance: LuaJIT 2.1
Ships LuaJIT 2.1, delivering 15-20% speed boost for Lua plugins and reduced memory overhead. No configuration changes needed — all existing Lua code benefits automatically.
vim.pack (Builtin Plugin Manager)
-- Install a plugin from GitHub
vim.pack.add("tpope/vim-sleuth")
-- With options
vim.pack.add({
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
})Stable for daily use but ecosystem adoption is still growing — some plugins may not yet provide vim.pack metadata. For advanced setups with many plugins, lazy.nvim remains recommended.
Native Auto-Completion
-- Enable native insert-mode auto-completion
vim.opt.autocomplete = "menu,menuone,noselect"Triggers completion suggestions in insert mode without a manual keypress. For complex multi-source completion, blink.cmp or nvim-cmp still offer more control.
Expanded Native LSP
New capabilities added to the builtin LSP client:
inlineCompletion,selectionRange,linkedEditingRangedocumentLink, document colors, code lens refresh- Workspace diagnostics, dynamic registration
:lspcommand for LSP status inspection
New Commands and APIs
| Feature | Usage |
|---|---|
:Undotree |
Builtin undo tree visualization (replaces undotree plugin for basic use) |
:Diff |
Builtin diff view |
:restart |
Restart Neovim core while keeping UI attached |
:connect |
Connect UI to a running Neovim instance |
vim.net.request() |
HTTP requests from Lua without external dependencies |
vim.fs.ext() |
Extract file extension |
vim.list.unique() |
Deduplicate lists |
Migration Checklist (0.10 → 0.12)
- No breaking changes for most configs — upgrade is safe
- Consider replacing dedicated comment/undo plugins with builtins
- Evaluate whether
vim.packsuits your plugin count and complexity - Test the
autocompleteoption as a lightweight completion alternative - Verify existing LSP configs work with expanded native capabilities
blink.cmp
Comparison with nvim-cmp
| Aspect | nvim-cmp |
blink.cmp |
|---|---|---|
| Architecture | Lua-based | Rust core |
| Performance | Good | Faster under many-source loads |
| Configuration | More verbose | Simpler |
| Snippet support | External | Built-in vim.snippet integration |
| Recommendation | Existing setups | New setups |
Basic blink.cmp Configuration
return {
"saghen/blink.cmp",
version = "*",
event = "InsertEnter",
dependencies = {
"rafamadriz/friendly-snippets",
},
opts = {
keymap = {
preset = "default",
["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
["<C-e>"] = { "cancel", "fallback" },
["<CR>"] = { "accept", "fallback" },
["<Tab>"] = { "snippet_forward", "select_next", "fallback" },
},
},
}Choose blink.cmp for new setups. Keep nvim-cmp when the existing setup depends on sources not yet replaced.
Zed Configuration
Zed is supported as a lightweight alternative. Hone still treats Neovim as the primary recommendation for power users.
settings.json
{
"theme": {
"mode": "dark",
"dark": "Catppuccin Mocha",
"light": "Catppuccin Latte"
},
"buffer_font_family": "JetBrains Mono",
"buffer_font_size": 14,
"ui_font_size": 14
}keymap.json
[
{
"context": "Editor && VimNormal",
"bindings": {
"space f f": "file_finder::Toggle",
"space f g": "search::SelectAllMatches",
"space e": "workspace::ToggleLeftDock"
}
}
]Built-in LSP
{
"lsp": {
"rust-analyzer": {
"initialization_options": {
"check": { "command": "clippy" }
}
}
}
}Supported Tools Detail (SKILL.md excerpt)
| Category | Detail |
|---|---|
| Terminal | ghostty 1.3+, alacritty, kitty, wezterm |
| Editor | neovim 0.12+, vim, Zed |