🐛 fix(nvim): changed a lot of stuff to adapt to the new 10.0 lazyvim update
the new lazyvim update was huge, especially because none-ls was moved to extras, so conform and lint would be the default formatter-linting
This commit is contained in:
parent
c80a50087a
commit
438af606a1
21 changed files with 812 additions and 616 deletions
31
.config/nvim/lazyvim.json
Normal file
31
.config/nvim/lazyvim.json
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"extras": [
|
||||
"lazyvim.plugins.extras.coding.yanky",
|
||||
"lazyvim.plugins.extras.dap.core",
|
||||
"lazyvim.plugins.extras.dap.nlua",
|
||||
"lazyvim.plugins.extras.editor.symbols-outline",
|
||||
"lazyvim.plugins.extras.formatting.black",
|
||||
"lazyvim.plugins.extras.formatting.prettier",
|
||||
"lazyvim.plugins.extras.lang.docker",
|
||||
"lazyvim.plugins.extras.lang.go",
|
||||
"lazyvim.plugins.extras.lang.java",
|
||||
"lazyvim.plugins.extras.lang.json",
|
||||
"lazyvim.plugins.extras.lang.omnisharp",
|
||||
"lazyvim.plugins.extras.lang.python",
|
||||
"lazyvim.plugins.extras.lang.rust",
|
||||
"lazyvim.plugins.extras.lang.tailwind",
|
||||
"lazyvim.plugins.extras.lang.typescript",
|
||||
"lazyvim.plugins.extras.lang.yaml",
|
||||
"lazyvim.plugins.extras.linting.eslint",
|
||||
"lazyvim.plugins.extras.test.core",
|
||||
"lazyvim.plugins.extras.ui.alpha",
|
||||
"lazyvim.plugins.extras.util.dot",
|
||||
"lazyvim.plugins.extras.util.project",
|
||||
"lazyvim.plugins.extras.vscode",
|
||||
"plugins.extras.alpha"
|
||||
],
|
||||
"news": {
|
||||
"NEWS.md": "2123"
|
||||
},
|
||||
"version": 2
|
||||
}
|
|
@ -2,66 +2,66 @@
|
|||
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
||||
-- Add any additional keymaps here
|
||||
local function map(mode, lhs, rhs, opts)
|
||||
local keys = require("lazy.core.handler").handlers.keys
|
||||
---@cast keys LazyKeysHandler
|
||||
-- do not create the keymap if a lazy keys handler exists
|
||||
if not keys.active[keys.parse({ lhs, mode = mode }).id] then
|
||||
opts = opts or {}
|
||||
opts.silent = opts.silent ~= false
|
||||
if opts.remap and not vim.g.vscode then
|
||||
opts.remap = nil
|
||||
end
|
||||
vim.keymap.set(mode, lhs, rhs, opts)
|
||||
local keys = require("lazy.core.handler").handlers.keys
|
||||
---@cast keys LazyKeysHandler
|
||||
-- do not create the keymap if a lazy keys handler exists
|
||||
if not keys.active[keys.parse({ lhs, mode = mode }).id] then
|
||||
opts = opts or {}
|
||||
opts.silent = opts.silent ~= false
|
||||
if opts.remap and not vim.g.vscode then
|
||||
opts.remap = nil
|
||||
end
|
||||
vim.keymap.set(mode, lhs, rhs, opts)
|
||||
end
|
||||
end
|
||||
|
||||
map(
|
||||
"n",
|
||||
"<leader>xs",
|
||||
":FloatermNew --disposable --name=duaroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<root> dua i<CR>",
|
||||
{ desc = "Workspace Size (root dir)" }
|
||||
"n",
|
||||
"<leader>xs",
|
||||
":FloatermNew --disposable --name=duaroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<root> dua i<CR>",
|
||||
{ desc = "Workspace Size (root dir)" }
|
||||
)
|
||||
|
||||
map(
|
||||
"n",
|
||||
"<leader>xS",
|
||||
":FloatermNew --disposable --name=duabuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<buffer> dua i<CR>",
|
||||
{ desc = "Workspace Size (cwd)" }
|
||||
"n",
|
||||
"<leader>xS",
|
||||
":FloatermNew --disposable --name=duabuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<buffer> dua i<CR>",
|
||||
{ desc = "Workspace Size (cwd)" }
|
||||
)
|
||||
|
||||
map(
|
||||
"n",
|
||||
"<leader>fx",
|
||||
":FloatermNew --disposable --name=xplrroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<root> xplr<CR>",
|
||||
{ desc = "Xplr (root dir)" }
|
||||
"n",
|
||||
"<leader>fx",
|
||||
":FloatermNew --disposable --name=xplrroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<root> xplr<CR>",
|
||||
{ desc = "Xplr (root dir)" }
|
||||
)
|
||||
|
||||
map(
|
||||
"n",
|
||||
"<leader>fX",
|
||||
":FloatermNew --disposable --name=xplrbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<buffer> xplr<CR>",
|
||||
{ desc = "Xplr (cwd)" }
|
||||
"n",
|
||||
"<leader>fX",
|
||||
":FloatermNew --disposable --name=xplrbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<buffer> xplr<CR>",
|
||||
{ desc = "Xplr (cwd)" }
|
||||
)
|
||||
|
||||
map(
|
||||
"n",
|
||||
"<leader>gg",
|
||||
":FloatermNew --disposable --name=lazygitroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<root> lazygit<CR>",
|
||||
{ desc = "Lazygit (root dir)" }
|
||||
"n",
|
||||
"<leader>gg",
|
||||
":FloatermNew --disposable --name=lazygitroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<root> lazygit<CR>",
|
||||
{ desc = "Lazygit (root dir)" }
|
||||
)
|
||||
|
||||
map(
|
||||
"n",
|
||||
"<leader>gG",
|
||||
":FloatermNew --disposable --name=lazygitbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<buffer> lazygit<CR>",
|
||||
{ desc = "Lazygit (cwd)" }
|
||||
"n",
|
||||
"<leader>gG",
|
||||
":FloatermNew --disposable --name=lazygitbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<buffer> lazygit<CR>",
|
||||
{ desc = "Lazygit (cwd)" }
|
||||
)
|
||||
|
||||
map(
|
||||
"n",
|
||||
"<leader>fd",
|
||||
":FloatermNew --disposable --name=lazydocker --opener=edit --titleposition=center --height=0.85 --width=0.85 lazydocker<CR>",
|
||||
{ desc = "Lazydocker" }
|
||||
"n",
|
||||
"<leader>fd",
|
||||
":FloatermNew --disposable --name=lazydocker --opener=edit --titleposition=center --height=0.85 --width=0.85 lazydocker<CR>",
|
||||
{ desc = "Lazydocker" }
|
||||
)
|
||||
|
||||
map("n", "<leader>T", ":Telescope floaterm<CR>", { desc = "Terminals" })
|
||||
|
@ -76,21 +76,21 @@ map("n", "<leader>si", ":Telescope import<CR>", { desc = "Imports" })
|
|||
|
||||
map("n", "<leader>sI", ":Gitignore<CR>", { desc = "Gitignore" })
|
||||
|
||||
map("n", "<leader>cC", ":ConformInfo<CR>", { desc = "Conform Info" })
|
||||
|
||||
map("n", "<leader>um", ":MarkdownPreviewToggle<CR>", { desc = "Toggle Markdown Preview" })
|
||||
|
||||
map("n", "<leader>cn", ":NullLsInfo<CR>", { desc = "NullLs Info" })
|
||||
|
||||
map(
|
||||
"n",
|
||||
"<leader>ft",
|
||||
":FloatermNew --name=termroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<root><CR>",
|
||||
{ desc = "New Terminal (root dir)" }
|
||||
"n",
|
||||
"<leader>ft",
|
||||
":FloatermNew --name=termroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<root><CR>",
|
||||
{ desc = "New Terminal (root dir)" }
|
||||
)
|
||||
map(
|
||||
"n",
|
||||
"<leader>fT",
|
||||
":FloatermNew --name=termcwd --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<buffer><CR>",
|
||||
{ desc = "New Terminal (cwd)" }
|
||||
"n",
|
||||
"<leader>fT",
|
||||
":FloatermNew --name=termcwd --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=<buffer><CR>",
|
||||
{ desc = "New Terminal (cwd)" }
|
||||
)
|
||||
map("n", "<c-Return>", ":FloatermToggle<CR>", { desc = "Toggle Terminal" })
|
||||
map("t", "<C-Return>", "<C-\\><C-n><C-\\><C-n>:FloatermToggle<CR>", { desc = "Toggle Terminal", nowait = true })
|
||||
|
@ -104,51 +104,51 @@ vim.keymap.set("i", "<C-c>", "<cmd>PickColorInsert<cr>", { noremap = true, silen
|
|||
vim.keymap.set("n", "<leader>ccc", "<cmd>CompilerOpen<cr>", { noremap = true, silent = true, desc = "Open Compiler" })
|
||||
|
||||
vim.keymap.set("n", "<leader>ccR", function()
|
||||
vim.cmd("CompilerStop")
|
||||
vim.cmd("CompilerRedo")
|
||||
vim.cmd("CompilerStop")
|
||||
vim.cmd("CompilerRedo")
|
||||
end, { noremap = true, silent = true, desc = "Redo Compiler" })
|
||||
|
||||
-- Toggle compiler results
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>ccr",
|
||||
"<cmd>CompilerToggleResults<cr>",
|
||||
{ noremap = true, silent = true, desc = "Toggle Compiler Results" }
|
||||
"n",
|
||||
"<leader>ccr",
|
||||
"<cmd>CompilerToggleResults<cr>",
|
||||
{ noremap = true, silent = true, desc = "Toggle Compiler Results" }
|
||||
)
|
||||
|
||||
vim.api.nvim_set_keymap(
|
||||
"n",
|
||||
"<leader>cps",
|
||||
"<cmd>lua require('package-info').show({ force = true })<cr>",
|
||||
{ silent = true, noremap = true, desc = "Show Package Versions" }
|
||||
"n",
|
||||
"<leader>cps",
|
||||
"<cmd>lua require('package-info').show({ force = true })<cr>",
|
||||
{ silent = true, noremap = true, desc = "Show Package Versions" }
|
||||
)
|
||||
|
||||
vim.api.nvim_set_keymap(
|
||||
"n",
|
||||
"<leader>cpu",
|
||||
"<cmd>lua require('package-info').update()<cr>",
|
||||
{ silent = true, noremap = true, desc = "Update Package" }
|
||||
"n",
|
||||
"<leader>cpu",
|
||||
"<cmd>lua require('package-info').update()<cr>",
|
||||
{ silent = true, noremap = true, desc = "Update Package" }
|
||||
)
|
||||
|
||||
vim.api.nvim_set_keymap(
|
||||
"n",
|
||||
"<leader>cpr",
|
||||
"<cmd>lua require('package-info').delete()<cr>",
|
||||
{ silent = true, noremap = true, desc = "Remove Package" }
|
||||
"n",
|
||||
"<leader>cpr",
|
||||
"<cmd>lua require('package-info').delete()<cr>",
|
||||
{ silent = true, noremap = true, desc = "Remove Package" }
|
||||
)
|
||||
|
||||
vim.api.nvim_set_keymap(
|
||||
"n",
|
||||
"<leader>cpv",
|
||||
"<cmd>lua require('package-info').change_version()<cr>",
|
||||
{ silent = true, noremap = true, desc = "Change Package Version" }
|
||||
"n",
|
||||
"<leader>cpv",
|
||||
"<cmd>lua require('package-info').change_version()<cr>",
|
||||
{ silent = true, noremap = true, desc = "Change Package Version" }
|
||||
)
|
||||
|
||||
vim.api.nvim_set_keymap(
|
||||
"n",
|
||||
"<leader>cpn",
|
||||
"<cmd>lua require('package-info').install()<cr>",
|
||||
{ silent = true, noremap = true, desc = "Install New Dependency" }
|
||||
"n",
|
||||
"<leader>cpn",
|
||||
"<cmd>lua require('package-info').install()<cr>",
|
||||
{ silent = true, noremap = true, desc = "Install New Dependency" }
|
||||
)
|
||||
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
|
@ -160,75 +160,75 @@ vim.keymap.set("n", "n", "nzzzv")
|
|||
vim.keymap.set("n", "N", "Nzzzv")
|
||||
|
||||
local function goto_prev_node()
|
||||
local ts_utils = require("nvim-treesitter.ts_utils")
|
||||
local node = ts_utils.get_node_at_cursor()
|
||||
if not node then
|
||||
return
|
||||
local ts_utils = require("nvim-treesitter.ts_utils")
|
||||
local node = ts_utils.get_node_at_cursor()
|
||||
if not node then
|
||||
return
|
||||
end
|
||||
local dest_node = ts_utils.get_previous_node(node, true, true)
|
||||
if not dest_node then
|
||||
local cur_node = node:parent()
|
||||
while cur_node do
|
||||
dest_node = ts_utils.get_previous_node(cur_node, false, false)
|
||||
if dest_node then
|
||||
break
|
||||
end
|
||||
cur_node = cur_node:parent()
|
||||
end
|
||||
local dest_node = ts_utils.get_previous_node(node, true, true)
|
||||
if not dest_node then
|
||||
local cur_node = node:parent()
|
||||
while cur_node do
|
||||
dest_node = ts_utils.get_previous_node(cur_node, false, false)
|
||||
if dest_node then
|
||||
break
|
||||
end
|
||||
cur_node = cur_node:parent()
|
||||
end
|
||||
end
|
||||
if not dest_node then
|
||||
return
|
||||
end
|
||||
ts_utils.goto_node(dest_node)
|
||||
end
|
||||
if not dest_node then
|
||||
return
|
||||
end
|
||||
ts_utils.goto_node(dest_node)
|
||||
end
|
||||
|
||||
local function goto_next_node()
|
||||
local ts_utils = require("nvim-treesitter.ts_utils")
|
||||
local node = ts_utils.get_node_at_cursor()
|
||||
if not node then
|
||||
return
|
||||
local ts_utils = require("nvim-treesitter.ts_utils")
|
||||
local node = ts_utils.get_node_at_cursor()
|
||||
if not node then
|
||||
return
|
||||
end
|
||||
local dest_node = ts_utils.get_next_node(node, true, true)
|
||||
if not dest_node then
|
||||
local cur_node = node:parent()
|
||||
while cur_node do
|
||||
dest_node = ts_utils.get_next_node(cur_node, false, false)
|
||||
if dest_node then
|
||||
break
|
||||
end
|
||||
cur_node = cur_node:parent()
|
||||
end
|
||||
local dest_node = ts_utils.get_next_node(node, true, true)
|
||||
if not dest_node then
|
||||
local cur_node = node:parent()
|
||||
while cur_node do
|
||||
dest_node = ts_utils.get_next_node(cur_node, false, false)
|
||||
if dest_node then
|
||||
break
|
||||
end
|
||||
cur_node = cur_node:parent()
|
||||
end
|
||||
end
|
||||
if not dest_node then
|
||||
return
|
||||
end
|
||||
ts_utils.goto_node(dest_node)
|
||||
end
|
||||
if not dest_node then
|
||||
return
|
||||
end
|
||||
ts_utils.goto_node(dest_node)
|
||||
end
|
||||
|
||||
local function goto_parent_node()
|
||||
local ts_utils = require("nvim-treesitter.ts_utils")
|
||||
local node = ts_utils.get_node_at_cursor()
|
||||
if not node then
|
||||
return
|
||||
end
|
||||
local dest_node = node:parent()
|
||||
if not dest_node then
|
||||
return
|
||||
end
|
||||
ts_utils.goto_node(dest_node)
|
||||
local ts_utils = require("nvim-treesitter.ts_utils")
|
||||
local node = ts_utils.get_node_at_cursor()
|
||||
if not node then
|
||||
return
|
||||
end
|
||||
local dest_node = node:parent()
|
||||
if not dest_node then
|
||||
return
|
||||
end
|
||||
ts_utils.goto_node(dest_node)
|
||||
end
|
||||
|
||||
local function goto_child_node()
|
||||
local ts_utils = require("nvim-treesitter.ts_utils")
|
||||
local node = ts_utils.get_node_at_cursor()
|
||||
if not node then
|
||||
return
|
||||
end
|
||||
local dest_node = ts_utils.get_named_children(node)[1]
|
||||
if not dest_node then
|
||||
return
|
||||
end
|
||||
ts_utils.goto_node(dest_node)
|
||||
local ts_utils = require("nvim-treesitter.ts_utils")
|
||||
local node = ts_utils.get_node_at_cursor()
|
||||
if not node then
|
||||
return
|
||||
end
|
||||
local dest_node = ts_utils.get_named_children(node)[1]
|
||||
if not dest_node then
|
||||
return
|
||||
end
|
||||
ts_utils.goto_node(dest_node)
|
||||
end
|
||||
|
||||
local keyopts = { noremap = true, silent = true }
|
||||
|
|
|
@ -11,24 +11,6 @@ require("lazy").setup({
|
|||
spec = {
|
||||
-- add LazyVim and import its plugins
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
-- import any extras modules here
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||
{ import = "lazyvim.plugins.extras.dap.core" },
|
||||
{ import = "lazyvim.plugins.extras.test.core" },
|
||||
{ import = "lazyvim.plugins.extras.lang.python" },
|
||||
{ import = "lazyvim.plugins.extras.lang.docker" },
|
||||
{ import = "lazyvim.plugins.extras.lang.go" },
|
||||
{ import = "lazyvim.plugins.extras.lang.rust" },
|
||||
{ import = "lazyvim.plugins.extras.lang.tailwind" },
|
||||
{ import = "lazyvim.plugins.extras.linting.eslint" },
|
||||
{ import = "lazyvim.plugins.extras.formatting.prettier" },
|
||||
-- { import = "lazyvim.plugins.extras.coding.copilot" },
|
||||
{ import = "lazyvim.plugins.extras.util.dot" },
|
||||
{ import = "lazyvim.plugins.extras.lang.yaml" },
|
||||
{ import = "lazyvim.plugins.extras.coding.yanky" },
|
||||
{ import = "lazyvim.plugins.extras.util.project" },
|
||||
{ import = "lazyvim.plugins.extras.lang.omnisharp" },
|
||||
{ import = "plugins" },
|
||||
},
|
||||
defaults = {
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
return {
|
||||
{
|
||||
"windwp/nvim-ts-autotag",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("nvim-ts-autotag").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"windwp/nvim-ts-autotag",
|
||||
event = "InsertEnter",
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
|
|
58
.config/nvim/lua/plugins/conform.lua
Normal file
58
.config/nvim/lua/plugins/conform.lua
Normal file
|
@ -0,0 +1,58 @@
|
|||
return {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
dependencies = { "mason.nvim" },
|
||||
lazy = true,
|
||||
cmd = "ConformInfo",
|
||||
keys = {
|
||||
{
|
||||
"<leader>cF",
|
||||
function()
|
||||
require("conform").format({ formatters = { "injected" } })
|
||||
end,
|
||||
mode = { "n", "v" },
|
||||
desc = "Format Injected Langs",
|
||||
},
|
||||
{
|
||||
"<leader>cC",
|
||||
":ConformInfo<CR>",
|
||||
mode = { "n", "v" },
|
||||
desc = "Conform Info",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
fish = { "fish_indent" },
|
||||
sh = { "shfmt", "shellharden" },
|
||||
python = { "isort", "black" },
|
||||
bash = { "shfmt", "shellharden" },
|
||||
javascript = { { "prettierd", "prettier", "rustywind" } },
|
||||
javascriptreact = { { "prettierd", "prettier", "rustywind" } },
|
||||
typescript = { { "prettierd", "prettier", "rustywind" } },
|
||||
typescriptreact = { { "prettierd", "prettier", "rustywind" } },
|
||||
vue = { { "prettierd", "prettier", "rustywind" } },
|
||||
html = { { "prettierd", "prettier", "rustywind" } },
|
||||
rust = { "rusfmt" },
|
||||
go = { "gofumpt", "goimports" },
|
||||
},
|
||||
-- LazyVim will merge the options you set here with builtin formatters.
|
||||
-- You can also define any custom formatters here.
|
||||
---@type table<string,table>
|
||||
formatters = {
|
||||
injected = { options = { ignore_errors = true } },
|
||||
-- -- Example of using dprint only when a dprint.json file is present
|
||||
-- dprint = {
|
||||
-- condition = function(ctx)
|
||||
-- return vim.fs.find({ "dprint.json" }, { path = ctx.filename, upward = true })[1]
|
||||
-- end,
|
||||
-- },
|
||||
taplo = {
|
||||
condition = function(ctx)
|
||||
return vim.fs.find({ "Cargo.toml" }, { path = ctx.filename, upward = true })[1]
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,9 +1,8 @@
|
|||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
event = "BufReadPost",
|
||||
config = function()
|
||||
require("treesitter-context").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
event = "LazyFile",
|
||||
enabled = true,
|
||||
opts = { mode = "cursor" },
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,104 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
|
||||
dependencies = {
|
||||
|
||||
-- fancy UI for the debugger
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>du", function() require("dapui").toggle({ }) end, desc = "Dap UI" },
|
||||
{ "<leader>de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} },
|
||||
},
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
dapui.setup(opts)
|
||||
dap.listeners.after.event_initialized["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
|
||||
end,
|
||||
},
|
||||
|
||||
-- virtual text for the debugger
|
||||
{
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
opts = {},
|
||||
},
|
||||
|
||||
-- which key integration
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
defaults = {
|
||||
["<leader>d"] = { name = "+debug" },
|
||||
["<leader>da"] = { name = "+adapters" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- mason.nvim integration
|
||||
{
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
dependencies = "mason.nvim",
|
||||
cmd = { "DapInstall", "DapUninstall" },
|
||||
opts = {
|
||||
-- Makes a best effort to setup the various debuggers with
|
||||
-- reasonable debug configurations
|
||||
automatic_installation = true,
|
||||
|
||||
-- You can provide additional configuration to the handlers,
|
||||
-- see mason-nvim-dap README for more information
|
||||
handlers = {},
|
||||
|
||||
-- You'll need to check that you have the required things installed
|
||||
-- online, please don't ask me how to install them :)
|
||||
ensure_installed = {
|
||||
-- Update this to ensure that you have the debuggers for the langs you want
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" },
|
||||
{ "<leader>dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" },
|
||||
{ "<leader>dg", function() require("dap").goto_() end, desc = "Go to line (no execute)" },
|
||||
{ "<leader>di", function() require("dap").step_into() end, desc = "Step Into" },
|
||||
{ "<leader>dj", function() require("dap").down() end, desc = "Down" },
|
||||
{ "<leader>dk", function() require("dap").up() end, desc = "Up" },
|
||||
{ "<leader>dl", function() require("dap").run_last() end, desc = "Run Last" },
|
||||
{ "<leader>do", function() require("dap").step_out() end, desc = "Step Out" },
|
||||
{ "<leader>dO", function() require("dap").step_over() end, desc = "Step Over" },
|
||||
{ "<leader>dp", function() require("dap").pause() end, desc = "Pause" },
|
||||
{ "<leader>dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" },
|
||||
{ "<leader>ds", function() require("dap").session() end, desc = "Session" },
|
||||
{ "<leader>dt", function() require("dap").terminate() end, desc = "Terminate" },
|
||||
{ "<leader>dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" },
|
||||
},
|
||||
|
||||
config = function()
|
||||
local Config = require("lazyvim.config")
|
||||
vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" })
|
||||
|
||||
for name, sign in pairs(Config.icons.dap) do
|
||||
sign = type(sign) == "table" and sign or { sign }
|
||||
vim.fn.sign_define(
|
||||
"Dap" .. name,
|
||||
{ text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
|
||||
)
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
75
.config/nvim/lua/plugins/dashboard.lua
Normal file
75
.config/nvim/lua/plugins/dashboard.lua
Normal file
|
@ -0,0 +1,75 @@
|
|||
return {
|
||||
{
|
||||
"glepnir/dashboard-nvim",
|
||||
event = "VimEnter",
|
||||
opts = function()
|
||||
local logo = [[
|
||||
|
||||
███████████ █████ ██
|
||||
███████████ █████
|
||||
████████████████ ███████████ ███ ███████
|
||||
████████████████ ████████████ █████ ██████████████
|
||||
██████████████ █████████████ █████ █████ ████ █████
|
||||
██████████████████████████████████ █████ █████ ████ █████
|
||||
██████ ███ █████████████████ ████ █████ █████ ████ ██████
|
||||
]]
|
||||
-- local logo = [[
|
||||
-- ▄ ▄
|
||||
-- ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄
|
||||
-- █ ▄ █▄█ ▄▄▄ █ █▄█ █ █
|
||||
-- ▄▄ █▄█▄▄▄█ █▄█▄█▄▄█▄▄█ █
|
||||
-- ▄ █▄▄█ ▄ ▄▄ ▄█ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄
|
||||
-- █▄▄▄▄ ▄▄▄ █ ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ █ ▄
|
||||
-- ▄ █ █▄█ █▄█ █ █ █▄█ █ █▄█ ▄▄▄ █ █
|
||||
-- █▄█ ▄ █▄▄█▄▄█ █ ▄▄█ █ ▄ █ █▄█▄█ █
|
||||
-- █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ █▄█▄▄▄█
|
||||
-- ]]
|
||||
|
||||
logo = string.rep("\n", 8) .. logo .. "\n\n"
|
||||
|
||||
local opts = {
|
||||
theme = "doom",
|
||||
hide = {
|
||||
-- this is taken care of by lualine
|
||||
-- enabling this messes up the actual laststatus setting after loading a file
|
||||
statusline = false,
|
||||
},
|
||||
config = {
|
||||
header = vim.split(logo, "\n"),
|
||||
center = {
|
||||
{ action = "Telescope find_files", desc = " Find file", icon = " ", key = "f" },
|
||||
{ action = "ene | startinsert", desc = " New file", icon = " ", key = "n" },
|
||||
{ action = "Telescope oldfiles", desc = " Recent files", icon = " ", key = "r" },
|
||||
{ action = "Telescope live_grep", desc = " Find text", icon = " ", key = "g" },
|
||||
{ action = "e $MYVIMRC", desc = " Config", icon = " ", key = "c" },
|
||||
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
|
||||
{ action = "Lazy", desc = " Lazy", icon = " ", key = "l" },
|
||||
{ action = "qa", desc = " Quit", icon = " ", key = "q" },
|
||||
},
|
||||
footer = function()
|
||||
local stats = require("lazy").stats()
|
||||
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
||||
return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
for _, button in ipairs(opts.config.center) do
|
||||
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
|
||||
end
|
||||
|
||||
-- close Lazy and re-open when the dashboard is ready
|
||||
if vim.o.filetype == "lazy" then
|
||||
vim.cmd.close()
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "DashboardLoaded",
|
||||
callback = function()
|
||||
require("lazy").show()
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
}
|
103
.config/nvim/lua/plugins/extras/dap.lua
Normal file
103
.config/nvim/lua/plugins/extras/dap.lua
Normal file
|
@ -0,0 +1,103 @@
|
|||
return {
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
|
||||
dependencies = {
|
||||
|
||||
-- fancy UI for the debugger
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>du", function() require("dapui").toggle({ }) end, desc = "Dap UI" },
|
||||
{ "<leader>de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} },
|
||||
},
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
dapui.setup(opts)
|
||||
dap.listeners.after.event_initialized["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
|
||||
end,
|
||||
},
|
||||
|
||||
-- virtual text for the debugger
|
||||
{
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
opts = {},
|
||||
},
|
||||
|
||||
-- which key integration
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
defaults = {
|
||||
["<leader>d"] = { name = "+debug" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- mason.nvim integration
|
||||
{
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
dependencies = "mason.nvim",
|
||||
cmd = { "DapInstall", "DapUninstall" },
|
||||
opts = {
|
||||
-- Makes a best effort to setup the various debuggers with
|
||||
-- reasonable debug configurations
|
||||
automatic_installation = true,
|
||||
|
||||
-- You can provide additional configuration to the handlers,
|
||||
-- see mason-nvim-dap README for more information
|
||||
handlers = {},
|
||||
|
||||
-- You'll need to check that you have the required things installed
|
||||
-- online, please don't ask me how to install them :)
|
||||
ensure_installed = {
|
||||
-- Update this to ensure that you have the debuggers for the langs you want
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" },
|
||||
{ "<leader>dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" },
|
||||
{ "<leader>dg", function() require("dap").goto_() end, desc = "Go to line (no execute)" },
|
||||
{ "<leader>di", function() require("dap").step_into() end, desc = "Step Into" },
|
||||
{ "<leader>dj", function() require("dap").down() end, desc = "Down" },
|
||||
{ "<leader>dk", function() require("dap").up() end, desc = "Up" },
|
||||
{ "<leader>dl", function() require("dap").run_last() end, desc = "Run Last" },
|
||||
{ "<leader>do", function() require("dap").step_out() end, desc = "Step Out" },
|
||||
{ "<leader>dO", function() require("dap").step_over() end, desc = "Step Over" },
|
||||
{ "<leader>dp", function() require("dap").pause() end, desc = "Pause" },
|
||||
{ "<leader>dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" },
|
||||
{ "<leader>ds", function() require("dap").session() end, desc = "Session" },
|
||||
{ "<leader>dt", function() require("dap").terminate() end, desc = "Terminate" },
|
||||
{ "<leader>dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" },
|
||||
},
|
||||
|
||||
config = function()
|
||||
local Config = require("lazyvim.config")
|
||||
vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" })
|
||||
|
||||
for name, sign in pairs(Config.icons.dap) do
|
||||
sign = type(sign) == "table" and sign or { sign }
|
||||
vim.fn.sign_define(
|
||||
"Dap" .. name,
|
||||
{ text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
|
||||
)
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
30
.config/nvim/lua/plugins/lint.lua
Normal file
30
.config/nvim/lua/plugins/lint.lua
Normal file
|
@ -0,0 +1,30 @@
|
|||
return {
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
event = "LazyFile",
|
||||
opts = {
|
||||
-- Event to trigger linters
|
||||
events = { "BufWritePost", "BufReadPost", "InsertLeave" },
|
||||
linters_by_ft = {
|
||||
fish = { "fish" },
|
||||
markdown = { "markdownlint" },
|
||||
python = { "pylint" },
|
||||
yaml = { "yamllint" },
|
||||
dockerfile = { "hadolint" },
|
||||
},
|
||||
-- LazyVim extension to easily override linter options
|
||||
-- or add custom linters.
|
||||
---@type table<string,table>
|
||||
linters = {
|
||||
-- -- Example of using selene only when a selene.toml file is present
|
||||
-- selene = {
|
||||
-- -- `condition` is another LazyVim extension that allows you to
|
||||
-- -- dynamically enable/disable linters based on the context.
|
||||
-- condition = function(ctx)
|
||||
-- return vim.fs.find({ "selene.toml" }, { path = ctx.filename, upward = true })[1]
|
||||
-- end,
|
||||
-- },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,12 +1,12 @@
|
|||
return {
|
||||
{
|
||||
"aurum77/live-server.nvim",
|
||||
build = function()
|
||||
require("live_server.util").install()
|
||||
end,
|
||||
cmd = { "LiveServer", "LiveServerStart", "LiveServerStop" },
|
||||
keys = {
|
||||
{ "<leader>cs", "<cmd>LiveServer<CR>", desc = "Toggle LiveServer" },
|
||||
},
|
||||
{
|
||||
"aurum77/live-server.nvim",
|
||||
build = function()
|
||||
require("live_server.util").install()
|
||||
end,
|
||||
cmd = { "LiveServer", "LiveServerStart", "LiveServerStop" },
|
||||
keys = {
|
||||
{ "<leader>cL", "<cmd>LiveServer<CR>", desc = "Toggle LiveServer" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
9
.config/nvim/lua/plugins/lsp-lens.lua.bak
Normal file
9
.config/nvim/lua/plugins/lsp-lens.lua.bak
Normal file
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
{
|
||||
"VidocqH/lsp-lens.nvim",
|
||||
event = "BufReadPost",
|
||||
config = function()
|
||||
require("lsp-lens").setup()
|
||||
end,
|
||||
},
|
||||
}
|
|
@ -1,94 +1,92 @@
|
|||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
init = function()
|
||||
local keys = require("lazyvim.plugins.lsp.keymaps").get()
|
||||
keys[#keys + 1] = { "gd", "<CMD>Glance definitions<CR>", desc = "Goto definition" }
|
||||
keys[#keys + 1] = { "gr", "<CMD>Glance references<CR>", desc = "References" }
|
||||
keys[#keys + 1] = { "gy", "<CMD>Glance type_definitions<CR>", desc = "Goto t[y]pe definitions" }
|
||||
keys[#keys + 1] = { "gI", "<CMD>Glance implementations<CR>", desc = "Goto implementations" }
|
||||
end,
|
||||
opts = {
|
||||
-- options for vim.diagnostic.config()
|
||||
diagnostics = {
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
virtual_text = {
|
||||
spacing = 4,
|
||||
source = "if_many",
|
||||
prefix = "●",
|
||||
-- this will set set the prefix to a function that returns the diagnostics icon based on the severity
|
||||
-- this only works on a recent 0.10.0 build. Will be set to "●" when not supported
|
||||
-- prefix = "icons",
|
||||
float = {
|
||||
border = {
|
||||
{ "┌", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "┐", "FloatBorder" },
|
||||
{ "│", "FloatBorder" },
|
||||
{ "┘", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "└", "FloatBorder" },
|
||||
{ "│", "FloatBorder" },
|
||||
},
|
||||
},
|
||||
},
|
||||
severity_sort = true,
|
||||
},
|
||||
-- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0
|
||||
-- Be aware that you also will need to properly configure your LSP server to
|
||||
-- provide the inlay hints.
|
||||
inlay_hints = {
|
||||
enabled = false,
|
||||
},
|
||||
-- add any global capabilities here
|
||||
capabilities = {},
|
||||
-- Automatically format on save
|
||||
autoformat = true,
|
||||
-- Enable this to show formatters used in a notification
|
||||
-- Useful for debugging formatter issues
|
||||
format_notify = false,
|
||||
-- options for vim.lsp.buf.format
|
||||
-- `bufnr` and `filter` is handled by the LazyVim formatter,
|
||||
-- but can be also overridden when specified
|
||||
format = {
|
||||
formatting_options = nil,
|
||||
timeout_ms = nil,
|
||||
},
|
||||
-- LSP Server Settings
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
jsonls = {},
|
||||
lua_ls = {
|
||||
-- mason = false, -- set to false if you don't want this server to be installed with mason
|
||||
-- Use this to add any additional keymaps
|
||||
-- for specific lsp servers
|
||||
---@type LazyKeys[]
|
||||
-- keys = {},
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
},
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- you can do any additional lsp server setup here
|
||||
-- return true if you don't want this server to be setup with lspconfig
|
||||
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
|
||||
setup = {
|
||||
-- example to setup with typescript.nvim
|
||||
-- tsserver = function(_, opts)
|
||||
-- require("typescript").setup({ server = opts })
|
||||
-- return true
|
||||
-- end,
|
||||
-- Specify * to use this function as a fallback for any server
|
||||
-- ["*"] = function(server, opts) end,
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
init = function()
|
||||
local keys = require("lazyvim.plugins.lsp.keymaps").get()
|
||||
keys[#keys + 1] = { "gd", "<CMD>Glance definitions<CR>", desc = "Goto definition" }
|
||||
keys[#keys + 1] = { "gr", "<CMD>Glance references<CR>", desc = "References" }
|
||||
keys[#keys + 1] = { "gy", "<CMD>Glance type_definitions<CR>", desc = "Goto t[y]pe definitions" }
|
||||
keys[#keys + 1] = { "gI", "<CMD>Glance implementations<CR>", desc = "Goto implementations" }
|
||||
end,
|
||||
opts = {
|
||||
-- options for vim.diagnostic.config()
|
||||
diagnostics = {
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
virtual_text = {
|
||||
spacing = 4,
|
||||
source = "if_many",
|
||||
prefix = "●",
|
||||
-- this will set set the prefix to a function that returns the diagnostics icon based on the severity
|
||||
-- this only works on a recent 0.10.0 build. Will be set to "●" when not supported
|
||||
-- prefix = "icons",
|
||||
float = {
|
||||
border = {
|
||||
{ "┌", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "┐", "FloatBorder" },
|
||||
{ "│", "FloatBorder" },
|
||||
{ "┘", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "└", "FloatBorder" },
|
||||
{ "│", "FloatBorder" },
|
||||
},
|
||||
},
|
||||
},
|
||||
severity_sort = true,
|
||||
},
|
||||
-- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0
|
||||
-- Be aware that you also will need to properly configure your LSP server to
|
||||
-- provide the inlay hints.
|
||||
inlay_hints = {
|
||||
enabled = false,
|
||||
},
|
||||
-- add any global capabilities here
|
||||
capabilities = {},
|
||||
-- Enable this to show formatters used in a notification
|
||||
-- Useful for debugging formatter issues
|
||||
format_notify = false,
|
||||
-- options for vim.lsp.buf.format
|
||||
-- `bufnr` and `filter` is handled by the LazyVim formatter,
|
||||
-- but can be also overridden when specified
|
||||
format = {
|
||||
formatting_options = nil,
|
||||
timeout_ms = nil,
|
||||
},
|
||||
-- LSP Server Settings
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
jsonls = {},
|
||||
lua_ls = {
|
||||
-- mason = false, -- set to false if you don't want this server to be installed with mason
|
||||
-- Use this to add any additional keymaps
|
||||
-- for specific lsp servers
|
||||
---@type LazyKeys[]
|
||||
-- keys = {},
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
},
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- you can do any additional lsp server setup here
|
||||
-- return true if you don't want this server to be setup with lspconfig
|
||||
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
|
||||
setup = {
|
||||
-- example to setup with typescript.nvim
|
||||
-- tsserver = function(_, opts)
|
||||
-- require("typescript").setup({ server = opts })
|
||||
-- return true
|
||||
-- end,
|
||||
-- Specify * to use this function as a fallback for any server
|
||||
-- ["*"] = function(server, opts) end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,85 +1,104 @@
|
|||
return {
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
local icons = require("lazyvim.config").icons
|
||||
local Util = require("lazyvim.util")
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.g.lualine_laststatus = vim.o.laststatus
|
||||
if vim.fn.argc(-1) > 0 then
|
||||
-- set an empty statusline till lualine loads
|
||||
vim.o.statusline = " "
|
||||
else
|
||||
-- hide the statusline on the starter page
|
||||
vim.o.laststatus = 0
|
||||
end
|
||||
end,
|
||||
opts = function()
|
||||
-- PERF: we don't need this lualine require madness 🤷
|
||||
local lualine_require = require("lualine_require")
|
||||
lualine_require.require = require
|
||||
|
||||
return {
|
||||
options = {
|
||||
theme = "catppuccin",
|
||||
globalstatus = true,
|
||||
disabled_filetypes = { statusline = { "dashboard", "alpha" } },
|
||||
component_separators = "",
|
||||
section_separators = { left = "", right = "" },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch" },
|
||||
lualine_c = {
|
||||
{
|
||||
"diagnostics",
|
||||
symbols = {
|
||||
error = icons.diagnostics.Error,
|
||||
warn = icons.diagnostics.Warn,
|
||||
info = icons.diagnostics.Info,
|
||||
hint = icons.diagnostics.Hint,
|
||||
},
|
||||
},
|
||||
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
|
||||
{ "filename", path = 1, symbols = { modified = " ", readonly = "", unnamed = "" } },
|
||||
-- stylua: ignore
|
||||
local icons = require("lazyvim.config").icons
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
vim.o.laststatus = vim.g.lualine_laststatus
|
||||
|
||||
return {
|
||||
options = {
|
||||
theme = "catppuccin",
|
||||
globalstatus = true,
|
||||
disabled_filetypes = { statusline = { "dashboard", "alpha", "starter" } },
|
||||
component_separators = "",
|
||||
section_separators = { left = "", right = "" },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch" },
|
||||
lualine_c = {
|
||||
{
|
||||
"diagnostics",
|
||||
symbols = {
|
||||
error = icons.diagnostics.Error,
|
||||
warn = icons.diagnostics.Warn,
|
||||
info = icons.diagnostics.Info,
|
||||
hint = icons.diagnostics.Hint,
|
||||
},
|
||||
},
|
||||
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
|
||||
{
|
||||
function()
|
||||
return Util.root.pretty_path()
|
||||
end,
|
||||
},
|
||||
-- stylua: ignore
|
||||
{
|
||||
function()
|
||||
local ok, m = pcall(require, "better_escape")
|
||||
return ok and m.waiting and "✺" or ""
|
||||
end,
|
||||
},
|
||||
},
|
||||
lualine_x = {
|
||||
},
|
||||
lualine_x = {
|
||||
-- stylua: ignore
|
||||
{
|
||||
function() return require("noice").api.status.command.get() end,
|
||||
cond = function() return package.loaded["noice"] and require("noice").api.status.command.has() end,
|
||||
color = Util.fg("Statement"),
|
||||
color = Util.ui.fg("Statement"),
|
||||
},
|
||||
-- stylua: ignore
|
||||
{
|
||||
function() return require("noice").api.status.mode.get() end,
|
||||
cond = function() return package.loaded["noice"] and require("noice").api.status.mode.has() end,
|
||||
color = Util.fg("Constant"),
|
||||
color = Util.ui.fg("Constant"),
|
||||
},
|
||||
-- stylua: ignore
|
||||
{
|
||||
function() return " " .. require("dap").status() end,
|
||||
cond = function () return package.loaded["dap"] and require("dap").status() ~= "" end,
|
||||
color = Util.fg("Debug"),
|
||||
color = Util.ui.fg("Debug"),
|
||||
},
|
||||
{
|
||||
require("lazy.status").updates,
|
||||
cond = require("lazy.status").has_updates,
|
||||
color = Util.fg("Special"),
|
||||
},
|
||||
{
|
||||
"diff",
|
||||
symbols = {
|
||||
added = icons.git.added,
|
||||
modified = icons.git.modified,
|
||||
removed = icons.git.removed,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
lualine_y = {
|
||||
{ "progress", separator = " ", padding = { left = 1, right = 1 } },
|
||||
},
|
||||
lualine_z = {
|
||||
{ "location", padding = { left = 1, right = 1 } },
|
||||
},
|
||||
},
|
||||
extensions = { "neo-tree", "lazy" },
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
require("lazy.status").updates,
|
||||
cond = require("lazy.status").has_updates,
|
||||
color = Util.ui.fg("Special"),
|
||||
},
|
||||
{
|
||||
"diff",
|
||||
symbols = {
|
||||
added = icons.git.added,
|
||||
modified = icons.git.modified,
|
||||
removed = icons.git.removed,
|
||||
},
|
||||
},
|
||||
},
|
||||
lualine_y = {
|
||||
{ "progress", separator = " ", padding = { left = 1, right = 1 } },
|
||||
},
|
||||
lualine_z = {
|
||||
{ "location", padding = { left = 1, right = 1 } },
|
||||
},
|
||||
},
|
||||
extensions = { "neo-tree", "lazy" },
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,30 +1,36 @@
|
|||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"black",
|
||||
"prettierd",
|
||||
"beautysh",
|
||||
"codespell",
|
||||
"csharpier",
|
||||
"css-lsp",
|
||||
"cssmodules-language-server",
|
||||
"ktlint",
|
||||
"hadolint",
|
||||
"html-lsp",
|
||||
"rustywind",
|
||||
"sqlfmt",
|
||||
"markdownlint",
|
||||
"marksman",
|
||||
"markuplint",
|
||||
"stylua",
|
||||
"shfmt",
|
||||
"angular-language-server",
|
||||
"bash-language-server",
|
||||
"omnisharp",
|
||||
"sqlls",
|
||||
},
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"black",
|
||||
"prettierd",
|
||||
"codespell",
|
||||
"csharpier",
|
||||
"css-lsp",
|
||||
"cssmodules-language-server",
|
||||
"ktlint",
|
||||
"hadolint",
|
||||
"html-lsp",
|
||||
"rustywind",
|
||||
"sqlfmt",
|
||||
"markdownlint",
|
||||
"stylua",
|
||||
"shfmt",
|
||||
"angular-language-server",
|
||||
"bash-language-server",
|
||||
"omnisharp",
|
||||
"sqlls",
|
||||
"goimports",
|
||||
"shellharden",
|
||||
"codelldb",
|
||||
"markdownlint",
|
||||
"pylint",
|
||||
"gofumpt",
|
||||
"delve",
|
||||
"impl",
|
||||
"gomodifytags",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,116 +1,118 @@
|
|||
local Util = require("lazyvim.util")
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
cmd = "Neotree",
|
||||
keys = {
|
||||
{
|
||||
"<leader>fe",
|
||||
function()
|
||||
require("neo-tree.command").execute({ toggle = true, dir = require("lazyvim.util").get_root() })
|
||||
end,
|
||||
desc = "Explorer NeoTree (root dir)",
|
||||
},
|
||||
{
|
||||
"<leader>fE",
|
||||
function()
|
||||
require("neo-tree.command").execute({ toggle = true, dir = vim.loop.cwd() })
|
||||
end,
|
||||
desc = "Explorer NeoTree (cwd)",
|
||||
},
|
||||
{ "<leader>e", "<leader>fe", desc = "Explorer NeoTree (root dir)", remap = true },
|
||||
{ "<leader>E", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
|
||||
{
|
||||
"<leader>ge",
|
||||
function()
|
||||
require("neo-tree.command").execute({ source = "git_status", toggle = true })
|
||||
end,
|
||||
desc = "Git explorer",
|
||||
},
|
||||
{
|
||||
"<leader>be",
|
||||
function()
|
||||
require("neo-tree.command").execute({ source = "buffers", toggle = true })
|
||||
end,
|
||||
desc = "Buffer explorer",
|
||||
},
|
||||
},
|
||||
deactivate = function()
|
||||
vim.cmd([[Neotree close]])
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
cmd = "Neotree",
|
||||
keys = {
|
||||
{
|
||||
"<leader>fe",
|
||||
function()
|
||||
require("neo-tree.command").execute({ toggle = true, dir = Util.root() })
|
||||
end,
|
||||
init = function()
|
||||
if vim.fn.argc() == 1 then
|
||||
local stat = vim.loop.fs_stat(vim.fn.argv(0))
|
||||
if stat and stat.type == "directory" then
|
||||
require("neo-tree")
|
||||
end
|
||||
end
|
||||
desc = "Explorer NeoTree (root dir)",
|
||||
},
|
||||
{
|
||||
"<leader>fE",
|
||||
function()
|
||||
require("neo-tree.command").execute({ toggle = true, dir = vim.loop.cwd() })
|
||||
end,
|
||||
opts = {
|
||||
sources = { "filesystem", "git_status", "buffers", "document_symbols" },
|
||||
-- source_selector = {
|
||||
-- winbar = true,
|
||||
-- statusline = true,
|
||||
-- },
|
||||
open_files_do_not_replace_types = { "terminal", "Trouble", "qf", "Outline" },
|
||||
enable_git_status = true,
|
||||
enable_diagnostics = true,
|
||||
filesystem = {
|
||||
bind_to_cwd = false,
|
||||
follow_current_file = { enabled = true },
|
||||
use_libuv_file_watcher = true,
|
||||
},
|
||||
window = {
|
||||
mappings = {
|
||||
["<space>"] = "none",
|
||||
["e"] = "open",
|
||||
},
|
||||
},
|
||||
default_component_configs = {
|
||||
indent = {
|
||||
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
|
||||
expander_collapsed = "",
|
||||
expander_expanded = "",
|
||||
expander_highlight = "NeoTreeExpander",
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
opts.event_handlers = opts.event_handlers or {}
|
||||
|
||||
local function on_move(data)
|
||||
local clients = vim.lsp.get_active_clients()
|
||||
for _, client in ipairs(clients) do
|
||||
if client:supports_method("workspace/willRenameFiles") then
|
||||
local resp = client.request_sync("workspace/willRenameFiles", {
|
||||
files = {
|
||||
{
|
||||
oldUri = vim.uri_from_fname(data.source),
|
||||
newUri = vim.uri_from_fname(data.destination),
|
||||
},
|
||||
},
|
||||
}, 1000)
|
||||
if resp and resp.result ~= nil then
|
||||
vim.lsp.util.apply_workspace_edit(resp.result, client.offset_encoding)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local events = require("neo-tree.events")
|
||||
vim.list_extend(opts.event_handlers, {
|
||||
{ event = events.FILE_MOVED, handler = on_move },
|
||||
{ event = events.FILE_RENAMED, handler = on_move },
|
||||
})
|
||||
require("neo-tree").setup(opts)
|
||||
vim.api.nvim_create_autocmd("TermClose", {
|
||||
pattern = "*lazygit",
|
||||
callback = function()
|
||||
if package.loaded["neo-tree.sources.git_status"] then
|
||||
require("neo-tree.sources.git_status").refresh()
|
||||
end
|
||||
end,
|
||||
})
|
||||
desc = "Explorer NeoTree (cwd)",
|
||||
},
|
||||
{ "<leader>e", "<leader>fe", desc = "Explorer NeoTree (root dir)", remap = true },
|
||||
{ "<leader>E", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
|
||||
{
|
||||
"<leader>ge",
|
||||
function()
|
||||
require("neo-tree.command").execute({ source = "git_status", toggle = true })
|
||||
end,
|
||||
desc = "Git explorer",
|
||||
},
|
||||
{
|
||||
"<leader>be",
|
||||
function()
|
||||
require("neo-tree.command").execute({ source = "buffers", toggle = true })
|
||||
end,
|
||||
desc = "Buffer explorer",
|
||||
},
|
||||
},
|
||||
deactivate = function()
|
||||
vim.cmd([[Neotree close]])
|
||||
end,
|
||||
init = function()
|
||||
if vim.fn.argc() == 1 then
|
||||
local stat = vim.loop.fs_stat(vim.fn.argv(0))
|
||||
if stat and stat.type == "directory" then
|
||||
require("neo-tree")
|
||||
end
|
||||
end
|
||||
end,
|
||||
opts = {
|
||||
sources = { "filesystem", "git_status", "buffers", "document_symbols" },
|
||||
-- source_selector = {
|
||||
-- winbar = true,
|
||||
-- statusline = true,
|
||||
-- },
|
||||
open_files_do_not_replace_types = { "terminal", "Trouble", "qf", "Outline" },
|
||||
enable_git_status = true,
|
||||
enable_diagnostics = true,
|
||||
filesystem = {
|
||||
bind_to_cwd = false,
|
||||
follow_current_file = { enabled = true },
|
||||
use_libuv_file_watcher = true,
|
||||
},
|
||||
window = {
|
||||
mappings = {
|
||||
["<space>"] = "none",
|
||||
["e"] = "open",
|
||||
},
|
||||
},
|
||||
default_component_configs = {
|
||||
indent = {
|
||||
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
|
||||
expander_collapsed = "",
|
||||
expander_expanded = "",
|
||||
expander_highlight = "NeoTreeExpander",
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
opts.event_handlers = opts.event_handlers or {}
|
||||
|
||||
local function on_move(data)
|
||||
local clients = vim.lsp.get_active_clients()
|
||||
for _, client in ipairs(clients) do
|
||||
if client:supports_method("workspace/willRenameFiles") then
|
||||
local resp = client.request_sync("workspace/willRenameFiles", {
|
||||
files = {
|
||||
{
|
||||
oldUri = vim.uri_from_fname(data.source),
|
||||
newUri = vim.uri_from_fname(data.destination),
|
||||
},
|
||||
},
|
||||
}, 1000)
|
||||
if resp and resp.result ~= nil then
|
||||
vim.lsp.util.apply_workspace_edit(resp.result, client.offset_encoding)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local events = require("neo-tree.events")
|
||||
vim.list_extend(opts.event_handlers, {
|
||||
{ event = events.FILE_MOVED, handler = on_move },
|
||||
{ event = events.FILE_RENAMED, handler = on_move },
|
||||
})
|
||||
require("neo-tree").setup(opts)
|
||||
vim.api.nvim_create_autocmd("TermClose", {
|
||||
pattern = "*lazygit",
|
||||
callback = function()
|
||||
if package.loaded["neo-tree.sources.git_status"] then
|
||||
require("neo-tree.sources.git_status").refresh()
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"simrat39/symbols-outline.nvim",
|
||||
event = "BufReadPost",
|
||||
cmd = "SymbolsOutline",
|
||||
keys = { { "<leader>ul", "<cmd>SymbolsOutline<cr>", desc = "Lsp Symbols Outline" } },
|
||||
config = function()
|
||||
require("symbols-outline").setup()
|
||||
end,
|
||||
},
|
||||
}
|
|
@ -39,7 +39,7 @@ return {
|
|||
---@type TSConfig
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
opts = {
|
||||
autotag = { enable = true },
|
||||
-- autotag = { enable = true },
|
||||
endwise = { enable = true },
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
|
|
|
@ -1,43 +1,44 @@
|
|||
return {
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
plugins = { spelling = true },
|
||||
defaults = {
|
||||
mode = { "n", "v" },
|
||||
["g"] = { name = "+goto" },
|
||||
["gs"] = { name = "+surround" },
|
||||
["]"] = { name = "+next" },
|
||||
["["] = { name = "+prev" },
|
||||
["<leader><tab>"] = { name = "+tabs" },
|
||||
["<leader>a"] = { name = "+annotation" },
|
||||
["<leader>b"] = { name = "+buffer" },
|
||||
["<leader>c"] = { name = "+code" },
|
||||
["<leader>f"] = { name = "+file/find" },
|
||||
["<leader>g"] = { name = "+git" },
|
||||
["<leader>gh"] = { name = "+hunks" },
|
||||
["<leader>q"] = { name = "+quit/session" },
|
||||
["<leader>s"] = { name = "+search" },
|
||||
["<leader>u"] = { name = "+ui" },
|
||||
["<leader>w"] = { name = "+windows" },
|
||||
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
||||
["<leader>cc"] = { name = "+compile" },
|
||||
["<leader>cp"] = { name = "+packages" },
|
||||
["<leader>gd"] = { name = "+diff" },
|
||||
["<leader>gw"] = { name = "+worktrees" },
|
||||
["<leader>cR"] = { name = "+refactor" },
|
||||
["<leader>D"] = { name = "+database" },
|
||||
["<leader>sS"] = { name = "+Goto Symbols (Workspace)" },
|
||||
["<leader>ss"] = { name = "+Goto Symbols" },
|
||||
["<leader>db"] = { name = "+Breakpoints" },
|
||||
["<leader>sr"] = { name = "+replace" },
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local wk = require("which-key")
|
||||
wk.setup(opts)
|
||||
wk.register(opts.defaults)
|
||||
end,
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
plugins = { spelling = true },
|
||||
defaults = {
|
||||
mode = { "n", "v" },
|
||||
["g"] = { name = "+goto" },
|
||||
["gs"] = { name = "+surround" },
|
||||
["]"] = { name = "+next" },
|
||||
["["] = { name = "+prev" },
|
||||
["<leader><tab>"] = { name = "+tabs" },
|
||||
["<leader>a"] = { name = "+annotation" },
|
||||
["<leader>b"] = { name = "+buffer" },
|
||||
["<leader>c"] = { name = "+code" },
|
||||
["<leader>f"] = { name = "+file/find" },
|
||||
["<leader>g"] = { name = "+git" },
|
||||
["<leader>gh"] = { name = "+hunks" },
|
||||
["<leader>q"] = { name = "+quit/session" },
|
||||
["<leader>s"] = { name = "+search" },
|
||||
["<leader>u"] = { name = "+ui" },
|
||||
["<leader>w"] = { name = "+windows" },
|
||||
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
||||
["<leader>cc"] = { name = "+compile" },
|
||||
["<leader>cp"] = { name = "+packages" },
|
||||
["<leader>gd"] = { name = "+diff" },
|
||||
["<leader>gw"] = { name = "+worktrees" },
|
||||
["<leader>cR"] = { name = "+refactor" },
|
||||
["<leader>D"] = { name = "+database" },
|
||||
["<leader>sS"] = { name = "+Goto Symbols (Workspace)" },
|
||||
["<leader>ss"] = { name = "+Goto Symbols" },
|
||||
["<leader>db"] = { name = "+Breakpoints" },
|
||||
["<leader>sr"] = { name = "+replace" },
|
||||
["<leader>dP"] = { name = "+python" },
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local wk = require("which-key")
|
||||
wk.setup(opts)
|
||||
wk.register(opts.defaults)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue