123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- vim.diagnostic.config({
- virtual_text = true,
- signs = true,
- update_in_insert = false,
- })
- local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
- for type, icon in pairs(signs) do
- local hl = "DiagnosticSign" .. type
- vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
- end
- local lspkind = require("lspkind")
- lspkind.init({
-
-
-
-
-
- mode = "symbol_text",
-
-
-
-
-
- preset = "codicons",
-
-
-
- symbol_map = {
- Text = "",
- Method = "",
- Function = "",
- Constructor = "",
- Field = "ﰠ",
- Variable = "",
- Class = "ﴯ",
- Interface = "",
- Module = "",
- Property = "ﰠ",
- Unit = "塞",
- Value = "",
- Enum = "",
- Keyword = "",
- Snippet = "",
- Color = "",
- File = "",
- Reference = "",
- Folder = "",
- EnumMember = "",
- Constant = "",
- Struct = "פּ",
- Event = "",
- Operator = "",
- TypeParameter = "",
- },
- })
- local lspsaga = require("lspsaga")
- lspsaga.setup({
- debug = false,
- use_saga_diagnostic_sign = true,
-
- error_sign = "",
- warn_sign = "",
- hint_sign = "",
- infor_sign = "",
- diagnostic_header_icon = " ",
-
- code_action_icon = " ",
- code_action_prompt = {
- enable = true,
- sign = true,
- sign_priority = 40,
- virtual_text = true,
- },
- finder_definition_icon = " ",
- finder_reference_icon = " ",
- max_preview_lines = 10,
- finder_action_keys = {
-
- open = "<CR>",
- vsplit = "s",
- split = "i",
-
- quit = "<ESC>",
- scroll_down = "<C-f>",
- scroll_up = "<C-b>",
- },
- code_action_keys = {
-
- quit = "<ESC>",
- exec = "<CR>",
- },
- rename_action_keys = {
-
- quit = "<ESC>",
- exec = "<CR>",
- },
- definition_preview_icon = " ",
- border_style = "single",
- rename_prompt_prefix = "➤",
- rename_output_qflist = {
- enable = false,
- auto_open_qflist = false,
- },
- server_filetype_map = {},
- diagnostic_prefix_format = "%d. ",
- diagnostic_message_format = "%m %c",
- highlight_prefix = false,
- })
- local M = {}
- M.formatting = {
- format = lspkind.cmp_format({
- mode = "symbol_text",
-
- maxwidth = 50,
-
-
- before = function(entry, vim_item)
-
- vim_item.menu = "[" .. string.upper(entry.source.name) .. "]"
- return vim_item
- end,
- }),
- }
- return M
|