Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Overview

Kickstart-based Neovim config using lazy.nvim as the plugin manager. Single `init.lua` + modular custom plugins under `lua/custom/plugins/`.

## Plugin Manager

lazy.nvim — plugins defined as lazy specs (`return { "owner/repo", ... }`).

Update plugins: `:Lazy update`
Check status: `:Lazy`
Install/manage LSP tools: `:Mason`

## Structure

```
init.lua — Sections 1–9: foundation → plugins
lua/custom/plugins/init.lua — Auto-loads all *.lua files in same dir
lua/custom/plugins/*.lua — User-added plugins (no merge conflicts from upstream)
lua/kickstart/plugins/*.lua — Optional kickstart examples (indent_line, lint, gitsigns)
lazy-lock.json — Lockfile (commit this)
```

`init.lua` is organized into `do...end` blocks by section:
1. Foundation (options, keymaps, autocmds)
2. lazy.nvim bootstrap + setup
3. UI/UX (gitsigns, which-key, mini.nvim, todo-comments)
4. Search/Navigation (Telescope)
5. LSP (mason, nvim-lspconfig, fidget)
6. Formatting (conform.nvim)
7. Autocomplete & Snippets (blink.cmp + LuaSnip)
8. Treesitter
9. Optional examples

## Custom Plugins

| File | Purpose |
|------|---------|
| `claude.lua` | claudecode.nvim — `<leader>a*` keymaps; depends on snacks.nvim |
| `lsp.lua` | dbt language server config for SQL/YAML files |
| `markdown.lua` | live-preview.nvim |
| `notebook.lua` | molten-nvim (Jupyter), image.nvim (magick_cli), wezterm.nvim |
| `oil.lua` | oil.nvim file manager via mini.icons |
| `themes.lua` | gruvbox-medium (active), tokyonight (installed) |
| `toggle-term.lua` | toggleterm.nvim terminal toggle |

## LSP

Servers are configured in `init.lua:670` via `vim.lsp.config(name, server)` + `vim.lsp.enable(name)`.
Custom dbt server lives in `lua/custom/plugins/lsp.lua` — requires `dbt-language-server` in `$PATH`.
Lua formatting disabled in `lua_ls`; formatting delegated to `stylua` via conform.nvim.

## Key Bindings (leader = `<space>`)

- `<leader>s*` — Telescope search
- `<leader>f` — format buffer (conform)
- `<leader>a*` — Claude Code integration
- `<leader>h*` — gitsigns hunk operations
- `<leader>t*` — toggles (inlay hints, blame, word diff)
- `gr*` — LSP actions (rename, code action, references, definitions)

## Adding Plugins

Drop a `.lua` file in `lua/custom/plugins/` — auto-required on next start. Use the lazy spec pattern:

```lua
return {
"owner/repo",
opts = {},
}
```

## Formatting & Linting

- **Formatter**: conform.nvim — `<leader>f` to format; auto-format on save disabled by default (opt-in per filetype in `init.lua:760`)
- **Linter**: nvim-lint — runs on `BufEnter`/`BufWritePost`/`InsertLeave`; markdownlint for markdown
- **Treesitter**: auto-installs parsers on `FileType` event
24 changes: 24 additions & 0 deletions TEST
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
1. Move the cursor to this line.

2. Press [v](v) and move the cursor to the fifth item below. Notice that the
text is highlighted.

3. Press the `:`{normal} character. At the bottom of the screen

`:'<,'>`{vim}

will appear.

4. Type

`w TEST`{vim}

where TEST is a filename that does not exist yet. Verify that you see

`:'<,'>w TEST`{vim}

before you press `<Enter>`{normal}.

5. Neovim will write the selected lines to the file TEST. Use `:!{unix:(ls),win:(dir)}`{vim} to see it.
Do not remove it yet! We will use it in the next lesson.

35 changes: 35 additions & 0 deletions config/lazy.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ 'Failed to clone lazy.nvim:\n', 'ErrorMsg' },
{ out, 'WarningMsg' },
{ '\nPress any key to exit...' },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)

-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = ' '
vim.g.maplocalleader = '\\'

-- Setup lazy.nvim
require('lazy').setup {
spec = {
-- import your plugins
{ import = 'plugins' },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { 'habamax' } },
-- automatically check for plugin updates
checker = { enabled = true },
}
Loading
Loading