add a bunch of essential plugins
This commit is contained in:
@@ -8,6 +8,11 @@ return {
|
|||||||
|
|
||||||
{ import = 'astrocommunity.colorscheme.tokyonight-nvim' },
|
{ import = 'astrocommunity.colorscheme.tokyonight-nvim' },
|
||||||
|
|
||||||
{ import = 'astrocommunity.pack.lua' },
|
{ import = 'astrocommunity.editing-support.conform-nvim' },
|
||||||
|
{ import = 'astrocommunity.git.diffview-nvim' },
|
||||||
|
|
||||||
{ import = 'astrocommunity.pack.go' },
|
{ import = 'astrocommunity.pack.go' },
|
||||||
|
{ import = 'astrocommunity.pack.lua' },
|
||||||
|
|
||||||
|
{ import = 'astrocommunity.test.neotest' },
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,27 +83,43 @@ return {
|
|||||||
|
|
||||||
['<Leader>xq'] = {
|
['<Leader>xq'] = {
|
||||||
function()
|
function()
|
||||||
local qf_open = vim.tbl_isempty(vim.tbl_filter(function(win)
|
local win_id
|
||||||
return win.quickfix == 1
|
for _, win in ipairs(vim.fn.getwininfo()) do
|
||||||
end, vim.fn.getwininfo()))
|
if win.quickfix == 1 then
|
||||||
|
win_id = win.winid
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if qf_open then
|
if win_id then
|
||||||
vim.cmd.copen()
|
if vim.api.nvim_get_current_win() ~= win_id then
|
||||||
|
vim.api.nvim_set_current_win(win_id)
|
||||||
else
|
else
|
||||||
vim.cmd.cclose()
|
vim.cmd.cclose()
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
vim.cmd.copen()
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
desc = 'Toggle Quickfix list',
|
desc = 'Toggle Quickfix list',
|
||||||
},
|
},
|
||||||
|
|
||||||
['<Leader>xl'] = {
|
['<Leader>xl'] = {
|
||||||
function()
|
function()
|
||||||
local ll_open = vim.tbl_isempty(vim.tbl_filter(function(win)
|
local win_id
|
||||||
return win.loclist == 1
|
for _, win in ipairs(vim.fn.getwininfo()) do
|
||||||
end, vim.fn.getwininfo()))
|
if win.loclist == 1 then
|
||||||
|
win_id = win.winid
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if ll_open then
|
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()
|
vim.cmd.lclose()
|
||||||
|
end
|
||||||
else
|
else
|
||||||
vim.cmd.lopen()
|
vim.cmd.lopen()
|
||||||
end
|
end
|
||||||
@@ -111,6 +127,27 @@ return {
|
|||||||
desc = 'Toggle Local list',
|
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
|
-- tables with just a `desc` key will be registered with which-key if it's installed
|
||||||
-- this is useful for naming menus
|
-- this is useful for naming menus
|
||||||
-- ["<Leader>b"] = { desc = "Buffers" },
|
-- ["<Leader>b"] = { desc = "Buffers" },
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
---@type LazySpec
|
---@type LazySpec
|
||||||
return {
|
return {
|
||||||
"AstroNvim/astrolsp",
|
'AstroNvim/astrolsp',
|
||||||
---@type AstroLSPOpts
|
---@type AstroLSPOpts
|
||||||
opts = {
|
opts = {
|
||||||
-- Configuration table of features provided by AstroLSP
|
-- 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`
|
-- 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,
|
-- 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
|
-- 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,
|
-- cond = function(client, bufnr) return client.name == "lua_ls" end,
|
||||||
-- list of auto commands to set
|
-- list of auto commands to set
|
||||||
{
|
{
|
||||||
-- events to trigger
|
-- events to trigger
|
||||||
event = { "InsertLeave", "BufEnter" },
|
event = { 'InsertLeave', 'BufEnter' },
|
||||||
-- the rest of the autocmd options (:h nvim_create_autocmd)
|
-- the rest of the autocmd options (:h nvim_create_autocmd)
|
||||||
desc = "Refresh codelens (buffer)",
|
desc = 'Refresh codelens (buffer)',
|
||||||
callback = function(args)
|
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,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -80,19 +82,24 @@ return {
|
|||||||
n = {
|
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
|
-- 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 = {
|
gD = {
|
||||||
function() vim.lsp.buf.declaration() end,
|
function()
|
||||||
desc = "Declaration of current symbol",
|
vim.lsp.buf.declaration()
|
||||||
cond = "textDocument/declaration",
|
end,
|
||||||
|
desc = 'Declaration of current symbol',
|
||||||
|
cond = 'textDocument/declaration',
|
||||||
},
|
},
|
||||||
["<Leader>uY"] = {
|
['<Leader>uY'] = {
|
||||||
function() require("astrolsp.toggles").buffer_semantic_tokens() end,
|
function()
|
||||||
desc = "Toggle LSP semantic highlight (buffer)",
|
require('astrolsp.toggles').buffer_semantic_tokens()
|
||||||
|
end,
|
||||||
|
desc = 'Toggle LSP semantic highlight (buffer)',
|
||||||
cond = function(client)
|
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,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- A custom `on_attach` function to be run after the default `on_attach` function
|
-- A custom `on_attach` function to be run after the default `on_attach` function
|
||||||
-- takes two parameters `client` and `bufnr` (`:h lspconfig-setup`)
|
-- takes two parameters `client` and `bufnr` (`:h lspconfig-setup`)
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ return {
|
|||||||
-- Normal = { bg = "#000000" },
|
-- Normal = { bg = "#000000" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
folding = false,
|
||||||
-- Icons can be configured throughout the interface
|
-- Icons can be configured throughout the interface
|
||||||
icons = {
|
icons = {
|
||||||
-- configure the loading of the lsp in the status line
|
-- configure the loading of the lsp in the status line
|
||||||
|
|||||||
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,
|
||||||
|
}
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
return {
|
|
||||||
'karb94/neoscroll.nvim',
|
|
||||||
config = function()
|
|
||||||
local neoscroll = require 'neoscroll'
|
|
||||||
neoscroll.setup {
|
|
||||||
mappings = {
|
|
||||||
'<C-u>',
|
|
||||||
'<C-d>',
|
|
||||||
'<C-b>',
|
|
||||||
'<C-f>',
|
|
||||||
'zt',
|
|
||||||
'zz',
|
|
||||||
'zb',
|
|
||||||
},
|
|
||||||
easing = 'circ',
|
|
||||||
respect_scrolloff = true,
|
|
||||||
}
|
|
||||||
|
|
||||||
local keymap = {
|
|
||||||
['<C-u>'] = function()
|
|
||||||
neoscroll.ctrl_u { duration = 200 }
|
|
||||||
end,
|
|
||||||
['<C-d>'] = function()
|
|
||||||
neoscroll.ctrl_d { duration = 200 }
|
|
||||||
end,
|
|
||||||
['<C-b>'] = function()
|
|
||||||
neoscroll.ctrl_b { duration = 300 }
|
|
||||||
end,
|
|
||||||
['<C-f>'] = function()
|
|
||||||
neoscroll.ctrl_f { duration = 300 }
|
|
||||||
end,
|
|
||||||
['zt'] = function()
|
|
||||||
neoscroll.zt { half_win_duration = 100 }
|
|
||||||
end,
|
|
||||||
['zz'] = function()
|
|
||||||
neoscroll.zz { half_win_duration = 100 }
|
|
||||||
end,
|
|
||||||
['zb'] = function()
|
|
||||||
neoscroll.zb { half_win_duration = 100 }
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
local modes = { 'n', 'v', 'x' }
|
|
||||||
for key, func in pairs(keymap) do
|
|
||||||
vim.keymap.set(modes, key, func)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user