Compare commits
7 Commits
63aa621404
...
649653ef8c
Author | SHA1 | Date | |
---|---|---|---|
649653ef8c | |||
18f15c5ab3 | |||
5c774bbdfb | |||
e61c059de6 | |||
82f6744c2f | |||
2e4796d7a7 | |||
6c49b81f5a |
|
@ -1,8 +1,3 @@
|
||||||
-- Basic vim config stuff
|
|
||||||
require("keymaps")
|
|
||||||
require("options")
|
|
||||||
require("autocmds")
|
|
||||||
|
|
||||||
-- Install lazy package manager
|
-- Install lazy package manager
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
|
@ -17,6 +12,13 @@ if not vim.loop.fs_stat(lazypath) then
|
||||||
end
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
-- Setup
|
||||||
|
require("keymaps")
|
||||||
|
require("options")
|
||||||
|
require("autocmds")
|
||||||
|
require("lsp")
|
||||||
|
|
||||||
|
-- Configure plugins
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
{ import = "themes" },
|
{ import = "themes" },
|
||||||
{ import = "plugins" },
|
{ import = "plugins" },
|
||||||
|
@ -37,24 +39,3 @@ require("lazy").setup({
|
||||||
backdrop = 100,
|
backdrop = 100,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
local lsp = require("tools.lsp")
|
|
||||||
for _, tool in pairs(lsp) do
|
|
||||||
if type(tool) == "table" then
|
|
||||||
local name = tool[1]
|
|
||||||
|
|
||||||
-- Apply additional config if specified
|
|
||||||
local config = tool[2]
|
|
||||||
if config ~= nil then
|
|
||||||
vim.lsp.config(name, config)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- System LSP are not managed by mason and need to be enabled manually
|
|
||||||
if
|
|
||||||
(type(tool.system) == "boolean" and tool.system and vim.fn.executable(name) > 0)
|
|
||||||
or (type(tool.system) == "string" and vim.fn.executable(tool.system) > 0)
|
|
||||||
then
|
|
||||||
vim.lsp.enable(name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
3
nvim/dot-config/nvim/lsp/clangd.lua
Normal file
3
nvim/dot-config/nvim/lsp/clangd.lua
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
return {
|
||||||
|
cmd = { "clangd", "--offset-encoding=utf-16", "--clang-tidy" },
|
||||||
|
}
|
8
nvim/dot-config/nvim/lsp/jsonls.lua
Normal file
8
nvim/dot-config/nvim/lsp/jsonls.lua
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
return {
|
||||||
|
settings = {
|
||||||
|
json = {
|
||||||
|
validate = { enable = true },
|
||||||
|
schemas = require("schemastore").json.schemas(),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
8
nvim/dot-config/nvim/lsp/lua_ls.lua
Normal file
8
nvim/dot-config/nvim/lsp/lua_ls.lua
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
return {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
workspace = { checkThirdParty = false },
|
||||||
|
telemetry = { enable = false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
9
nvim/dot-config/nvim/lsp/rust_analyzer.lua
Normal file
9
nvim/dot-config/nvim/lsp/rust_analyzer.lua
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
return {
|
||||||
|
settings = {
|
||||||
|
["rust-analyzer"] = {
|
||||||
|
check = {
|
||||||
|
command = "clippy",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
5
nvim/dot-config/nvim/lsp/typos_lsp.lua
Normal file
5
nvim/dot-config/nvim/lsp/typos_lsp.lua
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
return {
|
||||||
|
init_options = {
|
||||||
|
diagnosticSeverity = "Hint",
|
||||||
|
},
|
||||||
|
}
|
5
nvim/dot-config/nvim/lsp/yamlls.lua
Normal file
5
nvim/dot-config/nvim/lsp/yamlls.lua
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
return require("schema-companion").setup_client({
|
||||||
|
settings = {
|
||||||
|
yaml = {},
|
||||||
|
},
|
||||||
|
})
|
|
@ -24,93 +24,3 @@ vim.api.nvim_create_autocmd({ "InsertEnter", "WinLeave" }, {
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
local group = vim.api.nvim_create_augroup("lsp-attach", { clear = true })
|
|
||||||
-- Setup lsp keybindings
|
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
|
||||||
group = group,
|
|
||||||
callback = function(event)
|
|
||||||
local map = function(keys, func, desc, mode)
|
|
||||||
mode = mode or "n"
|
|
||||||
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = desc })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Symbols
|
|
||||||
map("grD", vim.lsp.buf.declaration, "Goto declaration")
|
|
||||||
|
|
||||||
local has_telescope, telescope = pcall(require, "telescope.builtin")
|
|
||||||
if has_telescope then
|
|
||||||
map("grd", telescope.lsp_definitions, "Goto definition")
|
|
||||||
|
|
||||||
map("grt", telescope.lsp_type_definitions, "Type definition")
|
|
||||||
|
|
||||||
map("grr", telescope.lsp_references, "Goto references")
|
|
||||||
map("gri", telescope.lsp_implementations, "Goto implementation")
|
|
||||||
map("gO", telescope.lsp_document_symbols, "Document symbols")
|
|
||||||
map("gW", telescope.lsp_dynamic_workspace_symbols, "Workspace symbols")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Diagnostics
|
|
||||||
map("[d", function()
|
|
||||||
vim.diagnostic.jump({ count = -1 })
|
|
||||||
end, "Go to previous diagnostic message")
|
|
||||||
map("]d", function()
|
|
||||||
vim.diagnostic.jump({ count = 1 })
|
|
||||||
end, "Go to next diagnostic message")
|
|
||||||
map("<leader>e", vim.diagnostic.open_float, "Open floating diagnostic message")
|
|
||||||
|
|
||||||
-- Helpers
|
|
||||||
vim.keymap.set("n", "grn", function()
|
|
||||||
return ":IncRename " .. vim.fn.expand("<cword>")
|
|
||||||
end, { buffer = event.buf, expr = true, desc = "Rename" })
|
|
||||||
map("gra", vim.lsp.buf.code_action, "Code actions", { "n", "x" })
|
|
||||||
|
|
||||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
|
||||||
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
|
|
||||||
map("<leader>th", function()
|
|
||||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf }))
|
|
||||||
end, "Inlay hints")
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Setup cursor hover symbol highlight
|
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
|
||||||
group = group,
|
|
||||||
callback = function(event)
|
|
||||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
|
||||||
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then
|
|
||||||
local lsp_hover_hl = vim.api.nvim_create_augroup("LspHoverHighlight", { clear = false })
|
|
||||||
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
|
||||||
buffer = event.buf,
|
|
||||||
group = lsp_hover_hl,
|
|
||||||
callback = vim.lsp.buf.document_highlight,
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
|
||||||
buffer = event.buf,
|
|
||||||
group = lsp_hover_hl,
|
|
||||||
callback = vim.lsp.buf.clear_references,
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("LspDetach", {
|
|
||||||
group = vim.api.nvim_create_augroup("LspHoverHighlightDetach", { clear = true }),
|
|
||||||
callback = function(event2)
|
|
||||||
vim.lsp.buf.clear_references()
|
|
||||||
vim.api.nvim_clear_autocmds({ group = lsp_hover_hl, buffer = event2.buf })
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Disable lsp based syntax highlighting
|
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
|
||||||
group = group,
|
|
||||||
callback = function(event)
|
|
||||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
|
||||||
if client and client.server_capabilities.semanticTokensProvider then
|
|
||||||
client.server_capabilities.semanticTokensProvider = nil
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
150
nvim/dot-config/nvim/lua/lsp.lua
Normal file
150
nvim/dot-config/nvim/lua/lsp.lua
Normal file
|
@ -0,0 +1,150 @@
|
||||||
|
local diagnostic = require("symbols.diagnostic")
|
||||||
|
local methods = vim.lsp.protocol.Methods
|
||||||
|
|
||||||
|
local map = function(keys, func, desc, mode, bufnr)
|
||||||
|
mode = mode or "n"
|
||||||
|
vim.keymap.set(mode, keys, func, { desc = desc, buffer = bufnr })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- General keymaps
|
||||||
|
map("[d", function()
|
||||||
|
vim.diagnostic.jump({ count = -1 })
|
||||||
|
end, "Go to previous diagnostic message")
|
||||||
|
map("]d", function()
|
||||||
|
vim.diagnostic.jump({ count = 1 })
|
||||||
|
end, "Go to next diagnostic message")
|
||||||
|
|
||||||
|
map("[e", function()
|
||||||
|
vim.diagnostic.jump({ count = -1, severity = vim.diagnostic.severity.ERROR })
|
||||||
|
end, "Go to previous error message")
|
||||||
|
map("]e", function()
|
||||||
|
vim.diagnostic.jump({ count = 1, severity = vim.diagnostic.severity.ERROR })
|
||||||
|
end, "Go to next error message")
|
||||||
|
|
||||||
|
map("<leader>e", vim.diagnostic.open_float, "Open floating diagnostic message")
|
||||||
|
|
||||||
|
map("<leader>th", function()
|
||||||
|
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
|
||||||
|
end, "Toggle inlay hints")
|
||||||
|
|
||||||
|
map("gra", vim.lsp.buf.code_action, "Code actions", { "n", "x" })
|
||||||
|
map("grD", vim.lsp.buf.declaration, "Goto declaration")
|
||||||
|
map("grd", function()
|
||||||
|
require("telescope.builtin").lsp_definitions({ jump_type = "never" })
|
||||||
|
end, "Goto definition")
|
||||||
|
|
||||||
|
map("grt", function()
|
||||||
|
require("telescope.builtin").lsp_type_definitions()
|
||||||
|
end, "Type definition")
|
||||||
|
map("grr", function()
|
||||||
|
require("telescope.builtin").lsp_references()
|
||||||
|
end, "Goto references")
|
||||||
|
map("gri", function()
|
||||||
|
require("telescope.builtin").lsp_implementations()
|
||||||
|
end, "Goto implementation")
|
||||||
|
|
||||||
|
map("<leader>ss", function()
|
||||||
|
require("telescope.builtin").lsp_document_symbols()
|
||||||
|
end, "Document symbols")
|
||||||
|
map("<leader>sS", function()
|
||||||
|
require("telescope.builtin").lsp_dynamic_workspace_symbols()
|
||||||
|
end, "Workspace symbols")
|
||||||
|
|
||||||
|
-- Provide a placeholder rename keymap, otherwise the rename appears to works until you hit enter at which point it will fail
|
||||||
|
map("grn", function()
|
||||||
|
vim.api.nvim_echo({ { "Rename are not available in current buffer" } }, true, { err = true })
|
||||||
|
end, "Rename")
|
||||||
|
|
||||||
|
---@param client vim.lsp.Client
|
||||||
|
---@param bufnr integer
|
||||||
|
local function on_attach(client, bufnr)
|
||||||
|
-- Setup actual rename keymap if it is available
|
||||||
|
if client:supports_method(methods.textDocument_rename, bufnr) then
|
||||||
|
vim.keymap.set("n", "grn", function()
|
||||||
|
return ":IncRename " .. vim.fn.expand("<cword>")
|
||||||
|
end, { buffer = bufnr, expr = true, desc = "Rename" })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Disable lsp based syntax highlighting, I don't like it
|
||||||
|
-- TODO: Switch to this once it is available
|
||||||
|
-- vim.lsp.document_color.enable(false, bufnr)
|
||||||
|
if client.server_capabilities.semanticTokensProvider then
|
||||||
|
client.server_capabilities.semanticTokensProvider = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Highlight references under cursor
|
||||||
|
if client:supports_method(methods.textDocument_documentHighlight) then
|
||||||
|
local lsp_hover_hl = vim.api.nvim_create_augroup("LspHoverHighlight", { clear = false })
|
||||||
|
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||||
|
buffer = bufnr,
|
||||||
|
group = lsp_hover_hl,
|
||||||
|
callback = vim.lsp.buf.document_highlight,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
||||||
|
buffer = bufnr,
|
||||||
|
group = lsp_hover_hl,
|
||||||
|
callback = vim.lsp.buf.clear_references,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.diagnostic.config({
|
||||||
|
severity_sort = true,
|
||||||
|
signs = {
|
||||||
|
numhl = {
|
||||||
|
[vim.diagnostic.severity.ERROR] = "DiagnosticNumError",
|
||||||
|
[vim.diagnostic.severity.WARN] = "DiagnosticNumWarn",
|
||||||
|
[vim.diagnostic.severity.HINT] = "DiagnosticNumHint",
|
||||||
|
[vim.diagnostic.severity.INFO] = "DiagnosticNumInfo",
|
||||||
|
},
|
||||||
|
text = {
|
||||||
|
[vim.diagnostic.severity.ERROR] = "",
|
||||||
|
[vim.diagnostic.severity.WARN] = "",
|
||||||
|
[vim.diagnostic.severity.HINT] = "",
|
||||||
|
[vim.diagnostic.severity.INFO] = "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
float = {
|
||||||
|
severity_sort = false,
|
||||||
|
header = "",
|
||||||
|
suffix = function(d)
|
||||||
|
local code = d.code and string.format(" (%s)", d.code) or ""
|
||||||
|
|
||||||
|
return string.format("%s [%s]", code, d.source), "NormalFloat"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
virtual_text = {
|
||||||
|
prefix = function(d)
|
||||||
|
return diagnostic[d.severity]
|
||||||
|
end,
|
||||||
|
virt_text_pos = "eol_right_align",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
local register_capability = vim.lsp.handlers[methods.client_registerCapability]
|
||||||
|
vim.lsp.handlers[methods.client_registerCapability] = function(err, res, ctx)
|
||||||
|
local client = vim.lsp.get_client_by_id(ctx.client_id)
|
||||||
|
if not client then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
on_attach(client, vim.api.nvim_get_current_buf())
|
||||||
|
|
||||||
|
return register_capability(err, res, ctx)
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
|
desc = "Configure LSP keymaps",
|
||||||
|
callback = function(args)
|
||||||
|
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||||
|
if not client then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
on_attach(client, args.buf)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Manually enable rust analyzer
|
||||||
|
vim.lsp.enable("rust_analyzer")
|
|
@ -1,4 +1,3 @@
|
||||||
local diagnostic = require("symbols.diagnostic")
|
|
||||||
local window = require("symbols.window")
|
local window = require("symbols.window")
|
||||||
|
|
||||||
-- Set highlight on search
|
-- Set highlight on search
|
||||||
|
@ -66,43 +65,7 @@ vim.o.listchars = "trail:~,tab:¦⁃,nbsp:␣"
|
||||||
vim.o.list = true
|
vim.o.list = true
|
||||||
|
|
||||||
-- Fold settings
|
-- Fold settings
|
||||||
vim.wo.foldmethod = "expr"
|
|
||||||
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
|
||||||
vim.o.foldlevelstart = 99
|
vim.o.foldlevelstart = 99
|
||||||
|
|
||||||
-- Windows borders
|
-- Windows borders
|
||||||
vim.o.winborder = window.border
|
vim.o.winborder = window.border
|
||||||
|
|
||||||
-- LSP config
|
|
||||||
vim.diagnostic.config({
|
|
||||||
severity_sort = true,
|
|
||||||
signs = {
|
|
||||||
numhl = {
|
|
||||||
[vim.diagnostic.severity.ERROR] = "DiagnosticNumError",
|
|
||||||
[vim.diagnostic.severity.WARN] = "DiagnosticNumWarn",
|
|
||||||
[vim.diagnostic.severity.HINT] = "DiagnosticNumHint",
|
|
||||||
[vim.diagnostic.severity.INFO] = "DiagnosticNumInfo",
|
|
||||||
},
|
|
||||||
text = {
|
|
||||||
[vim.diagnostic.severity.ERROR] = "",
|
|
||||||
[vim.diagnostic.severity.WARN] = "",
|
|
||||||
[vim.diagnostic.severity.HINT] = "",
|
|
||||||
[vim.diagnostic.severity.INFO] = "",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
float = {
|
|
||||||
severity_sort = false,
|
|
||||||
header = "",
|
|
||||||
suffix = function(d)
|
|
||||||
local code = d.code and string.format(" (%s)", d.code) or ""
|
|
||||||
|
|
||||||
return string.format("%s [%s]", code, d.source), "NormalFloat"
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
virtual_text = {
|
|
||||||
prefix = function(d)
|
|
||||||
return diagnostic[d.severity]
|
|
||||||
end,
|
|
||||||
virt_text_pos = "eol_right_align",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
-- https://github.com/altermo/ultimate-autopair.nvim
|
-- https://github.com/altermo/ultimate-autopair.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"altermo/ultimate-autopair.nvim",
|
"altermo/ultimate-autopair.nvim",
|
||||||
event = { "InsertEnter", "CmdlineEnter" },
|
event = { "InsertEnter", "CmdlineEnter" },
|
||||||
branch = "v0.6",
|
branch = "v0.6",
|
||||||
|
--- @module "ultimate-autopair"
|
||||||
|
--- @type prof.def.conf
|
||||||
opts = {
|
opts = {
|
||||||
fastwarp = {
|
fastwarp = {
|
||||||
faster = true,
|
faster = true,
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
-- https://github.com/saghen/blink.cmp
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"saghen/blink.cmp",
|
"saghen/blink.cmp",
|
||||||
-- optional: provides snippets for the snippet source
|
-- optional: provides snippets for the snippet source
|
||||||
|
@ -6,8 +9,8 @@ return {
|
||||||
-- use a release tag to download pre-built binaries
|
-- use a release tag to download pre-built binaries
|
||||||
version = "1.*",
|
version = "1.*",
|
||||||
|
|
||||||
---@module 'blink.cmp'
|
--- @module "blink-cmp"
|
||||||
---@type blink.cmp.Config
|
--- @type blink.cmp.Config
|
||||||
opts = {
|
opts = {
|
||||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||||
-- keymap = { preset = "default" },
|
-- keymap = { preset = "default" },
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
-- https://github.com/ojroques/nvim-bufdel
|
-- https://github.com/ojroques/nvim-bufdel
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"ojroques/nvim-bufdel",
|
"ojroques/nvim-bufdel",
|
||||||
cmd = { "BufDel", "BuffDelOthers" },
|
cmd = { "BufDel", "BuffDelOthers" },
|
||||||
|
|
|
@ -2,55 +2,53 @@
|
||||||
local diagnostic = require("symbols.diagnostic")
|
local diagnostic = require("symbols.diagnostic")
|
||||||
local file = require("symbols.file")
|
local file = require("symbols.file")
|
||||||
|
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"akinsho/bufferline.nvim",
|
"akinsho/bufferline.nvim",
|
||||||
config = function()
|
--- @module "bufferline"
|
||||||
-- Enable mousemoveevent if possible
|
--- @type bufferline.UserConfig
|
||||||
vim.o.mousemoveevent = true
|
opts = {
|
||||||
|
options = {
|
||||||
local bufferline = require("bufferline")
|
show_buffer_icons = false,
|
||||||
|
show_buffer_close_icons = false,
|
||||||
|
diagnostics = "nvim_lsp",
|
||||||
|
separator_style = "thick",
|
||||||
|
left_trunc_marker = "",
|
||||||
|
right_trunc_marker = "",
|
||||||
|
sort_by = "insert_at_end",
|
||||||
|
indicator = {
|
||||||
|
style = "none",
|
||||||
|
},
|
||||||
|
modified_icon = file.modified,
|
||||||
|
---@diagnostic disable-next-line: unused-local
|
||||||
|
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||||
|
local s = " "
|
||||||
|
for e, n in pairs(diagnostics_dict) do
|
||||||
|
local sym = e == "error" and diagnostic.error .. " "
|
||||||
|
or (e == "warning" and diagnostic.warn .. " ")
|
||||||
|
or (e == "info" and diagnostic.info .. " " or diagnostic.hint .. " ")
|
||||||
|
s = s .. n .. sym
|
||||||
|
end
|
||||||
|
return s
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
-- Setup keybinds to move between buffers
|
-- Setup keybinds to move between buffers
|
||||||
vim.keymap.set("n", "<tab>", function()
|
vim.keymap.set("n", "<tab>", function()
|
||||||
bufferline.cycle(1)
|
require("bufferline").cycle(1)
|
||||||
end, { silent = true, desc = "Goto next buffer" })
|
end, { silent = true, desc = "Goto next buffer" })
|
||||||
vim.keymap.set("n", "<S-tab>", function()
|
vim.keymap.set("n", "<S-tab>", function()
|
||||||
bufferline.cycle(-1)
|
require("bufferline").cycle(-1)
|
||||||
end, { silent = true, desc = "Goto previous buffer" })
|
end, { silent = true, desc = "Goto previous buffer" })
|
||||||
|
|
||||||
-- Setup keybinds to move buffers around
|
-- Setup keybinds to move buffers around
|
||||||
vim.keymap.set("n", "<leader>b[", function()
|
vim.keymap.set("n", "<leader>b[", function()
|
||||||
bufferline.move(-1)
|
require("bufferline").move(-1)
|
||||||
end, { silent = true, desc = "Move buffer to left" })
|
end, { silent = true, desc = "Move buffer to left" })
|
||||||
vim.keymap.set("n", "<leader>b]", function()
|
vim.keymap.set("n", "<leader>b]", function()
|
||||||
bufferline.move(1)
|
require("bufferline").move(1)
|
||||||
end, { silent = true, desc = "Move buffer to right" })
|
end, { silent = true, desc = "Move buffer to right" })
|
||||||
|
|
||||||
bufferline.setup({
|
|
||||||
options = {
|
|
||||||
show_buffer_icons = false,
|
|
||||||
show_buffer_close_icons = false,
|
|
||||||
diagnostics = "nvim_lsp",
|
|
||||||
separator_style = "thick",
|
|
||||||
left_trunc_marker = "",
|
|
||||||
right_trunc_marker = "",
|
|
||||||
sort_by = "insert_at_end",
|
|
||||||
indicator = {
|
|
||||||
style = "none",
|
|
||||||
},
|
|
||||||
modified_icon = file.modified,
|
|
||||||
---@diagnostic disable-next-line: unused-local
|
|
||||||
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
|
||||||
local s = " "
|
|
||||||
for e, n in pairs(diagnostics_dict) do
|
|
||||||
local sym = e == "error" and diagnostic.error .. " "
|
|
||||||
or (e == "warning" and diagnostic.warn .. " ")
|
|
||||||
or (e == "info" and diagnostic.info .. " " or diagnostic.hint .. " ")
|
|
||||||
s = s .. n .. sym
|
|
||||||
end
|
|
||||||
return s
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
-- https://github.com/NvChad/nvim-colorizer.lua
|
-- https://github.com/NvChad/nvim-colorizer.lua
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"NvChad/nvim-colorizer.lua",
|
"NvChad/nvim-colorizer.lua",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = {
|
opts = {
|
||||||
|
lazy_load = true,
|
||||||
filetypes = {
|
filetypes = {
|
||||||
"*", -- Enable color highlighting for all files
|
"*", -- Enable color highlighting for all files
|
||||||
"!neo-tree", -- Exclude neo-tree
|
"!neo-tree", -- Exclude neo-tree
|
||||||
|
@ -17,16 +20,4 @@ return {
|
||||||
names = false,
|
names = false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- Fix lazy loading: https://github.com/NvChad/nvim-colorizer.lua
|
|
||||||
config = function(_, opts)
|
|
||||||
local colorizer = require("colorizer")
|
|
||||||
colorizer.setup(opts)
|
|
||||||
|
|
||||||
-- nvim-colorizer doesn't work on the initial buffer if we lazy load, so force it to attach
|
|
||||||
-- on load.
|
|
||||||
local bufnr = vim.api.nvim_get_current_buf()
|
|
||||||
if bufnr and not colorizer.is_buffer_attached(bufnr) then
|
|
||||||
colorizer.attach_to_buffer(bufnr)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
-- https://github.com/numToStr/Comment.nvim
|
-- https://github.com/numToStr/Comment.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"numToStr/Comment.nvim",
|
"numToStr/Comment.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
|
--- @module "Comment"
|
||||||
|
--- @type CommentConfig
|
||||||
opts = {
|
opts = {
|
||||||
toggler = {
|
toggler = {
|
||||||
block = "gBc",
|
block = "gBc",
|
||||||
|
|
|
@ -1,5 +1,26 @@
|
||||||
-- https://github.com/stevearc/conform.nvim
|
-- https://github.com/stevearc/conform.nvim
|
||||||
local slow_format_filetypes = {}
|
local formatters_by_ft = {
|
||||||
|
c = { "clang-format" },
|
||||||
|
cpp = { "clang-format" },
|
||||||
|
go = { "goimports" },
|
||||||
|
python = { "ruff_organize_imports", "ruff_format" },
|
||||||
|
rust = { "rustfmt" },
|
||||||
|
javascript = { "prettierd" },
|
||||||
|
javascriptreact = { "prettierd" },
|
||||||
|
typescript = { "prettierd" },
|
||||||
|
typescriptreact = { "prettierd" },
|
||||||
|
css = { "prettierd" },
|
||||||
|
markdown = { "prettierd" },
|
||||||
|
yaml = { "prettierd" },
|
||||||
|
lua = { "stylua" },
|
||||||
|
json = { "jq" },
|
||||||
|
toml = { "taplo" },
|
||||||
|
-- ["*"] = { "injected" },
|
||||||
|
["_"] = { "trim_whitespace", "trim_newlines" },
|
||||||
|
}
|
||||||
|
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"stevearc/conform.nvim",
|
"stevearc/conform.nvim",
|
||||||
event = { "BufWritePre" },
|
event = { "BufWritePre" },
|
||||||
|
@ -15,50 +36,18 @@ return {
|
||||||
desc = "Format buffer",
|
desc = "Format buffer",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
--- @module "conform"
|
||||||
|
--- @type conform.setupOpts
|
||||||
opts = {
|
opts = {
|
||||||
formatters_by_ft = (function()
|
formatters_by_ft = formatters_by_ft,
|
||||||
local formatters = require("tools.format")
|
|
||||||
local formatters_by_ft = {}
|
|
||||||
for lang, formatter in pairs(formatters) do
|
|
||||||
formatters_by_ft[lang] = {}
|
|
||||||
if type(formatter) == "table" then
|
|
||||||
for _, tool in ipairs(formatter) do
|
|
||||||
if type(tool) == "table" then
|
|
||||||
table.insert(formatters_by_ft[lang], tool[1])
|
|
||||||
else
|
|
||||||
table.insert(formatters_by_ft[lang], tool)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return formatters_by_ft
|
|
||||||
end)(),
|
|
||||||
notify_on_error = false,
|
notify_on_error = false,
|
||||||
format_on_save = function(bufnr)
|
format_on_save = function(bufnr)
|
||||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if slow_format_filetypes[vim.bo[bufnr].filetype] then
|
--- @type conform.FormatOpts
|
||||||
return
|
return { lsp_format = "fallback" }
|
||||||
end
|
|
||||||
local function on_format(err)
|
|
||||||
if err and err:match("timeout$") then
|
|
||||||
slow_format_filetypes[vim.bo[bufnr].filetype] = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return { timeout_ms = 200, lsp_fallback = true }, on_format
|
|
||||||
end,
|
end,
|
||||||
format_after_save = function(bufnr)
|
|
||||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if not slow_format_filetypes[vim.bo[bufnr].filetype] then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
return { lsp_fallback = true }
|
|
||||||
end,
|
|
||||||
-- log_level = vim.log.levels.DEBUG,
|
|
||||||
},
|
},
|
||||||
init = function()
|
init = function()
|
||||||
vim.api.nvim_create_user_command("FormatDisable", function(args)
|
vim.api.nvim_create_user_command("FormatDisable", function(args)
|
||||||
|
@ -72,6 +61,7 @@ return {
|
||||||
desc = "Disable autoformat-on-save",
|
desc = "Disable autoformat-on-save",
|
||||||
bang = true,
|
bang = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_user_command("FormatEnable", function()
|
vim.api.nvim_create_user_command("FormatEnable", function()
|
||||||
vim.b.disable_autoformat = false
|
vim.b.disable_autoformat = false
|
||||||
vim.g.disable_autoformat = false
|
vim.g.disable_autoformat = false
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
-- https://github.com/mfussenegger/nvim-dap
|
-- https://github.com/mfussenegger/nvim-dap
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"mfussenegger/nvim-dap",
|
"mfussenegger/nvim-dap",
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
-- https://github.com/j-hui/fidget.nvim
|
-- https://github.com/j-hui/fidget.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"j-hui/fidget.nvim",
|
"j-hui/fidget.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
-- https://github.com/lewis6991/gitsigns.nvim
|
-- https://github.com/lewis6991/gitsigns.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
-- Adds git related signs to the gutter, as well as utilities for managing changes
|
-- Adds git related signs to the gutter, as well as utilities for managing changes
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
--- @module "gitsigns"
|
||||||
|
--- @type Gitsigns.Config
|
||||||
opts = {
|
opts = {
|
||||||
signs = {
|
signs = {
|
||||||
add = { text = "+" },
|
add = { text = "+" },
|
||||||
|
@ -28,6 +33,7 @@ return {
|
||||||
},
|
},
|
||||||
init = function()
|
init = function()
|
||||||
local ga = require("gitsigns.actions")
|
local ga = require("gitsigns.actions")
|
||||||
|
|
||||||
vim.keymap.set("n", "gs", ga.stage_hunk, { desc = "(Un)stage hunk" })
|
vim.keymap.set("n", "gs", ga.stage_hunk, { desc = "(Un)stage hunk" })
|
||||||
vim.keymap.set("n", "gS", ga.stage_buffer, { desc = "Stage buffer" })
|
vim.keymap.set("n", "gS", ga.stage_buffer, { desc = "Stage buffer" })
|
||||||
vim.keymap.set("v", "gs", function()
|
vim.keymap.set("v", "gs", function()
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
-- https://github.com/NMAC427/guess-indent.nvim
|
-- https://github.com/NMAC427/guess-indent.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
-- Adds a command to automatically detect the indentation settings
|
|
||||||
-- Prefer to use .editorconfig for projects and modeline for files
|
|
||||||
"NMAC427/guess-indent.nvim",
|
"NMAC427/guess-indent.nvim",
|
||||||
|
--- @module "guess-indent"
|
||||||
|
--- @type GuessIndentConfig
|
||||||
opts = {},
|
opts = {},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
-- https://github.com/smjonas/inc-rename.nvim
|
-- https://github.com/smjonas/inc-rename.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"smjonas/inc-rename.nvim",
|
"smjonas/inc-rename.nvim",
|
||||||
|
--- @module "inc_rename"
|
||||||
|
--- @type inc_rename.UserConfig
|
||||||
opts = {
|
opts = {
|
||||||
preview_empty_name = true,
|
preview_empty_name = true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
-- https://github.com/lukas-reineke/indent-blankline.nvim
|
-- https://github.com/lukas-reineke/indent-blankline.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
-- Add indentation guides even on blank lines
|
-- Add indentation guides even on blank lines
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
-- Enable `lukas-reineke/indent-blankline.nvim`
|
-- Enable `lukas-reineke/indent-blankline.nvim`
|
||||||
-- See `:help indent_blankline.txt`
|
-- See `:help indent_blankline.txt`
|
||||||
main = "ibl",
|
main = "ibl",
|
||||||
|
---@module "ibl"
|
||||||
|
---@type ibl.config
|
||||||
opts = {
|
opts = {
|
||||||
indent = {
|
indent = {
|
||||||
char = "¦",
|
char = "¦",
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
-- https://github.com/diogo464/kubernetes.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"diogo464/kubernetes.nvim",
|
"diogo464/kubernetes.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
-- https://github.com/folke/lazydev.nvim
|
-- https://github.com/folke/lazydev.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
{
|
"folke/lazydev.nvim",
|
||||||
"folke/lazydev.nvim",
|
ft = "lua",
|
||||||
ft = "lua",
|
--- @module "lazydev"
|
||||||
opts = {
|
--- @type lazydev.Config
|
||||||
library = {
|
opts = {
|
||||||
-- See the configuration section for more details
|
library = {
|
||||||
-- Load luvit types when the `vim.uv` word is found
|
-- See the configuration section for more details
|
||||||
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
-- Load luvit types when the `vim.uv` word is found
|
||||||
},
|
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
6
nvim/dot-config/nvim/lua/plugins/lspconfig.lua
Normal file
6
nvim/dot-config/nvim/lua/plugins/lspconfig.lua
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
-- https://github.com/neovim/nvim-lspconfig
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
|
return {
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
}
|
|
@ -8,6 +8,8 @@ local function get_schema()
|
||||||
return schema.name
|
return schema.name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
|
-- https://github.com/mason-org/mason-lspconfig.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"mason-org/mason-lspconfig.nvim",
|
"mason-org/mason-lspconfig.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
--- @module "mason-lspconfig"
|
||||||
|
--- @type MasonLspconfigSettings
|
||||||
opts = {},
|
opts = {},
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"mason-org/mason.nvim",
|
"mason-org/mason.nvim",
|
||||||
|
|
|
@ -1,86 +1,41 @@
|
||||||
|
--- https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim
|
||||||
|
local ensure_installed = {
|
||||||
|
-- LSP
|
||||||
|
"typos_lsp",
|
||||||
|
"clangd",
|
||||||
|
"basedpyright",
|
||||||
|
"lua_ls",
|
||||||
|
{
|
||||||
|
"gopls",
|
||||||
|
condition = function()
|
||||||
|
return vim.fn.executable("go") > 0
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
"jsonls",
|
||||||
|
"yamlls",
|
||||||
|
"taplo",
|
||||||
|
"neocmake",
|
||||||
|
-- Formatter
|
||||||
|
"clang-format",
|
||||||
|
"goimports",
|
||||||
|
"ruff",
|
||||||
|
"prettierd",
|
||||||
|
"stylua",
|
||||||
|
"jq",
|
||||||
|
}
|
||||||
|
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"mason-org/mason.nvim",
|
"mason-org/mason.nvim",
|
||||||
"mason-org/mason-lspconfig.nvim",
|
|
||||||
"zapling/mason-conform.nvim",
|
|
||||||
},
|
},
|
||||||
config = function()
|
opts = {
|
||||||
local lsp = require("tools.lsp")
|
ensure_installed = ensure_installed,
|
||||||
|
auto_update = true,
|
||||||
-- Convert lsp entries to consistent format
|
debounde_hours = 24,
|
||||||
local tools = {}
|
start_delay = 1000,
|
||||||
for _, tool in pairs(lsp) do
|
},
|
||||||
if type(tool) == "table" then
|
|
||||||
local name = tool[1]
|
|
||||||
local entry = {}
|
|
||||||
|
|
||||||
-- Make a copy and strip out name and lsp config
|
|
||||||
for k, v in pairs(tool) do
|
|
||||||
if k ~= 1 and k ~= 2 then
|
|
||||||
entry[k] = v
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
tools[name] = entry
|
|
||||||
else
|
|
||||||
tools[tool] = {}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Convert formatters to same format and merge on top of the lsps
|
|
||||||
local formatters_by_ft = require("conform").formatters_by_ft
|
|
||||||
local mapping = require("mason-conform.mapping")
|
|
||||||
for _, formatter in pairs(formatters_by_ft) do
|
|
||||||
if type(formatter) == "table" then
|
|
||||||
for _, tool in ipairs(formatter) do
|
|
||||||
local entry = {}
|
|
||||||
local name = nil
|
|
||||||
if type(tool) == "table" then
|
|
||||||
name = mapping.conform_to_package[tool[1]]
|
|
||||||
|
|
||||||
-- Make a copy and strip out name
|
|
||||||
for k, v in pairs(tool) do
|
|
||||||
if k ~= 1 then
|
|
||||||
entry[k] = v
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
name = mapping.conform_to_package[tool]
|
|
||||||
end
|
|
||||||
|
|
||||||
if name ~= nil then
|
|
||||||
tools[name] = vim.tbl_extend("error", tools[name] or {}, entry)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local ensure_installed = vim.iter(tools)
|
|
||||||
:map(function(name, tool)
|
|
||||||
if type(tool) == "table" then
|
|
||||||
if tool.system then
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
local entry = {
|
|
||||||
[1] = name,
|
|
||||||
}
|
|
||||||
|
|
||||||
for k, v in pairs(tool) do
|
|
||||||
entry[k] = v
|
|
||||||
end
|
|
||||||
|
|
||||||
return entry
|
|
||||||
end
|
|
||||||
return tool
|
|
||||||
end)
|
|
||||||
:totable()
|
|
||||||
|
|
||||||
require("mason-tool-installer").setup({
|
|
||||||
ensure_installed = ensure_installed,
|
|
||||||
auto_update = true,
|
|
||||||
debounde_hours = 24,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
|
-- https://github.com/mason-org/mason.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"mason-org/mason.nvim",
|
"mason-org/mason.nvim",
|
||||||
|
--- @module "mason"
|
||||||
|
--- @type MasonSettings
|
||||||
opts = {},
|
opts = {},
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
local fold = require("symbols.fold")
|
local fold = require("symbols.fold")
|
||||||
local file = require("symbols.file")
|
local file = require("symbols.file")
|
||||||
|
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
version = "v3.x",
|
version = "v3.x",
|
||||||
|
@ -15,85 +17,86 @@ return {
|
||||||
},
|
},
|
||||||
-- netrw hijack does not work when lazy loading
|
-- netrw hijack does not work when lazy loading
|
||||||
lazy = false,
|
lazy = false,
|
||||||
config = function()
|
--- @module "neo-tree"
|
||||||
require("neo-tree").setup({
|
--- @type neotree.Config
|
||||||
close_if_last_window = true,
|
opts = {
|
||||||
popup_border_style = require("symbols.window").border,
|
close_if_last_window = true,
|
||||||
source_selector = {
|
popup_border_style = require("symbols.window").border,
|
||||||
winbar = true,
|
source_selector = {
|
||||||
show_scrolled_off_parent_node = true,
|
winbar = true,
|
||||||
sources = {
|
show_scrolled_off_parent_node = true,
|
||||||
{
|
sources = {
|
||||||
source = "filesystem",
|
{
|
||||||
display_name = " Files ",
|
source = "filesystem",
|
||||||
},
|
display_name = " Files ",
|
||||||
{
|
|
||||||
source = "buffers",
|
|
||||||
display_name = " Buffers ",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source = "git_status",
|
|
||||||
display_name = " Git ",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
show_separator_on_edge = true,
|
{
|
||||||
},
|
source = "buffers",
|
||||||
default_component_configs = {
|
display_name = " Buffers ",
|
||||||
diagnostics = {
|
|
||||||
highlights = {
|
|
||||||
hint = "DiagnosticHint",
|
|
||||||
info = "DiagnosticInfo",
|
|
||||||
warn = "DiagnosticWarn",
|
|
||||||
error = "DiagnosticError",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
icon = {
|
{
|
||||||
folder_closed = fold.closed,
|
source = "git_status",
|
||||||
folder_open = fold.open,
|
display_name = " Git ",
|
||||||
folder_empty = fold.empty,
|
|
||||||
default = file.icon,
|
|
||||||
},
|
|
||||||
modified = {
|
|
||||||
symbol = file.modified,
|
|
||||||
},
|
|
||||||
name = {
|
|
||||||
use_git_status_colors = false,
|
|
||||||
},
|
|
||||||
git_status = {
|
|
||||||
symbols = require("symbols.git"),
|
|
||||||
},
|
|
||||||
type = {
|
|
||||||
enabled = false,
|
|
||||||
},
|
|
||||||
last_modified = {
|
|
||||||
enabled = false,
|
|
||||||
},
|
|
||||||
symlink_target = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
filesystem = {
|
show_separator_on_edge = true,
|
||||||
follow_current_file = {
|
},
|
||||||
enabled = true,
|
default_component_configs = {
|
||||||
},
|
diagnostics = {
|
||||||
hijack_netrw_behavior = "open_current",
|
highlights = {
|
||||||
use_libuv_file_watcher = true,
|
hint = "DiagnosticHint",
|
||||||
scan_mode = "deep",
|
info = "DiagnosticInfo",
|
||||||
},
|
warn = "DiagnosticWarn",
|
||||||
window = {
|
error = "DiagnosticError",
|
||||||
popup = {
|
|
||||||
title = function(state)
|
|
||||||
return ""
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
position = "float",
|
|
||||||
mappings = {
|
|
||||||
["<C-c>"] = "close_window",
|
|
||||||
["<esc>"] = "close_window",
|
|
||||||
["<tab>"] = "next_source",
|
|
||||||
["<S-tab>"] = "prev_source",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
icon = {
|
||||||
end,
|
folder_closed = fold.closed,
|
||||||
|
folder_open = fold.open,
|
||||||
|
folder_empty = fold.empty,
|
||||||
|
folder_empty_open = fold.open,
|
||||||
|
default = file.icon,
|
||||||
|
},
|
||||||
|
modified = {
|
||||||
|
symbol = file.modified,
|
||||||
|
},
|
||||||
|
name = {
|
||||||
|
use_git_status_colors = false,
|
||||||
|
},
|
||||||
|
git_status = {
|
||||||
|
symbols = require("symbols.git"),
|
||||||
|
},
|
||||||
|
type = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
last_modified = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
symlink_target = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filesystem = {
|
||||||
|
follow_current_file = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
hijack_netrw_behavior = "open_current",
|
||||||
|
use_libuv_file_watcher = true,
|
||||||
|
scan_mode = "deep",
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
popup = {
|
||||||
|
title = function()
|
||||||
|
return ""
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
position = "float",
|
||||||
|
mappings = {
|
||||||
|
["<C-c>"] = "close_window",
|
||||||
|
["<esc>"] = "close_window",
|
||||||
|
["<tab>"] = "next_source",
|
||||||
|
["<S-tab>"] = "prev_source",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
-- https://github.com/toppair/peek.nvim
|
-- https://github.com/toppair/peek.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"toppair/peek.nvim",
|
"toppair/peek.nvim",
|
||||||
build = "deno task --quiet build:fast",
|
build = "deno task --quiet build:fast",
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
-- https://github.com/tadachs/ros-nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"tadachs/ros-nvim",
|
"tadachs/ros-nvim",
|
||||||
opts = {
|
opts = {
|
||||||
|
|
|
@ -1,32 +1,36 @@
|
||||||
local kubernetes = {}
|
-- https://github.com/cenk1cenk2/schema-companion.nvim
|
||||||
kubernetes.name = "Kubernetes"
|
--- @module "schema-companion"
|
||||||
|
--- @type schema_companion.Matcher
|
||||||
|
local kubernetes = {
|
||||||
|
name = "Kubernetes",
|
||||||
|
match = function(bufnr)
|
||||||
|
local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
|
||||||
|
local kind = false
|
||||||
|
local api_version = false
|
||||||
|
|
||||||
---@type schema_companion.MatcherMatchFn
|
for _, line in ipairs(lines) do
|
||||||
kubernetes.match = function(bufnr)
|
if kind or vim.regex("^kind: .*$"):match_str(line) then
|
||||||
local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
|
kind = true
|
||||||
local kind = false
|
end
|
||||||
local api_version = false
|
|
||||||
|
|
||||||
for _, line in ipairs(lines) do
|
if api_version or vim.regex("^apiVersion: .*$"):match_str(line) then
|
||||||
if kind or vim.regex("^kind: .*$"):match_str(line) then
|
api_version = true
|
||||||
kind = true
|
end
|
||||||
|
|
||||||
|
if kind and api_version then
|
||||||
|
return {
|
||||||
|
name = "Kubernetes",
|
||||||
|
uri = require("kubernetes").yamlls_schema(),
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if api_version or vim.regex("^apiVersion: .*$"):match_str(line) then
|
return nil
|
||||||
api_version = true
|
end,
|
||||||
end
|
}
|
||||||
|
|
||||||
if kind and api_version then
|
|
||||||
return {
|
|
||||||
name = "Kubernetes",
|
|
||||||
uri = require("kubernetes").yamlls_schema(),
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"cenk1cenk2/schema-companion.nvim",
|
"cenk1cenk2/schema-companion.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
|
@ -34,31 +38,21 @@ return {
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
"diogo464/kubernetes.nvim",
|
"diogo464/kubernetes.nvim",
|
||||||
},
|
},
|
||||||
config = function()
|
init = function()
|
||||||
require("schema-companion").setup({
|
|
||||||
enable_telescope = true,
|
|
||||||
matchers = {
|
|
||||||
kubernetes,
|
|
||||||
},
|
|
||||||
schemas = {},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- TODO: Set on lsp attach with filetype yaml?
|
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
"n",
|
"n",
|
||||||
"<leader>ss",
|
"<leader>ys",
|
||||||
require("telescope").extensions.schema_companion.select_schema,
|
require("telescope").extensions.schema_companion.select_schema,
|
||||||
{ desc = "Select schema" }
|
{ desc = "Yaml schema" }
|
||||||
)
|
|
||||||
|
|
||||||
vim.lsp.config(
|
|
||||||
"yamlls",
|
|
||||||
require("schema-companion").setup_client({
|
|
||||||
single_file_support = true,
|
|
||||||
settings = {
|
|
||||||
yaml = {},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
)
|
)
|
||||||
end,
|
end,
|
||||||
|
--- @module "schema-companion"
|
||||||
|
--- @type schema_companion.Config
|
||||||
|
opts = {
|
||||||
|
enable_telescope = true,
|
||||||
|
matchers = {
|
||||||
|
kubernetes,
|
||||||
|
},
|
||||||
|
schemas = {},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,6 @@
|
||||||
|
-- https://github.com/b0o/schemastore.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"b0o/schemastore.nvim",
|
"b0o/schemastore.nvim",
|
||||||
config = function()
|
|
||||||
vim.lsp.config("jsonls", {
|
|
||||||
settings = {
|
|
||||||
json = {
|
|
||||||
validate = { enable = true },
|
|
||||||
schemas = require("schemastore").json.schemas(),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.lsp.config("yamlls", {
|
|
||||||
settings = {
|
|
||||||
yaml = {
|
|
||||||
-- Using the schemastore plugin for schemas.
|
|
||||||
schemastore = { enable = false, url = "" },
|
|
||||||
schemas = require("schemastore").yaml.schemas(),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
-- https://github.com/mrjones2014/smart-splits.nvim
|
-- https://github.com/mrjones2014/smart-splits.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"mrjones2014/smart-splits.nvim",
|
"mrjones2014/smart-splits.nvim",
|
||||||
config = function()
|
opts = {
|
||||||
|
at_edge = "stop",
|
||||||
|
cursor_follows_swapped_bufs = true,
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
vim.keymap.set("n", "<M-h>", require("smart-splits").move_cursor_left)
|
vim.keymap.set("n", "<M-h>", require("smart-splits").move_cursor_left)
|
||||||
vim.keymap.set("n", "<M-j>", require("smart-splits").move_cursor_down)
|
vim.keymap.set("n", "<M-j>", require("smart-splits").move_cursor_down)
|
||||||
vim.keymap.set("n", "<M-k>", require("smart-splits").move_cursor_up)
|
vim.keymap.set("n", "<M-k>", require("smart-splits").move_cursor_up)
|
||||||
|
@ -16,10 +22,5 @@ return {
|
||||||
vim.keymap.set("n", "<M-down>", require("smart-splits").resize_down, { desc = "Resize buffer to the bottom" })
|
vim.keymap.set("n", "<M-down>", require("smart-splits").resize_down, { desc = "Resize buffer to the bottom" })
|
||||||
vim.keymap.set("n", "<M-up>", require("smart-splits").resize_up, { desc = "Resize buffer to the top" })
|
vim.keymap.set("n", "<M-up>", require("smart-splits").resize_up, { desc = "Resize buffer to the top" })
|
||||||
vim.keymap.set("n", "<M-right>", require("smart-splits").resize_right, { desc = "Resize buffer to the right" })
|
vim.keymap.set("n", "<M-right>", require("smart-splits").resize_right, { desc = "Resize buffer to the right" })
|
||||||
|
|
||||||
require("smart-splits").setup({
|
|
||||||
at_edge = "stop",
|
|
||||||
cursor_follows_swapped_bufs = true,
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
-- https://github.com/kylechui/nvim-surround
|
-- https://github.com/kylechui/nvim-surround
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"kylechui/nvim-surround",
|
"kylechui/nvim-surround",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = true,
|
--- @module "nvim-surround"
|
||||||
|
--- @type user_options
|
||||||
|
opts = {
|
||||||
|
move_cursor = "sticky",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
-- https://github.com/simrat39/symbols-outline.nvim
|
-- https://github.com/simrat39/symbols-outline.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
enabled = false,
|
enabled = false,
|
||||||
"simrat39/symbols-outline.nvim",
|
"simrat39/symbols-outline.nvim",
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
-- https://github.com/nvim-telescope/telescope.nvim
|
-- https://github.com/nvim-telescope/telescope.nvim
|
||||||
local window = require("symbols.window")
|
local window = require("symbols.window")
|
||||||
-- TODO: Ensure installed ripgrep
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
|
@ -14,51 +15,35 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function()
|
opts = {
|
||||||
require("telescope").setup({
|
pickers = {
|
||||||
|
find_files = {
|
||||||
pickers = {
|
hidden = true,
|
||||||
find_files = {
|
},
|
||||||
hidden = true,
|
},
|
||||||
|
defaults = {
|
||||||
|
file_ignore_patterns = {
|
||||||
|
".git/",
|
||||||
|
},
|
||||||
|
mappings = {
|
||||||
|
n = {
|
||||||
|
["<Tab>"] = "move_selection_worse",
|
||||||
|
["<S-Tab>"] = "move_selection_better",
|
||||||
|
},
|
||||||
|
i = {
|
||||||
|
["<Tab>"] = "move_selection_worse",
|
||||||
|
["<S-Tab>"] = "move_selection_better",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
defaults = {
|
borderchars = window.borderchars,
|
||||||
file_ignore_patterns = {
|
},
|
||||||
".git/",
|
extensions = {
|
||||||
},
|
["ui-select"] = {
|
||||||
mappings = {
|
require("telescope.themes").get_dropdown(),
|
||||||
n = {
|
|
||||||
["<Tab>"] = "move_selection_worse",
|
|
||||||
["<S-Tab>"] = "move_selection_better",
|
|
||||||
},
|
|
||||||
i = {
|
|
||||||
["<Tab>"] = "move_selection_worse",
|
|
||||||
["<S-Tab>"] = "move_selection_better",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
borderchars = window.borderchars,
|
|
||||||
},
|
},
|
||||||
extensions = {
|
},
|
||||||
["ui-select"] = {
|
},
|
||||||
require("telescope.themes").get_dropdown(),
|
init = function()
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- HACK: Workaround until new borders are fixed in telescope
|
|
||||||
vim.api.nvim_create_autocmd("User", {
|
|
||||||
pattern = "TelescopeFindPre",
|
|
||||||
callback = function()
|
|
||||||
vim.opt_local.winborder = "none"
|
|
||||||
vim.api.nvim_create_autocmd("WinLeave", {
|
|
||||||
once = true,
|
|
||||||
callback = function()
|
|
||||||
vim.opt_local.winborder = window.border
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
require("telescope").load_extension("fzf")
|
require("telescope").load_extension("fzf")
|
||||||
require("telescope").load_extension("ui-select")
|
require("telescope").load_extension("ui-select")
|
||||||
|
|
||||||
|
@ -93,5 +78,19 @@ return {
|
||||||
vim.keymap.set("n", "<leader>sn", function()
|
vim.keymap.set("n", "<leader>sn", function()
|
||||||
require("telescope.builtin").find_files({ cwd = vim.fn.stdpath("config") })
|
require("telescope.builtin").find_files({ cwd = vim.fn.stdpath("config") })
|
||||||
end, { desc = "Neovim files" })
|
end, { desc = "Neovim files" })
|
||||||
|
|
||||||
|
-- HACK: Workaround until new borders are fixed in telescope
|
||||||
|
vim.api.nvim_create_autocmd("User", {
|
||||||
|
pattern = "TelescopeFindPre",
|
||||||
|
callback = function()
|
||||||
|
vim.opt_local.winborder = "none"
|
||||||
|
vim.api.nvim_create_autocmd("WinLeave", {
|
||||||
|
once = true,
|
||||||
|
callback = function()
|
||||||
|
vim.opt_local.winborder = window.border
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,49 @@
|
||||||
-- https://github.com/folke/todo-comments.nvim
|
-- https://github.com/folke/todo-comments.nvim
|
||||||
local diagnostic = require("symbols.diagnostic")
|
local diagnostic = require("symbols.diagnostic")
|
||||||
|
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
-- 'folke/todo-comments.nvim',
|
"folke/todo-comments.nvim",
|
||||||
-- NOTE: This fork highlights the entire matched word, not just the keyword.
|
|
||||||
"doongjohn/todo-comments.nvim",
|
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
},
|
},
|
||||||
config = function()
|
opts = {
|
||||||
|
keywords = {
|
||||||
|
-- FIX: Fix
|
||||||
|
FIX = { icon = diagnostic.bug },
|
||||||
|
-- TODO: Todo
|
||||||
|
TODO = { icon = diagnostic.todo },
|
||||||
|
-- HACK: Hack
|
||||||
|
HACK = { icon = diagnostic.hack },
|
||||||
|
-- WARN: Warn
|
||||||
|
WARN = { icon = diagnostic.warn },
|
||||||
|
-- PERF: Perf
|
||||||
|
PERF = { icon = diagnostic.performance },
|
||||||
|
-- NOTE: Note
|
||||||
|
NOTE = { icon = diagnostic.note },
|
||||||
|
-- TEST: Test
|
||||||
|
TEST = { icon = diagnostic.test },
|
||||||
|
},
|
||||||
|
highlight = {
|
||||||
|
-- TODO: Have multiline, but end when %p (punctuation) is at the end of a line
|
||||||
|
multiline = false,
|
||||||
|
before = "fg",
|
||||||
|
pattern = [[(KEYWORDS)\s*(\([^\)]*\))?:]],
|
||||||
|
},
|
||||||
|
search = {
|
||||||
|
pattern = [[\b(KEYWORDS)(\(.*\))?:]],
|
||||||
|
},
|
||||||
|
colors = {
|
||||||
|
error = { "TodoCommentError" },
|
||||||
|
warning = { "TodoCommentWarning" },
|
||||||
|
info = { "TodoCommentInfo" },
|
||||||
|
hint = { "TodoCommentHint" },
|
||||||
|
test = { "TodoCommentTest" },
|
||||||
|
default = { "TodoCommentDefault" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
vim.keymap.set("n", "]t", function()
|
vim.keymap.set("n", "]t", function()
|
||||||
require("todo-comments").jump_next()
|
require("todo-comments").jump_next()
|
||||||
end, { desc = "Next todo comment" })
|
end, { desc = "Next todo comment" })
|
||||||
|
@ -25,41 +60,5 @@ return {
|
||||||
if pcall(require, "telescope") then
|
if pcall(require, "telescope") then
|
||||||
vim.keymap.set("n", "<leader>st", "<cmd>TodoTelescope<cr>", { desc = "Search todo" })
|
vim.keymap.set("n", "<leader>st", "<cmd>TodoTelescope<cr>", { desc = "Search todo" })
|
||||||
end
|
end
|
||||||
|
|
||||||
require("todo-comments").setup({
|
|
||||||
keywords = {
|
|
||||||
-- FIX: Fix
|
|
||||||
FIX = { icon = diagnostic.bug },
|
|
||||||
-- TODO: Todo
|
|
||||||
TODO = { icon = diagnostic.todo },
|
|
||||||
-- HACK: Hack
|
|
||||||
HACK = { icon = diagnostic.hack },
|
|
||||||
-- WARN: Warn
|
|
||||||
WARN = { icon = diagnostic.warn },
|
|
||||||
-- PERF: Perf
|
|
||||||
PERF = { icon = diagnostic.performance },
|
|
||||||
-- NOTE: Note
|
|
||||||
NOTE = { icon = diagnostic.note },
|
|
||||||
-- TEST: Test
|
|
||||||
TEST = { icon = diagnostic.test },
|
|
||||||
},
|
|
||||||
highlight = {
|
|
||||||
-- TODO: Have multiline, but end when %p (punctuation) is at the end of a line
|
|
||||||
multiline = false,
|
|
||||||
before = "fg",
|
|
||||||
pattern = [[(KEYWORDS)\s*(\([^\)]*\))?:]],
|
|
||||||
},
|
|
||||||
search = {
|
|
||||||
pattern = [[\b(KEYWORDS)(\(.*\))?:]],
|
|
||||||
},
|
|
||||||
colors = {
|
|
||||||
error = { "TodoCommentError" },
|
|
||||||
warning = { "TodoCommentWarning" },
|
|
||||||
info = { "TodoCommentInfo" },
|
|
||||||
hint = { "TodoCommentHint" },
|
|
||||||
test = { "TodoCommentTest" },
|
|
||||||
default = { "TodoCommentDefault" },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
|
-- https://github.com/nvim-treesitter/nvim-treesitter
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
-- Highlight, edit, and navigate code
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{ "nvim-treesitter/nvim-treesitter-textobjects", branch = "master" },
|
{ "nvim-treesitter/nvim-treesitter-textobjects", branch = "master" },
|
||||||
|
@ -10,8 +12,29 @@ return {
|
||||||
branch = "master",
|
branch = "master",
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
main = "nvim-treesitter.configs",
|
main = "nvim-treesitter.configs",
|
||||||
|
init = function()
|
||||||
|
vim.wo.foldmethod = "expr"
|
||||||
|
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||||
|
end,
|
||||||
|
--- @module "nvim-treesitter"
|
||||||
|
--- @type TSConfig
|
||||||
opts = {
|
opts = {
|
||||||
ensure_installed = require("tools.highlight"),
|
ensure_installed = {
|
||||||
|
"c",
|
||||||
|
"cpp",
|
||||||
|
"go",
|
||||||
|
"lua",
|
||||||
|
"python",
|
||||||
|
"rust",
|
||||||
|
"tsx",
|
||||||
|
"typescript",
|
||||||
|
"vimdoc",
|
||||||
|
"vim",
|
||||||
|
"markdown",
|
||||||
|
"markdown_inline",
|
||||||
|
"bash",
|
||||||
|
"sql",
|
||||||
|
},
|
||||||
|
|
||||||
highlight = { enable = true },
|
highlight = { enable = true },
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
|
|
|
@ -1,19 +1,21 @@
|
||||||
-- https://github.com/folke/trouble.nvim
|
-- https://github.com/folke/trouble.nvim
|
||||||
local fold = require("symbols.fold")
|
local fold = require("symbols.fold")
|
||||||
|
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"folke/trouble.nvim",
|
"folke/trouble.nvim",
|
||||||
cmd = { "Trouble", "TroubleToggle" },
|
cmd = { "Trouble", "TroubleToggle" },
|
||||||
keys = {
|
keys = {
|
||||||
{ "<F3>", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Goto previous buffer" },
|
{ "<F3>", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Goto previous buffer" },
|
||||||
},
|
},
|
||||||
config = function()
|
--- @module "trouble"
|
||||||
require("trouble").setup({
|
--- @type trouble.Config
|
||||||
icons = false,
|
opts = {
|
||||||
auto_close = true,
|
icons = false,
|
||||||
fold_open = fold.open, -- icon used for open folds
|
auto_close = true,
|
||||||
fold_closed = fold.close, -- icon used for closed folds
|
fold_open = fold.open, -- icon used for open folds
|
||||||
use_diagnostic_signs = true,
|
fold_closed = fold.close, -- icon used for closed folds
|
||||||
})
|
use_diagnostic_signs = true,
|
||||||
end,
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
-- https://github.com/mbbill/undotree
|
-- https://github.com/mbbill/undotree
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
'mbbill/undotree',
|
"mbbill/undotree",
|
||||||
keys = {
|
keys = {
|
||||||
{ '<F6>', vim.cmd.UndotreeToggle, desc = 'Toggle undotree' },
|
{ "<F6>", vim.cmd.UndotreeToggle, desc = "Toggle undotree" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,18 @@
|
||||||
-- https://github.com/folke/which-key.nvim
|
-- https://github.com/folke/which-key.nvim
|
||||||
|
local window = require("symbols.window")
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"folke/which-key.nvim",
|
"folke/which-key.nvim",
|
||||||
|
--- @module "which-key"
|
||||||
|
--- @type wk.Opts
|
||||||
opts = {
|
opts = {
|
||||||
preset = "modern",
|
preset = "modern",
|
||||||
delay = function(ctx)
|
delay = function(ctx)
|
||||||
return ctx.plugin and 0 or 500
|
return ctx.plugin and 0 or 500
|
||||||
end,
|
end,
|
||||||
win = {
|
win = {
|
||||||
border = "single",
|
border = window.border,
|
||||||
padding = { 1, 1 },
|
padding = { 1, 1 },
|
||||||
title = false,
|
title = false,
|
||||||
},
|
},
|
||||||
|
@ -45,7 +50,6 @@ return {
|
||||||
sort = { "alphanum" },
|
sort = { "alphanum" },
|
||||||
},
|
},
|
||||||
init = function()
|
init = function()
|
||||||
-- TODO: Only make a category show up if there actually are any keybinds under it
|
|
||||||
require("which-key").add({
|
require("which-key").add({
|
||||||
{ "<leader>b", group = "Buffer" },
|
{ "<leader>b", group = "Buffer" },
|
||||||
{ "<leader>d", group = "Doument" },
|
{ "<leader>d", group = "Doument" },
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
-- https://github.com/ellisonleao/gruvbox.nvim
|
-- https://github.com/ellisonleao/gruvbox.nvim
|
||||||
|
--- @module "lazy"
|
||||||
|
--- @type LazySpec
|
||||||
return {
|
return {
|
||||||
"ellisonleao/gruvbox.nvim",
|
"ellisonleao/gruvbox.nvim",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
return {
|
|
||||||
c = { "clang-format" },
|
|
||||||
cpp = { "clang-format" },
|
|
||||||
go = { "goimports", "gofmt" },
|
|
||||||
python = { "ruff_organize_imports", "ruff_format" },
|
|
||||||
rust = { { "rustfmt", system = true } },
|
|
||||||
javascript = { "prettierd" },
|
|
||||||
javascriptreact = { "prettierd" },
|
|
||||||
typescript = { "prettierd" },
|
|
||||||
typescriptreact = { "prettierd" },
|
|
||||||
css = { "prettierd" },
|
|
||||||
markdown = { "prettierd" },
|
|
||||||
yaml = { "prettierd" },
|
|
||||||
lua = { "stylua" },
|
|
||||||
json = { "jq" },
|
|
||||||
toml = { "taplo" },
|
|
||||||
-- ["*"] = { "injected" },
|
|
||||||
["_"] = { "trim_whitespace", "trim_newlines" },
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
return {
|
|
||||||
"c",
|
|
||||||
"cpp",
|
|
||||||
"go",
|
|
||||||
"lua",
|
|
||||||
"python",
|
|
||||||
"rust",
|
|
||||||
"tsx",
|
|
||||||
"typescript",
|
|
||||||
"vimdoc",
|
|
||||||
"vim",
|
|
||||||
"markdown",
|
|
||||||
"markdown_inline",
|
|
||||||
"bash",
|
|
||||||
"sql",
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
return {
|
|
||||||
{
|
|
||||||
"rust_analyzer",
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
["rust-analyzer"] = {
|
|
||||||
check = {
|
|
||||||
command = "clippy",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
system = "rust-analyzer",
|
|
||||||
},
|
|
||||||
{ "typos_lsp", {
|
|
||||||
init_options = {
|
|
||||||
diagnosticSeverity = "Hint",
|
|
||||||
},
|
|
||||||
} },
|
|
||||||
{ "clangd", {
|
|
||||||
cmd = { "clangd", "--offset-encoding=utf-16", "--clang-tidy" },
|
|
||||||
} },
|
|
||||||
"basedpyright",
|
|
||||||
{
|
|
||||||
"lua_ls",
|
|
||||||
{
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
workspace = { checkThirdParty = false },
|
|
||||||
telemetry = { enable = false },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"gopls",
|
|
||||||
condition = function()
|
|
||||||
return vim.fn.executable("go") > 0
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
"jsonls",
|
|
||||||
"yamlls",
|
|
||||||
"taplo",
|
|
||||||
"neocmake",
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user