summaryrefslogtreecommitdiffstats
path: root/lua/conf/plugins/blink.lua
diff options
context:
space:
mode:
authorSquibid <me@zacharyscheiman.com>2025-05-08 18:18:34 -0500
committerSquibid <me@zacharyscheiman.com>2025-05-08 18:18:34 -0500
commit7430ebed8eab0364452a6cdcaa209f8a7288e44d (patch)
treecd80b99c41c4af92c7a130fe52ca462062697d22 /lua/conf/plugins/blink.lua
parent7c3289fded1f75f6e060f56bd06edc2a327744d9 (diff)
downloadnvim-7430ebed8eab0364452a6cdcaa209f8a7288e44d.tar.gz
nvim-7430ebed8eab0364452a6cdcaa209f8a7288e44d.tar.bz2
nvim-7430ebed8eab0364452a6cdcaa209f8a7288e44d.zip
kitchen sink now don't support any version lower than 0.11.0 for lspv3.0
- dap now works for java and c
Diffstat (limited to 'lua/conf/plugins/blink.lua')
-rw-r--r--lua/conf/plugins/blink.lua125
1 files changed, 125 insertions, 0 deletions
diff --git a/lua/conf/plugins/blink.lua b/lua/conf/plugins/blink.lua
new file mode 100644
index 0000000..f76d4ee
--- /dev/null
+++ b/lua/conf/plugins/blink.lua
@@ -0,0 +1,125 @@
+return { "Saghen/blink.cmp",
+ branch = "v1.2.0",
+ requires = {
+ "xzbdmw/colorful-menu.nvim",
+ "L3MON4D3/LuaSnip"
+ },
+ function()
+ local colormenu = require("colorful-menu")
+ require("blink.cmp").setup {
+ keymap = {
+ preset = "none", -- I don't like the default documentation scroll binds
+ ["<C-y>"] = { "select_and_accept" },
+ ["<C-n>"] = { "select_next", "fallback_to_mappings" },
+ ["<C-p>"] = { "select_prev", "fallback_to_mappings" },
+
+ ["<C-u>"] = { "scroll_documentation_up", "fallback" },
+ ["<C-d>"] = { "scroll_documentation_down", "fallback" }
+ },
+
+ completion = {
+ menu = {
+ scrollbar = false,
+ border = vim.g.border_style,
+ draw = {
+ columns = {
+ { "kind_icon" },
+ { "label", "label_description", gap = 1 },
+ { "kind" }
+ },
+
+ -- blink.cmp should not take this much damn work to make it look
+ -- semi-decent
+ components = {
+ -- we replace the kind icon with the an icon for the source
+ kind_icon = {
+ text = function(ctx)
+ local menu_icon = {
+ "?", -- fallback
+ lsp = "λ",
+ snippets = "%",
+ buffer = "@",
+ path = "#",
+ cmdline = "$"
+ }
+
+ local icon = menu_icon[ctx.source_id]
+ if icon == nil then
+ icon = menu_icon[1]
+ end
+
+ return icon
+ end,
+ highlight = function(_)
+ return { { group = "CmpItemMenu" } }
+ end
+ },
+ label = {
+ text = function(ctx)
+ return colormenu.blink_components_text(ctx)
+ end,
+ highlight = function(ctx)
+ return colormenu.blink_components_highlight(ctx)
+ end
+ },
+ kind = {
+ -- these highlights are technically for nvim-cmp, but they're
+ -- built into my colorscheme so I don"t mind using them here
+ highlight = function(ctx)
+ return {
+ { group = "CmpItemKind"..ctx.kind, priority = 20000 }
+ }
+ end
+ }
+ }
+ }
+ },
+
+ ghost_text = {
+ enabled = true
+ },
+
+ -- documentation should show up immediately
+ documentation = {
+ auto_show = true,
+ auto_show_delay_ms = 0,
+ window = {
+ border = vim.g.border_style
+ }
+ }
+ },
+
+ -- I like the default command line completion
+ cmdline = {
+ enabled = false
+ },
+
+ -- signature support is necessary
+ signature = {
+ enabled = true,
+ window = {
+ border = vim.g.border_style
+ }
+ },
+
+ -- TODO: find a way to make my fancy luasnip snippets with multiple
+ -- triggers not look stupid e.g. "fn\|main" for a function that could
+ -- be triggered by fn or main
+ snippets = {
+ preset = "luasnip"
+ },
+
+ sources = {
+ default = { "lsp", "path", "snippets", "buffer" }
+ },
+
+ fuzzy = {
+ implementation = "prefer_rust_with_warning",
+ sorts = {
+ "score",
+ "sort_text"
+ }
+ }
+ }
+ end
+}