cleanup: rename module local name

lsp -> M
This commit is contained in:
David JULIEN 2021-10-12 19:08:51 +02:00
parent 83cb6c2000
commit c2e341f23e
1 changed files with 34 additions and 30 deletions

View File

@ -3,7 +3,7 @@
-- License : GPLv3 -- License : GPLv3
-- Description : neovim lsp config file -- Description : neovim lsp config file
local lsp = {} local M = {}
vim.fn.sign_define( vim.fn.sign_define(
"DiagnosticSignError", "DiagnosticSignError",
@ -38,39 +38,43 @@ vim.fn.sign_define(
} }
) )
-- symbols for autocomplete M.icons = {
vim.lsp.protocol.CompletionItemKind = { Class = "",
"", -- Text Color = "",
"", -- Method Constant = " µ ",
"", -- Function Constructor = "",
"", -- Constructor Enum = "",
"", -- Field EnumMember = "",
"", -- Variable Event = "",
"", -- Class Field = "",
"", -- Interface File = "",
"", -- Module Folder = "",
"", -- Property Function = "",
"", -- Unit Keyword = "",
"", -- Value Interface = "",
"", -- Enum Method = "",
"", -- Keyword Module = "",
"", -- Snippet Operator = "",
"", -- Color Property = "",
"", -- File Reference = "",
"", -- Reference Snippet = "",
"", -- Folder Struct = "",
"", -- EnumMember Text = "",
"", -- Constant TypeParameter = "",
"", -- Struct Unit = "",
"", -- Event Value = "",
"", -- Operator Variable = "",
"", -- TypeParameter
} }
function lsp.setup() function M.setup()
local kinds = vim.lsp.protocol.CompletionItemKind
for i, kind in ipairs(kinds) do
kinds[i] = M.icons[kind] or kind
end
local ft = vim.bo.filetype local ft = vim.bo.filetype
if ft == "cpp" then ft = "c" end if ft == "cpp" then ft = "c" end
require("lsp." .. ft) -- ./<ft>.lua require("lsp." .. ft) -- ./<ft>.lua
end end
return lsp return M