From f9b4a07158b9260875440697a5d967edc33ca7c5 Mon Sep 17 00:00:00 2001 From: "Paul B. Kim" Date: Sun, 5 Apr 2026 15:12:18 +0900 Subject: [PATCH] add claude base --- .claude/settings.json | 5 ++++ .claude/settings.local.json | 8 ++++++ .githooks/post-commit | 8 ++++++ .gitignore | 2 +- AGENTS.md | 48 ----------------------------------- init.lua | 50 +++++++++++++++++++++++++++---------- 6 files changed, 59 insertions(+), 62 deletions(-) create mode 100644 .claude/settings.json create mode 100644 .claude/settings.local.json create mode 100755 .githooks/post-commit delete mode 100644 AGENTS.md diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 00000000..be47d4a5 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,5 @@ +{ + "enabledPlugins": { + "lua-lsp@claude-plugins-official": true + } +} diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 00000000..a8c9ff87 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,8 @@ +{ + "permissions": { + "allow": [ + "Bash(wc:*)", + "Bash(git:*)" + ] + } +} diff --git a/.githooks/post-commit b/.githooks/post-commit new file mode 100755 index 00000000..fb8fa665 --- /dev/null +++ b/.githooks/post-commit @@ -0,0 +1,8 @@ +#!/bin/sh +echo "→ Pushing to remote..." +if git push; then + echo "✓ Push successful." +else + echo "✗ Push failed. Run 'git push' manually to retry." >&2 + exit 1 +fi diff --git a/.gitignore b/.gitignore index e4b33290..e00a4f59 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ nvim spell/ lazy-lock.json -.serena/ +.local diff --git a/AGENTS.md b/AGENTS.md deleted file mode 100644 index f329f55b..00000000 --- a/AGENTS.md +++ /dev/null @@ -1,48 +0,0 @@ -# Repository Guidelines - -## Project Structure & Module Organization -- Root entrypoint: `init.lua` (Kickstart-based primary config). -- Custom Lua modules live under `lua/custom/`. -- Plugin specs are split into `lua/custom/plugins/*.lua` (one concern per file, e.g. `gitsigns.lua`, `lint.lua`, `persistence.lua`). -- Utility modules (non-plugin config) live in `lua/custom/*.lua` (for example `wrapping.lua`). -- Reference docs live in `README.md` and `doc/kickstart.txt`. -- Plugin versions are pinned in `lazy-lock.json`. - -## Build, Test, and Development Commands -- `nvim` - Starts Neovim and triggers lazy.nvim plugin loading/install. -- `nvim --headless "+qa"` - Fast startup sanity check (useful in CI-style validation). -- `nvim --headless "+checkhealth" "+qa"` - Runs health checks for Neovim, plugins, and external tools. -- `nvim --headless "+Lazy! sync" "+qa"` - Syncs plugin set to current specs. -- `luac -p init.lua lua/custom/**/*.lua` - Lua syntax validation for config files. - -## Coding Style & Naming Conventions -- Language: Lua (Neovim API style). -- Formatting: `stylua` using `.stylua.toml` settings (2-space indentation, no tabs). -- Prefer small, focused plugin spec files named by feature (`neo-tree.lua`, `markdown.lua`). -- Use descriptive keymap `desc` fields and group prefixes via which-key. -- Keep comments concise and practical; avoid repeating obvious code behavior. - -## Testing Guidelines -- No formal unit-test framework is configured in this repo. -- Required checks before PR: - - Lua parse check (`luac -p ...`) - - Headless startup (`nvim --headless "+qa"`) - - Health check (`:checkhealth`) for affected tooling (LSP, formatters, linters). -- For plugin/config changes, include manual verification steps in PR notes (keymaps, commands, expected behavior). - -## Commit & Pull Request Guidelines -- Follow existing history style: Conventional Commit-like prefixes such as: - - `feat(scope): ...` - - `fix(scope): ...` - - `chore: ...` -- Keep commits scoped to one logical change (plugin, keymap group, diagnostics, etc.). -- PRs should include: - - Summary of behavior changes - - Files touched (e.g. `init.lua`, `lua/custom/plugins/...`) - - Validation performed (commands run) - - Screenshots/GIFs only when UI behavior is materially changed. diff --git a/init.lua b/init.lua index 386a8540..50141677 100644 --- a/init.lua +++ b/init.lua @@ -84,6 +84,9 @@ I hope you enjoy your Neovim journey, P.S. You can delete this when you're done too. It's your config now! :) --]] +-- Prepend mise shims to PATH so Mason/LSP can find node, go, etc. +vim.env.PATH = vim.env.HOME .. '/.local/share/mise/shims:' .. vim.env.PATH + -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) @@ -184,6 +187,26 @@ vim.keymap.set('n', ']d', function() vim.diagnostic.jump { count = 1, float = true } end, { desc = 'Go to next [D]iagnostic' }) vim.keymap.set('n', 'de', vim.diagnostic.open_float, { desc = 'Show [D]iagnostic [E]rror details' }) +vim.keymap.set('n', 'dy', function() + local line = vim.api.nvim_win_get_cursor(0)[1] + local diagnostics = vim.diagnostic.get(0, { lnum = line - 1 }) + if #diagnostics == 0 then + vim.notify('No diagnostics on this line', vim.log.levels.INFO) + return + end + local file_path = vim.api.nvim_buf_get_name(0) + local root = vim.fs.root(file_path, { '.git' }) or vim.fn.getcwd() + local prefix = root:match '/$' and root or (root .. '/') + local rel = file_path:sub(1, #prefix) == prefix and file_path:sub(#prefix + 1) or file_path + local parts = {} + for _, d in ipairs(diagnostics) do + table.insert(parts, string.format('@%s:%d: %s', rel, d.lnum + 1, d.message)) + end + local result = table.concat(parts, '\n') + vim.fn.setreg('"', result) + pcall(vim.fn.setreg, '+', result) + vim.notify('Yanked ' .. #diagnostics .. ' diagnostic(s)', vim.log.levels.INFO) +end, { desc = '[D]iagnostic [Y]ank to clipboard' }) -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier -- for people to discover. Otherwise, you normally need to press , which @@ -1104,19 +1127,20 @@ require('lazy').setup({ -- [[ Configure Treesitter ]] See `:help nvim-treesitter` config = function() local treesitter = require 'nvim-treesitter' - treesitter.setup() - require('nvim-treesitter.install').ensure_installed { - 'bash', - 'c', - 'diff', - 'html', - 'lua', - 'luadoc', - 'markdown', - 'markdown_inline', - 'query', - 'vim', - 'vimdoc', + treesitter.setup { + ensure_installed = { + 'bash', + 'c', + 'diff', + 'html', + 'lua', + 'luadoc', + 'markdown', + 'markdown_inline', + 'query', + 'vim', + 'vimdoc', + }, } vim.api.nvim_create_autocmd('FileType', {