add claude base
This commit is contained in:
parent
448f3de389
commit
f9b4a07158
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"enabledPlugins": {
|
||||
"lua-lsp@claude-plugins-official": true
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(wc:*)",
|
||||
"Bash(git:*)"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
@ -5,4 +5,4 @@ nvim
|
|||
|
||||
spell/
|
||||
lazy-lock.json
|
||||
.serena/
|
||||
.local
|
||||
|
|
|
|||
48
AGENTS.md
48
AGENTS.md
|
|
@ -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.
|
||||
50
init.lua
50
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 <space> 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', '<leader>de', vim.diagnostic.open_float, { desc = 'Show [D]iagnostic [E]rror details' })
|
||||
vim.keymap.set('n', '<leader>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 <C-\><C-n>, 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', {
|
||||
|
|
|
|||
Loading…
Reference in New Issue