1
Fork 0

Sketch out tempest neovim runtime

This commit is contained in:
Matei Adriel 2023-12-07 22:35:57 +01:00
parent a456fe3781
commit 659fb33ca7
No known key found for this signature in database
18 changed files with 783 additions and 390 deletions
home/features/neovim/config/lua/my/plugins

View file

@ -30,27 +30,13 @@ local M = {
function M.on_attach(client, bufnr)
-- {{{ Keymap helpers
local opts = function(desc)
return { noremap = true, silent = true, desc = desc, buffer = bufnr }
return { silent = true, desc = desc, buffer = bufnr }
end
local nmap = function(from, to, desc)
vim.keymap.set("n", from, to, opts(desc))
end
-- }}}
-- {{{ Auto format
local function format()
vim.lsp.buf.format({ async = false, bufnr = bufnr })
end
-- if client.supports_method("textDocument/formatting") then
-- nmap("<leader>F", format, "[F]ormat")
-- vim.api.nvim_create_autocmd("BufWritePre", {
-- group = vim.api.nvim_create_augroup("LspFormatting", { clear = false }),
-- buffer = bufnr,
-- callback = format,
-- })
-- end
-- }}}
-- {{{ Go to declaration / references / implementation
nmap("gd", vim.lsp.buf.definition, "[G]o to [d]efinition")
nmap("gi", vim.lsp.buf.implementation, "[G]o to [i]mplementation")
@ -131,7 +117,7 @@ local servers = {
Lua = {
---@diagnostic disable-next-line: missing-fields
format = {
enable = true
enable = true,
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
@ -215,9 +201,9 @@ function lspconfig.config()
diagnostics_icons()
-- -- {{{ Change on-hover borders
vim.lsp.handlers["textDocument/hover"] =
vim.lsp.with(vim.lsp.handlers.hover, { border = "single" })
vim.lsp.with(vim.lsp.handlers.hover, { border = "single" })
vim.lsp.handlers["textDocument/signatureHelp"] =
vim.lsp.with(vim.lsp.handlers.signature_help, { border = "single" })
vim.lsp.with(vim.lsp.handlers.signature_help, { border = "single" })
-- -- }}}
local capabilities = M.capabilities()
@ -230,7 +216,7 @@ function lspconfig.config()
require("lspconfig")[lsp].setup({
on_attach = details.on_attach,
settings = details.settings, -- Specific per-language settings
settings = details.settings, -- Specific per-language settings
flags = {
debounce_text_changes = 150, -- This will be the default in neovim 0.7+
},