Skip to content

Commit

Permalink
feat(nvim): minor config tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sioodmy committed Aug 18, 2024
1 parent fdbbcc2 commit 5b545bc
Showing 1 changed file with 45 additions and 6 deletions.
51 changes: 45 additions & 6 deletions shell/configs/nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ require("cokeline").setup({
return buffer.is_hovered and not buffer.is_focused
end,
},
{
text = "|",
on_click = function(_, _, _, _, buffer)
buffer:delete()
end,
},
{
text = " ",
},
Expand Down Expand Up @@ -178,6 +172,36 @@ npairs.setup({

local cmp_autopairs = require("nvim-autopairs.completion.cmp")

local kind_icons = {
Text = "󰉿",
Method = "m",
Function = "󰊕",
Constructor = "",
Field = "",
Variable = "󰆧",
Class = "󰌗",
Interface = "",
Module = "",
Property = "",
Unit = "",
Value = "󰎠",
Enum = "",
Keyword = "󰌋",
Snippet = "",
Color = "󰏘",
File = "󰈙",
Reference = "",
Folder = "󰉋",
EnumMember = "",
Constant = "󰇽",
Struct = "",
Event = "",
Operator = "󰆕",
TypeParameter = "󰊄",
Codeium = "󰚩",
Copilot = "",
}

local cmp = require("cmp")
local luasnip = require("luasnip")

Expand Down Expand Up @@ -213,6 +237,21 @@ cmp.setup({
luasnip.lsp_expand(args.body)
end,
},
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)
vim_item.kind = kind_icons[vim_item.kind]
vim_item.menu = ({
nvim_lsp = "",
nvim_lua = "",
luasnip = "",
buffer = "",
path = "",
emoji = "",
})[entry.source.name]
return vim_item
end,
},
sources = cmp.config.sources({
{ name = "nvim_lsp", keyword_length = 1 },
{ name = "buffer", keyword_length = 3 },
Expand Down

0 comments on commit 5b545bc

Please sign in to comment.