diff options
| author | Elvis Claros Castro <elvis@claros.ar> | 2024-10-03 11:41:10 -0300 |
|---|---|---|
| committer | Elvis Claros Castro <elvis@claros.ar> | 2024-10-03 11:41:10 -0300 |
| commit | f032fb9e2fadaaec6f71aaf45ed1d94128ea45cd (patch) | |
| tree | 17bc2e9fe0a3614285b59c75ae801021d31e76df /lua/pi | |
| parent | fa3e94e60b9edc7c3620f43e207b915eae84bab0 (diff) | |
| download | nvim-conf-f032fb9e2fadaaec6f71aaf45ed1d94128ea45cd.tar.gz nvim-conf-f032fb9e2fadaaec6f71aaf45ed1d94128ea45cd.zip | |
feat: add rust tools
Diffstat (limited to 'lua/pi')
| -rw-r--r-- | lua/pi/completition/init.lua | 74 | ||||
| -rw-r--r-- | lua/pi/dap/configs/rust.old (renamed from lua/pi/dap/configs/rust.lua) | 0 | ||||
| -rw-r--r-- | lua/pi/dap/init.lua | 8 | ||||
| -rw-r--r-- | lua/pi/lsp/default.lua | 2 | ||||
| -rw-r--r-- | lua/pi/lsp/servers/rust_analyzer.old (renamed from lua/pi/lsp/servers/rust_analyzer.lua) | 0 |
5 files changed, 42 insertions, 42 deletions
diff --git a/lua/pi/completition/init.lua b/lua/pi/completition/init.lua index 418c6d2..9ac1216 100644 --- a/lua/pi/completition/init.lua +++ b/lua/pi/completition/init.lua @@ -55,28 +55,30 @@ cmp.setup { ["<c-space>"] = cmp.mapping.complete(), }, sources = { - { name = "dictionary", keyword_length = 2}, + { name = "dictionary", keyword_length = 2 }, { name = "nvim_lua" }, { name = "nvim_lsp" }, { name = "path" }, { name = "luasnip" }, { name = "copilot" }, - {name = "codeium"}, + { name = "codeium" }, -- { name = 'cmp_ai' }, - { name = 'html-css', - option = { - max_count = {}, -- not ready yet - enable_on = { - "html", - "css" - }, -- set the file types you want the plugin to work on - file_extensions = { "css", "sass", "less" }, -- set the local filetypes from which you want to derive classes - style_sheets = { - -- example of remote styles, only css no js for now - "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css", - "https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css", - } - } + { + name = "html-css", + option = { + spa = { + enable = false, -- SPA mode is disabled by default + entry_file = "index.html", -- if entry_file is omitted, it defaults to index.html in root dir + }, + max_count = {}, -- not ready yet + enable_on = { "html", "css" }, -- set the file types you want the plugin to work on + file_extensions = { "css", "sass", "less" }, -- set the local filetypes from which you want to derive classes + style_sheets = { + -- example of remote styles, only css no js for now + "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css", + "https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css", + }, + }, }, { name = "buffer", @@ -104,12 +106,12 @@ cmp.setup { }, formatting = { - format = function (entry, vim_item) + format = function(entry, vim_item) if entry.source.name == "html-css" then - vim_item.menu = entry.completion_item.menu + source_mapping["html-css"] = "[" .. entry.completion_item.provider .. "]" or "[html-css]" end local KIND_ICONS = { - Tailwind = '', + Tailwind = "", Copilot = "", Ollama = "", Text = "", @@ -140,20 +142,20 @@ cmp.setup { TypeParameter = "", OpenAI = "", TinyLlama = "", - LlamaCPP = "" + LlamaCPP = "", } - if vim_item.kind == 'Color' and entry.completion_item.documentation then + if vim_item.kind == "Color" and entry.completion_item.documentation then local _, _, r, g, b = - ---@diagnostic disable-next-line: param-type-mismatch - string.find(entry.completion_item.documentation, '^rgb%((%d+), (%d+), (%d+)') + ---@diagnostic disable-next-line: param-type-mismatch + string.find(entry.completion_item.documentation, "^rgb%((%d+), (%d+), (%d+)") if r and g and b then - local color = string.format('%02x', r) .. string.format('%02x', g) .. string.format('%02x', b) - local group = 'Tw_' .. color + local color = string.format("%02x", r) .. string.format("%02x", g) .. string.format("%02x", b) + local group = "Tw_" .. color - if vim.api.nvim_call_function('hlID', { group }) < 1 then - vim.api.nvim_command('highlight' .. ' ' .. group .. ' ' .. 'guifg=#' .. color) + if vim.api.nvim_call_function("hlID", { group }) < 1 then + vim.api.nvim_command("highlight" .. " " .. group .. " " .. "guifg=#" .. color) end vim_item.kind = KIND_ICONS.Tailwind @@ -165,18 +167,16 @@ cmp.setup { vim_item.kind = KIND_ICONS[vim_item.kind] or vim_item.kind -- Add maxwidth and ellipsis_char in the middle - local maxwidth = 20 - local ellipsis_char = '...' + local maxwidth = 50 + local ellipsis_char = "..." if #vim_item.abbr > maxwidth then local half_width = math.floor((maxwidth - #ellipsis_char) / 2) - vim_item.abbr = string.sub( - vim_item.abbr, - 1, - half_width - ) .. ellipsis_char .. string.sub(vim_item.abbr, -half_width) + vim_item.abbr = string.sub(vim_item.abbr, 1, half_width) + .. ellipsis_char + .. string.sub(vim_item.abbr, -half_width) end return vim_item - end + end, }, sorting = { @@ -198,8 +198,8 @@ vim.api.nvim_set_hl(0, "CmpItemKindCopilot", { fg = "#3426C3" }) vim.api.nvim_set_hl(0, "CmpItemKindCodeium", { fg = "#2ACDBA" }) vim.api.nvim_set_hl(0, "CmpItemKindOllama", { fg = "#FDFEFF" }) vim.api.nvim_set_hl(0, "CmpItemKindOpenAI", { fg = "#080808" }) -vim.api.nvim_set_hl(0, "CmpItemKindTinyLlama", { fg = "#DF468C"}) -vim.api.nvim_set_hl(0, "CmpItemKindLlamaCPP", { fg = "#FF8235"}) +vim.api.nvim_set_hl(0, "CmpItemKindTinyLlama", { fg = "#DF468C" }) +vim.api.nvim_set_hl(0, "CmpItemKindLlamaCPP", { fg = "#FF8235" }) -- Set configuration for specific filetype. cmp.setup.filetype("gitcommit", { diff --git a/lua/pi/dap/configs/rust.lua b/lua/pi/dap/configs/rust.old index 9ca976f..9ca976f 100644 --- a/lua/pi/dap/configs/rust.lua +++ b/lua/pi/dap/configs/rust.old diff --git a/lua/pi/dap/init.lua b/lua/pi/dap/init.lua index 327dedf..97084fd 100644 --- a/lua/pi/dap/init.lua +++ b/lua/pi/dap/init.lua @@ -10,11 +10,11 @@ for _, ft_path in ipairs(vim.api.nvim_get_runtime_file("lua/pi/dap/configs/*.lua end -- Signs -vim.fn.sign_define("DapBreakpoint", { text = "🛑", texthl = "", linehl = "", numhl = "" }) +vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "", linehl = "", numhl = "" }) vim.fn.sign_define("DapStopped", { text = "▶", texthl = "", linehl = "", numhl = "" }) -vim.fn.sign_define("DapBreakpointRejected", { text = "🚫", texthl = "", linehl = "", numhl = "" }) -vim.fn.sign_define("DapBreakpointCondition", { text = "❓", texthl = "", linehl = "", numhl = "" }) -vim.fn.sign_define("DapLogPoint", { text = "💬", texthl = "", linehl = "", numhl = "" }) +vim.fn.sign_define("DapBreakpointRejected", { text = "", texthl = "", linehl = "", numhl = "" }) +vim.fn.sign_define("DapBreakpointCondition", { text = "", texthl = "", linehl = "", numhl = "" }) +vim.fn.sign_define("DapLogPoint", { text = "", texthl = "", linehl = "", numhl = "" }) -- UI structure dapui.setup { diff --git a/lua/pi/lsp/default.lua b/lua/pi/lsp/default.lua index b2be73e..b2020db 100644 --- a/lua/pi/lsp/default.lua +++ b/lua/pi/lsp/default.lua @@ -11,7 +11,7 @@ return { lua_ls = { enable = true, neodev = true }, -- nil_ls = { enable = true }, phpactor = {enable = true }, - rust_analyzer = { enable = true }, + -- rust_analyzer = { enable = true }, svelte = { enable = true }, tailwindcss = { enable = true, filetypes = {"blade", "html", "svelte"} }, ts_ls = { enable = true }, diff --git a/lua/pi/lsp/servers/rust_analyzer.lua b/lua/pi/lsp/servers/rust_analyzer.old index 8999ef8..8999ef8 100644 --- a/lua/pi/lsp/servers/rust_analyzer.lua +++ b/lua/pi/lsp/servers/rust_analyzer.old |