29.05.2025
This commit is contained in:
parent
cefce84f5e
commit
ed137a15ff
28 changed files with 552 additions and 420 deletions
7
nvim/lua/plugins/blankline.lua
Normal file
7
nvim/lua/plugins/blankline.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
--@module "ibl"
|
||||
--@type ibl.config
|
||||
config = true,
|
||||
}
|
|
@ -1,158 +1,3 @@
|
|||
local default_config = {
|
||||
delve = {
|
||||
path = "dlv",
|
||||
initialize_timeout_sec = 20,
|
||||
port = "${port}",
|
||||
args = {},
|
||||
build_flags = "",
|
||||
-- Automatically handle the issue on delve Windows versions < 1.24.0
|
||||
-- where delve needs to be run in attched mode or it will fail (actually crashes).
|
||||
detached = vim.fn.has("win32") == 0,
|
||||
output_mode = "remote",
|
||||
},
|
||||
tests = {
|
||||
verbose = false,
|
||||
},
|
||||
}
|
||||
|
||||
local function setup_go_configuration(dap, configs)
|
||||
local common_debug_configs = {
|
||||
{
|
||||
type = "go",
|
||||
name = "Debug",
|
||||
request = "launch",
|
||||
program = "${workspaceFolder}",
|
||||
args = {},
|
||||
buildFlags = configs.delve.build_flags,
|
||||
outputMode = configs.delve.output_mode,
|
||||
},
|
||||
}
|
||||
|
||||
if dap.configurations.go == nil then
|
||||
dap.configurations.go = {}
|
||||
end
|
||||
|
||||
for _, config in ipairs(common_debug_configs) do
|
||||
table.insert(dap.configurations.go, config)
|
||||
end
|
||||
|
||||
if configs == nil or configs.dap_configurations == nil then
|
||||
return
|
||||
end
|
||||
|
||||
for _, config in ipairs(configs.dap_configurations) do
|
||||
if config.type == "go" then
|
||||
table.insert(dap.configurations.go, config)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
"leoluz/nvim-dap-go",
|
||||
dependencies = { "mfussenegger/nvim-dap" },
|
||||
opts = true,
|
||||
config = function()
|
||||
local dap, dapui = require("dap"), require("dapui")
|
||||
|
||||
dap.adapters.go = {
|
||||
type = "server",
|
||||
port = "${port}",
|
||||
executable = {
|
||||
command = "dlv",
|
||||
args = { "dap", "-l", "127.0.0.1:${port}" },
|
||||
},
|
||||
}
|
||||
|
||||
setup_go_configuration(dap, default_config)
|
||||
|
||||
dap.defaults.fallback.terminal_win_cmd = "enew | set filetype=dap-terminal"
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.launch.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
|
||||
vim.api.nvim_set_hl(0, "DapBreakpoint", { ctermbg = 0, fg = "#993939", bg = "#31353f" })
|
||||
vim.api.nvim_set_hl(0, "DapLogPoint", { ctermbg = 0, fg = "#61afef", bg = "#31353f" })
|
||||
vim.api.nvim_set_hl(0, "DapStopped", { ctermbg = 0, fg = "#98c379", bg = "#31353f" })
|
||||
|
||||
vim.fn.sign_define(
|
||||
"DapBreakpoint",
|
||||
{ text = "!", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"DapBreakpointCondition",
|
||||
{ text = "?", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"DapBreakpointRejected",
|
||||
{ text = "RJ", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"DapLogPoint",
|
||||
{ text = "i", texthl = "DapLogPoint", linehl = "DapLogPoint", numhl = "DapLogPoint" }
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"DapStopped",
|
||||
{ text = "→", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" }
|
||||
)
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<F5>",
|
||||
function()
|
||||
require("dap").continue()
|
||||
end,
|
||||
silent = true,
|
||||
},
|
||||
{
|
||||
"<F17>", -- S-F5
|
||||
function()
|
||||
require("dap").restart()
|
||||
end,
|
||||
silent = true,
|
||||
},
|
||||
{
|
||||
"<F29>", -- C-F5
|
||||
function()
|
||||
require("dap").terminate()
|
||||
end,
|
||||
silent = true,
|
||||
},
|
||||
{
|
||||
"<F8>",
|
||||
function()
|
||||
require("dap").step_over()
|
||||
end,
|
||||
silent = true,
|
||||
},
|
||||
{
|
||||
"<F7>",
|
||||
function()
|
||||
require("dap").step_into()
|
||||
end,
|
||||
silent = true,
|
||||
},
|
||||
{
|
||||
"<F19>", -- S-F7
|
||||
function()
|
||||
require("dap").step_out()
|
||||
end,
|
||||
silent = true,
|
||||
},
|
||||
{
|
||||
"<A-b>",
|
||||
function()
|
||||
require("dap").toggle_breakpoint()
|
||||
end,
|
||||
silent = true,
|
||||
},
|
||||
},
|
||||
"mfussenegger/nvim-dap",
|
||||
}
|
||||
|
|
159
nvim/lua/plugins/dap_go.lua
Normal file
159
nvim/lua/plugins/dap_go.lua
Normal file
|
@ -0,0 +1,159 @@
|
|||
local default_config = {
|
||||
delve = {
|
||||
path = "dlv",
|
||||
initialize_timeout_sec = 20,
|
||||
port = "${port}",
|
||||
args = {},
|
||||
build_flags = "",
|
||||
-- Automatically handle the issue on delve Windows versions < 1.24.0
|
||||
-- where delve needs to be run in attched mode or it will fail (actually crashes).
|
||||
detached = vim.fn.has("win32") == 0,
|
||||
output_mode = "remote",
|
||||
cwd = nil,
|
||||
},
|
||||
tests = {
|
||||
verbose = false,
|
||||
},
|
||||
}
|
||||
|
||||
local function setup_go_configuration(dap, configs)
|
||||
local common_debug_configs = {
|
||||
{
|
||||
type = "go",
|
||||
name = "Debug",
|
||||
request = "launch",
|
||||
program = "${workspaceFolder}",
|
||||
args = {},
|
||||
buildFlags = configs.delve.build_flags,
|
||||
outputMode = configs.delve.output_mode,
|
||||
},
|
||||
}
|
||||
|
||||
if dap.configurations.go == nil then
|
||||
dap.configurations.go = {}
|
||||
end
|
||||
|
||||
for _, config in ipairs(common_debug_configs) do
|
||||
table.insert(dap.configurations.go, config)
|
||||
end
|
||||
|
||||
if configs == nil or configs.dap_configurations == nil then
|
||||
return
|
||||
end
|
||||
|
||||
for _, config in ipairs(configs.dap_configurations) do
|
||||
if config.type == "go" then
|
||||
table.insert(dap.configurations.go, config)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
"leoluz/nvim-dap-go",
|
||||
dependencies = { "mfussenegger/nvim-dap" },
|
||||
opts = true,
|
||||
config = function()
|
||||
local dap, dapui = require("dap"), require("dapui")
|
||||
|
||||
dap.adapters.go = {
|
||||
type = "server",
|
||||
port = "${port}",
|
||||
executable = {
|
||||
command = "dlv",
|
||||
args = { "dap", "-l", "127.0.0.1:${port}" },
|
||||
},
|
||||
}
|
||||
|
||||
setup_go_configuration(dap, default_config)
|
||||
|
||||
dap.defaults.fallback.terminal_win_cmd = "enew | set filetype=dap-terminal"
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.launch.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
|
||||
vim.api.nvim_set_hl(0, "DapBreakpoint", { ctermbg = 0, fg = "#993939", bg = "#31353f" })
|
||||
vim.api.nvim_set_hl(0, "DapLogPoint", { ctermbg = 0, fg = "#61afef", bg = "#31353f" })
|
||||
vim.api.nvim_set_hl(0, "DapStopped", { ctermbg = 0, fg = "#98c379", bg = "#31353f" })
|
||||
|
||||
vim.fn.sign_define(
|
||||
"DapBreakpoint",
|
||||
{ text = "!", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"DapBreakpointCondition",
|
||||
{ text = "?", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"DapBreakpointRejected",
|
||||
{ text = "RJ", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"DapLogPoint",
|
||||
{ text = "i", texthl = "DapLogPoint", linehl = "DapLogPoint", numhl = "DapLogPoint" }
|
||||
)
|
||||
vim.fn.sign_define(
|
||||
"DapStopped",
|
||||
{ text = "→", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" }
|
||||
)
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<F5>",
|
||||
function()
|
||||
require("dap").continue()
|
||||
end,
|
||||
silent = true,
|
||||
},
|
||||
{
|
||||
"<F17>", -- S-F5
|
||||
function()
|
||||
require("dap").restart()
|
||||
end,
|
||||
silent = true,
|
||||
},
|
||||
{
|
||||
"<F29>", -- C-F5
|
||||
function()
|
||||
require("dap").terminate()
|
||||
end,
|
||||
silent = true,
|
||||
},
|
||||
{
|
||||
"<F8>",
|
||||
function()
|
||||
require("dap").step_over()
|
||||
end,
|
||||
silent = true,
|
||||
},
|
||||
{
|
||||
"<F7>",
|
||||
function()
|
||||
require("dap").step_into()
|
||||
end,
|
||||
silent = true,
|
||||
},
|
||||
{
|
||||
"<F19>", -- S-F7
|
||||
function()
|
||||
require("dap").step_out()
|
||||
end,
|
||||
silent = true,
|
||||
},
|
||||
{
|
||||
"<A-b>",
|
||||
function()
|
||||
require("dap").toggle_breakpoint()
|
||||
end,
|
||||
silent = true,
|
||||
},
|
||||
},
|
||||
}
|
|
@ -52,8 +52,6 @@ return {
|
|||
{
|
||||
elements = {
|
||||
"repl",
|
||||
"breakpoints",
|
||||
"scopes",
|
||||
},
|
||||
size = 0.3,
|
||||
position = "bottom",
|
||||
|
|
5
nvim/lua/plugins/headlines.lua
Normal file
5
nvim/lua/plugins/headlines.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
"lukas-reineke/headlines.nvim",
|
||||
dependencies = "nvim-treesitter/nvim-treesitter",
|
||||
config = true,
|
||||
}
|
8
nvim/lua/plugins/lsp_saga.lua
Normal file
8
nvim/lua/plugins/lsp_saga.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
"nvimdev/lspsaga.nvim",
|
||||
opts = {
|
||||
lightbulb = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
}
|
15
nvim/lua/plugins/lsp_signature.lua
Normal file
15
nvim/lua/plugins/lsp_signature.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
return {
|
||||
"ray-x/lsp_signature.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
doc_lines = 1,
|
||||
max_height = 3,
|
||||
hint_prefix = "",
|
||||
hint_prefix = {
|
||||
above = "↙ ",
|
||||
current = "← ",
|
||||
below = "↖ ",
|
||||
},
|
||||
floating_window = true,
|
||||
},
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
local HEIGHT_RATIO = 0.8
|
||||
local WIDTH_RATIO = 0.5
|
||||
local WIDTH_RATIO = 0.25
|
||||
|
||||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
|
@ -9,36 +8,10 @@ return {
|
|||
opts = {
|
||||
disable_netrw = true,
|
||||
hijack_netrw = true,
|
||||
hijack_directories = {
|
||||
enable = true,
|
||||
auto_open = true,
|
||||
},
|
||||
sort = {
|
||||
sorter = "case_sensitive",
|
||||
},
|
||||
view = {
|
||||
-- width = 30,
|
||||
float = {
|
||||
enable = true,
|
||||
open_win_config = function()
|
||||
local screen_w = vim.opt.columns:get()
|
||||
local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get()
|
||||
local window_w = screen_w * WIDTH_RATIO
|
||||
local window_h = screen_h * HEIGHT_RATIO
|
||||
local window_w_int = math.floor(window_w)
|
||||
local window_h_int = math.floor(window_h)
|
||||
local center_x = (screen_w - window_w) / 2
|
||||
local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get()
|
||||
return {
|
||||
border = "rounded",
|
||||
relative = "editor",
|
||||
row = center_y,
|
||||
col = center_x,
|
||||
width = window_w_int,
|
||||
height = window_h_int,
|
||||
}
|
||||
end,
|
||||
},
|
||||
width = function()
|
||||
return math.floor(vim.opt.columns:get() * WIDTH_RATIO)
|
||||
end,
|
||||
|
@ -60,11 +33,8 @@ return {
|
|||
filters = {
|
||||
dotfiles = false,
|
||||
},
|
||||
sync_root_with_cwd = true,
|
||||
respect_buf_cwd = true,
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_root = true,
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
|
|
|
@ -7,7 +7,7 @@ return {
|
|||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
ensure_installed = "all",
|
||||
ignore_install = { "gdhsader", "phpdoc" },
|
||||
ignore_install = { "gdhsader", "phpdoc", "org" },
|
||||
indent = { enable = true },
|
||||
auto_install = true,
|
||||
sync_install = true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue