My Neovim configuration, packaged as a single lazy.nvim plugin. Enabling it installs every plugin, keymap, option and command I use; lazy.nvim is the only prerequisite.
-- ~/.config/nvim/init.lua
-- Must be set before lazy.setup: plugin specs declare `keys = { "<leader>…" }`,
-- and those are resolved against whatever mapleader is at that moment.
vim.g.mapleader = " "
vim.g.maplocalleader = " "
-- Optional. Anything read inside a plugin spec (paths, extras, model names)
-- has to be set here, before lazy.setup — see "Configuration" below.
vim.g.jharmon = {}
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local out = vim.fn.system({
"git", "clone", "--filter=blob:none", "--branch=stable",
"https://github.com/folke/lazy.nvim.git", lazypath,
})
if vim.v.shell_error ~= 0 then
error("Error cloning lazy.nvim:\n" .. out)
end
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
{
"johnharmon/nvim-config",
import = "jharmon.plugins", -- pulls in every plugin spec
main = "jharmon", -- so lazy calls require("jharmon").setup()
opts = {},
lazy = false,
priority = 10000, -- core options/keymaps before other plugins
},
},
install = { colorscheme = { "tokyonight-night" } },
ui = {
icons = vim.g.have_nerd_font and {} or {
cmd = "⌘", config = "🛠", event = "📅", ft = "📂", init = "⚙",
keys = "🗝", plugin = "🔌", runtime = "💻", require = "🌙",
source = "📄", start = "🚀", task = "📌", lazy = "💤 ",
},
},
})Run :checkhealth jharmon afterwards to see which external binaries are
missing.
Set vim.g.jharmon before require("lazy").setup(...). It is deep-merged
over the defaults in lua/jharmon/config.lua. opts on the spec is merged too,
but only reaches the core.* modules — lazy imports the spec files long before
it calls setup(), so anything a spec reads must come from vim.g.jharmon.
| Key | Default | What it does |
|---|---|---|
silence_deprecations |
true |
Stubs out vim.deprecate |
colorscheme |
"tokyonight-night" |
Applied after the theme's setup() |
nerd_font |
false |
Sets vim.g.have_nerd_font; drives icons in which-key, mini.statusline, lazy |
shell |
/opt/homebrew/bin/fish |
Only applied when the binary exists |
undodir |
~/.vim/undodir |
|
completion |
"both" |
"both" | "blink" | "cmp" |
claude_cmd |
~/.local/bin/claude |
terminal_cmd for claudecode.nvim |
terraform_path |
/usr/local/bin/terraform |
Passed to terraform-ls |
acm_ls.dir |
~/git-projects/nvim-acm |
Local LSP checkout; the spec is skipped when absent |
acm_ls.cmd |
<dir>/lsp-server/acm-ls |
|
working.root |
$WORKING_ROOT, then ~/git/autoshiftv2 |
Parent of the .working symlink dir |
codecompanion.url / .proxy / .model |
LAN ollama | |
extras.floaterm / .working / .kubectl_kinds / .kubectl_secrets |
true |
Standalone feature modules |
kubectl_secrets.auto |
true |
Decode a Secret's data: block as soon as the YAML view loads |
kubectl_secrets.key |
"gb" |
Buffer-local toggle between decoded and raw |
kubectl_secrets.notify |
true |
Report values left encoded because they are binary |
treesitter |
28 parsers | Kept installed and updated |
lua/jharmon/
├── init.lua setup(opts)
├── config.lua defaults + vim.g.jharmon merge
├── health.lua :checkhealth jharmon
├── core/ options, clipboard, lsp, ui, autocmds, commands, keymaps
├── util/window.lua oil sidebar + smart split resizing
├── extras/ floaterm, working, kubectl_kinds
└── plugins/ one file per group; the `import` target
core/ is loaded in a fixed order by core/init.lua. Global keymaps live in
core/keymaps.lua; plugin-specific ones stay in each spec's keys = {} so they
keep lazy-loading their plugin.
Leader is <Space>.
| Key | Action |
|---|---|
<leader>e |
Focus or open the oil sidebar (30 cols, far left) |
<leader>E |
Force a fresh oil sidebar |
<leader>pv |
Netrw in the current window |
<C-h/j/k/l> |
Move focus left/down/up/right |
<C-left> / <C-right> |
Move the vertical split left/right |
t / T |
Next tab |
| Key | Action |
|---|---|
jk (insert) |
<Esc> |
- / _ |
Move line (normal) or selection (visual) down/up |
J / K (visual) |
Move selection down/up |
J |
Join without moving the cursor |
dw / dl |
Delete word under cursor / line contents |
c" c' c{ c( c[ |
Change inside the pair |
<leader>" / <leader>' |
Quote the word under the cursor |
<leader>s |
:%s/word//gI seeded with the word under the cursor |
<leader>y / <leader>Y |
Yank to system clipboard |
<leader>d (visual) |
Delete into the void register |
<leader>p (visual) |
Paste over selection, keeping the register |
<C-p> (insert) |
Paste and stay in insert |
| Key | Action |
|---|---|
<C-u> <C-d> <C-]> n N |
Same, then recentre |
<S-j> |
Page down |
<S-k> |
Hover documentation |
<leader>P |
Toggle page mode (j/k become PageDown/PageUp) |
| Key | Action |
|---|---|
<Esc> |
Clear search highlight |
<leader>d |
Diagnostic float |
<leader>q |
Diagnostics to the location list |
<leader>ic |
Toggle ignorecase |
<leader>f |
Format buffer (conform) |
<leader>sh help · sk keymaps · sf files · ss builtins · sw word ·
sg grep · sd diagnostics · sr resume · s. recent · s/ grep open files ·
sn nvim config · <leader><leader> buffers · <leader>/ fuzzy in buffer
gd definition · gr references · gI implementation · gD declaration ·
<leader>D type definition · <leader>ds document symbols ·
<leader>ws workspace symbols · <leader>rn rename · <leader>ca code action ·
<leader>th toggle inlay hints
<leader>ac toggle · af focus · ar resume · aC continue · am model ·
ab add buffer · as send selection / add file · aa accept diff · ad deny diff ·
<leader>ch CodeCompanion chat · <leader>cca CodeCompanion actions
gy on a Secret opens the YAML view and the data: block is decoded
automatically. gb toggles back to the raw base64, gr re-fetches,
:KubectlSecretsDecode toggles from anywhere. gd (describe) is not useful for
Secrets — kubectl describe only prints byte counts, never values.
Only the top-level data: block is touched, and only when a value is valid
base64 and decodes to text, so annotations are never mangled and binary
payloads (keystores, .gz, docker config blobs) stay encoded. Multi-line values
become YAML literal blocks. kubectl.nvim's own <CR> one-line decoder still
works alongside this.
<leader>ha add · hq menu · hh prev · hl next ·
<leader>k kubectl · <C-r> or :KubectlKinds kind picker ·
<leader>tc terraform console · <leader>sl / sv / sc iron send ·
<leader>cp colour picker · <leader>cc convert colour
<C-c> <C-x> <C-z> <C-a> <C-s> open terminals 0–4;
<leader>ot / <leader>tt / <leader>fd and :Floaterminal [n] open terminal 0.
Toggling a visible one hides all of them.
:Wa <path> add · :Wr <name> remove · :Ww wipe · :Wl pick and cd ·
:Wg <name> cd · :Wn next. Same on <leader>wa/wr/ww/wl/wg/wn.
:SessionStart <path> writes a session there on exit. After nvim -S foo.vim
it re-arms itself against foo.vim automatically.
These were bugs or duplicates, not preferences:
- Floaterminal.
<leader>ot,<leader>tt,<leader>fdand:Floaterminalpassed a non-number slot (nil from the keymap, an options table from the command) and errored onwindows[nil]. They default to terminal 0 now. - acm-ls.
dirpointed at/Users/jharmon/...whilecmdpointed at/Users/johnharmon/.... Both come from one config key, and the spec is skipped when the checkout is absent. - mini.nvim was declared twice, as
nvim-mini/mini.nvimandechasnovski/mini.nvim— the same repo before and after its org move. Collapsed tonvim-mini. - claudecode.nvim was declared twice, the second copy nested inside the
snacks.nvimspec table with a conflictingwinhlvalue. Collapsed to one. - Dead quickfix maps dropped.
<C-j>/<C-k>were bound tocprev/cnext(with<CD>, itself a typo for<CR>) and then overwritten ~300 lines later by kickstart's window-focus maps.<<leader>j/<<leader>khad a stray extra<. None of them ever fired. lua_lsis now actually started. Theserverstable and itscapabilitieswere built but themason-lspconfighandler that consumed them was commented out, so nothing used either. It goes throughvim.lsp.config/enablenow.client.supports_methodis guarded. It becameclient:supports_methodin 0.12 and the old call errored on attach.nvim-web-deviconsno longer carries a contradictoryenabled = vim.g.have_nerd_fonton the telescope dependency while being installed unconditionally at top level.watch_for_changesremoved from the snacks opts — it is an oil option that had leaked into the wrong table. Oil still sets it.- Colorschemes are lazy. All 14 non-active themes had an
initthat force-loaded them at startup; they useoptsnow and load on:colorscheme. foldlevelstartis not set incore/options.lua. nvim-origami'sinitsets it to 99 and ran after the old top-of-file= 0; setting it in core would now run later than origami and re-fold every buffer.
Behaviour that looked odd but was kept as-is: <leader>s is both a standalone
substitute mapping and the Telescope prefix (so it waits for timeoutlen), and
<C-f> runs tmux ne tmux-sessionizer.