Compare commits
8 Commits
7f529c4270
...
astronvim
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41321a8818 | ||
|
|
4d7c7b7c9e | ||
|
|
a2d266132c | ||
|
|
9bb11a28e4 | ||
|
|
2f4095512a | ||
| 34ea1ee888 | |||
| 45458b78c1 | |||
| 50dc0c9f93 |
65
clean.sh
Executable file
65
clean.sh
Executable file
@@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SRC_DIRS=(
|
||||
"$HOME/.local/share/nvim"
|
||||
"$HOME/.local/state/nvim"
|
||||
"$HOME/.cache/nvim"
|
||||
)
|
||||
|
||||
# Ask if user wants to backup
|
||||
printf "Do you want to backup before cleaning? [Y/n]: "
|
||||
read -r BACKUP_CHOICE
|
||||
case ${BACKUP_CHOICE:-} in
|
||||
[nN]|[nN][oO])
|
||||
BACKUP=false
|
||||
;;
|
||||
*)
|
||||
BACKUP=true
|
||||
TAG=.bak-$(date +%Y-%m-%d_%H-%M-%S)
|
||||
;;
|
||||
esac
|
||||
|
||||
# Show plan and confirm
|
||||
printf "\n"
|
||||
if [ "$BACKUP" = true ]; then
|
||||
printf "This will back up and clean your Neovim directories.\n"
|
||||
printf "Backup suffix to be appended: %s\n\n" "$TAG"
|
||||
printf "Plan:\n"
|
||||
for SRC in "${SRC_DIRS[@]}"; do
|
||||
if [ -e "$SRC" ]; then
|
||||
DEST="${SRC}${TAG}"
|
||||
printf " %s ➡️ %s\n" "$SRC" "$DEST"
|
||||
fi
|
||||
done
|
||||
else
|
||||
printf "This will remove your Neovim directories WITHOUT backup.\n\n"
|
||||
printf "Plan:\n"
|
||||
for SRC in "${SRC_DIRS[@]}"; do
|
||||
if [ -e "$SRC" ]; then
|
||||
printf " %s ❌\n" "$SRC"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
printf "\n"
|
||||
read -r -p "Are you sure you want to proceed? [y/N]: " CONFIRM
|
||||
case ${CONFIRM:-} in
|
||||
[yY]|[yY][eE][sS]) ;;
|
||||
*) printf "Aborted!\n"; exit 0;;
|
||||
esac
|
||||
|
||||
# Perform action based on backup choice
|
||||
for SRC in "${SRC_DIRS[@]}"; do
|
||||
if [ -e "$SRC" ]; then
|
||||
if [ "$BACKUP" = true ]; then
|
||||
DEST="${SRC}${TAG}"
|
||||
mv "$SRC" "$DEST"
|
||||
else
|
||||
rm -rf "$SRC"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
printf "Done!"
|
||||
@@ -6,6 +6,13 @@
|
||||
return {
|
||||
'AstroNvim/astrocommunity',
|
||||
|
||||
{ import = 'astrocommunity.pack.lua' },
|
||||
{ import = 'astrocommunity.colorscheme.tokyonight-nvim' },
|
||||
|
||||
{ import = 'astrocommunity.editing-support.conform-nvim' },
|
||||
{ import = 'astrocommunity.git.diffview-nvim' },
|
||||
|
||||
{ import = 'astrocommunity.pack.go' },
|
||||
{ import = 'astrocommunity.pack.lua' },
|
||||
|
||||
{ import = 'astrocommunity.test.neotest' },
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
"AstroNvim/astrocore",
|
||||
'AstroNvim/astrocore',
|
||||
---@type AstroCoreOpts
|
||||
opts = {
|
||||
-- Configure core features of AstroNvim
|
||||
@@ -26,13 +26,13 @@ return {
|
||||
filetypes = {
|
||||
-- see `:h vim.filetype.add` for usage
|
||||
extension = {
|
||||
foo = "fooscript",
|
||||
foo = 'fooscript',
|
||||
},
|
||||
filename = {
|
||||
[".foorc"] = "fooscript",
|
||||
['.foorc'] = 'fooscript',
|
||||
},
|
||||
pattern = {
|
||||
[".*/etc/foo/.*"] = "fooscript",
|
||||
['.*/etc/foo/.*'] = 'fooscript',
|
||||
},
|
||||
},
|
||||
-- vim options can be configured here
|
||||
@@ -41,7 +41,7 @@ return {
|
||||
relativenumber = true, -- sets vim.opt.relativenumber
|
||||
number = true, -- sets vim.opt.number
|
||||
spell = false, -- sets vim.opt.spell
|
||||
signcolumn = "yes", -- sets vim.opt.signcolumn to yes
|
||||
signcolumn = 'yes', -- sets vim.opt.signcolumn to yes
|
||||
wrap = false, -- sets vim.opt.wrap
|
||||
},
|
||||
g = { -- vim.g.<key>
|
||||
@@ -58,17 +58,94 @@ return {
|
||||
-- second key is the lefthand side of the map
|
||||
|
||||
-- navigate buffer tabs
|
||||
["]b"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
|
||||
["[b"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" },
|
||||
[']b'] = {
|
||||
function()
|
||||
require('astrocore.buffer').nav(vim.v.count1)
|
||||
end,
|
||||
desc = 'Next buffer',
|
||||
},
|
||||
['[b'] = {
|
||||
function()
|
||||
require('astrocore.buffer').nav(-vim.v.count1)
|
||||
end,
|
||||
desc = 'Previous buffer',
|
||||
},
|
||||
|
||||
-- mappings seen under group name "Buffer"
|
||||
["<Leader>bd"] = {
|
||||
['<Leader>bd'] = {
|
||||
function()
|
||||
require("astroui.status.heirline").buffer_picker(
|
||||
function(bufnr) require("astrocore.buffer").close(bufnr) end
|
||||
)
|
||||
require('astroui.status.heirline').buffer_picker(function(bufnr)
|
||||
require('astrocore.buffer').close(bufnr)
|
||||
end)
|
||||
end,
|
||||
desc = "Close buffer from tabline",
|
||||
desc = 'Close buffer from tabline',
|
||||
},
|
||||
|
||||
['<Leader>xq'] = {
|
||||
function()
|
||||
local win_id
|
||||
for _, win in ipairs(vim.fn.getwininfo()) do
|
||||
if win.quickfix == 1 then
|
||||
win_id = win.winid
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if win_id then
|
||||
if vim.api.nvim_get_current_win() ~= win_id then
|
||||
vim.api.nvim_set_current_win(win_id)
|
||||
else
|
||||
vim.cmd.cclose()
|
||||
end
|
||||
else
|
||||
vim.cmd.copen()
|
||||
end
|
||||
end,
|
||||
desc = 'Toggle Quickfix list',
|
||||
},
|
||||
|
||||
['<Leader>xl'] = {
|
||||
function()
|
||||
local win_id
|
||||
for _, win in ipairs(vim.fn.getwininfo()) do
|
||||
if win.loclist == 1 then
|
||||
win_id = win.winid
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if win_id then
|
||||
if vim.api.nvim_get_current_win() ~= win_id then
|
||||
vim.api.nvim_set_current_win(win_id)
|
||||
else
|
||||
vim.cmd.lclose()
|
||||
end
|
||||
else
|
||||
vim.cmd.lopen()
|
||||
end
|
||||
end,
|
||||
desc = 'Toggle Local list',
|
||||
},
|
||||
|
||||
['<Leader>tr'] = {
|
||||
function()
|
||||
require('neotest').run.run()
|
||||
end,
|
||||
desc = 'Test: run nearest test',
|
||||
},
|
||||
|
||||
['<Leader>td'] = {
|
||||
function()
|
||||
require('neotest').run.run { strategy = 'dap' }
|
||||
end,
|
||||
desc = 'Test: debug nearest test',
|
||||
},
|
||||
|
||||
['<Leader>ta'] = {
|
||||
function()
|
||||
require('neotest').run.run(vim.fn.expand '%')
|
||||
end,
|
||||
desc = 'Test: run all test in file',
|
||||
},
|
||||
|
||||
-- tables with just a `desc` key will be registered with which-key if it's installed
|
||||
@@ -78,6 +155,11 @@ return {
|
||||
-- setting a mapping to false will disable it
|
||||
-- ["<C-S>"] = false,
|
||||
},
|
||||
|
||||
v = {
|
||||
['J'] = ":m '>+1<CR>gv=gv",
|
||||
['K'] = ":m '<-2<CR>gv=gv",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
"AstroNvim/astrolsp",
|
||||
'AstroNvim/astrolsp',
|
||||
---@type AstroLSPOpts
|
||||
opts = {
|
||||
-- Configuration table of features provided by AstroLSP
|
||||
@@ -61,16 +61,18 @@ return {
|
||||
-- can either be a string of a client capability or a function of `fun(client, bufnr): boolean`
|
||||
-- condition will be resolved for each client on each execution and if it ever fails for all clients,
|
||||
-- the auto commands will be deleted for that buffer
|
||||
cond = "textDocument/codeLens",
|
||||
cond = 'textDocument/codeLens',
|
||||
-- cond = function(client, bufnr) return client.name == "lua_ls" end,
|
||||
-- list of auto commands to set
|
||||
{
|
||||
-- events to trigger
|
||||
event = { "InsertLeave", "BufEnter" },
|
||||
event = { 'InsertLeave', 'BufEnter' },
|
||||
-- the rest of the autocmd options (:h nvim_create_autocmd)
|
||||
desc = "Refresh codelens (buffer)",
|
||||
desc = 'Refresh codelens (buffer)',
|
||||
callback = function(args)
|
||||
if require("astrolsp").config.features.codelens then vim.lsp.codelens.refresh { bufnr = args.buf } end
|
||||
if require('astrolsp').config.features.codelens then
|
||||
vim.lsp.codelens.refresh { bufnr = args.buf }
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
@@ -80,19 +82,24 @@ return {
|
||||
n = {
|
||||
-- a `cond` key can provided as the string of a server capability to be required to attach, or a function with `client` and `bufnr` parameters from the `on_attach` that returns a boolean
|
||||
gD = {
|
||||
function() vim.lsp.buf.declaration() end,
|
||||
desc = "Declaration of current symbol",
|
||||
cond = "textDocument/declaration",
|
||||
function()
|
||||
vim.lsp.buf.declaration()
|
||||
end,
|
||||
desc = 'Declaration of current symbol',
|
||||
cond = 'textDocument/declaration',
|
||||
},
|
||||
["<Leader>uY"] = {
|
||||
function() require("astrolsp.toggles").buffer_semantic_tokens() end,
|
||||
desc = "Toggle LSP semantic highlight (buffer)",
|
||||
['<Leader>uY'] = {
|
||||
function()
|
||||
require('astrolsp.toggles').buffer_semantic_tokens()
|
||||
end,
|
||||
desc = 'Toggle LSP semantic highlight (buffer)',
|
||||
cond = function(client)
|
||||
return client.supports_method "textDocument/semanticTokens/full" and vim.lsp.semantic_tokens ~= nil
|
||||
return client.supports_method 'textDocument/semanticTokens/full' and vim.lsp.semantic_tokens ~= nil
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- A custom `on_attach` function to be run after the default `on_attach` function
|
||||
-- takes two parameters `client` and `bufnr` (`:h lspconfig-setup`)
|
||||
on_attach = function(client, bufnr)
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
-- AstroUI provides the basis for configuring the AstroNvim User Interface
|
||||
-- Configuration documentation can be found with `:h astroui`
|
||||
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
|
||||
-- as this provides autocomplete and documentation while editing
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
"AstroNvim/astroui",
|
||||
'AstroNvim/astroui',
|
||||
---@type AstroUIOpts
|
||||
opts = {
|
||||
-- change colorscheme
|
||||
colorscheme = "astrodark",
|
||||
colorscheme = 'tokyonight-moon',
|
||||
-- AstroUI allows you to easily modify highlight groups easily for any and all colorschemes
|
||||
highlights = {
|
||||
init = { -- this table overrides highlights in all themes
|
||||
@@ -19,19 +16,20 @@ return {
|
||||
-- Normal = { bg = "#000000" },
|
||||
},
|
||||
},
|
||||
folding = false,
|
||||
-- Icons can be configured throughout the interface
|
||||
icons = {
|
||||
-- configure the loading of the lsp in the status line
|
||||
LSPLoading1 = "⠋",
|
||||
LSPLoading2 = "⠙",
|
||||
LSPLoading3 = "⠹",
|
||||
LSPLoading4 = "⠸",
|
||||
LSPLoading5 = "⠼",
|
||||
LSPLoading6 = "⠴",
|
||||
LSPLoading7 = "⠦",
|
||||
LSPLoading8 = "⠧",
|
||||
LSPLoading9 = "⠇",
|
||||
LSPLoading10 = "⠏",
|
||||
LSPLoading1 = '⠋',
|
||||
LSPLoading2 = '⠙',
|
||||
LSPLoading3 = '⠹',
|
||||
LSPLoading4 = '⠸',
|
||||
LSPLoading5 = '⠼',
|
||||
LSPLoading6 = '⠴',
|
||||
LSPLoading7 = '⠦',
|
||||
LSPLoading8 = '⠧',
|
||||
LSPLoading9 = '⠇',
|
||||
LSPLoading10 = '⠏',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
9
lua/plugins/claude-code.lua
Normal file
9
lua/plugins/claude-code.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
'greggh/claude-code.nvim',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
},
|
||||
config = function()
|
||||
require('claude-code').setup()
|
||||
end,
|
||||
}
|
||||
@@ -7,6 +7,10 @@ return {
|
||||
opts = {
|
||||
-- Make sure to use the names found in `:Mason`
|
||||
ensure_installed = {
|
||||
'jq',
|
||||
'vacuum', -- openapi
|
||||
'bash-language-server',
|
||||
|
||||
-- install any other package
|
||||
'tree-sitter-cli',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user