Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lua/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ local options = {

vim.g.have_nerd_font = true

-- no python remote plugins; skip provider host probe (~40ms shell spawn on .py files)
vim.g.loaded_python3_provider = 0

vim.opt.shortmess:append("c") -- don't give |ins-completion-menu| messages
vim.opt.iskeyword:append("-") -- hyphenated words recognized by searches
-- stylua: ignore end
Expand Down
131 changes: 131 additions & 0 deletions lua/plugins/blink.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
local kind_icons = {
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 filetypes_without_autocomplete = {
NeogitCommitMessage = true,
TelescopePrompt = true,
gitcommit = true,
markdown = true,
}

return {
"saghen/blink.cmp",
version = "*", -- use a release tag, downloads prebuilt fuzzy binary
event = { "InsertEnter", "CmdlineEnter" },
dependencies = {
"L3MON4D3/LuaSnip",
"ribru17/blink-cmp-spell",
},
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
enabled = function()
return not filetypes_without_autocomplete[vim.bo.filetype]
end,

snippets = { preset = "luasnip" },

appearance = {
kind_icons = kind_icons,
},

-- <CR> confirm (no preselect), <C-e> abort
-- <Tab> cycle forward + snippet jump, <Shift><Tab> cycle backward
keymap = {
preset = "none",
["<CR>"] = { "accept", "fallback" },
["<C-e>"] = { "hide", "fallback" },
["<Tab>"] = { "select_next", "snippet_forward", "fallback" },
["<S-Tab>"] = { "select_prev", "snippet_backward", "fallback" },
},

completion = {
list = {
-- do not select first item (mimics preselect=false, noselect)
selection = { preselect = false, auto_insert = false },
},
menu = {
border = "rounded",
draw = {
columns = {
{ "kind_icon" },
{ "label", "label_description", gap = 1 },
{ "source_name" },
},
components = {
source_name = {
text = function(ctx)
return "[" .. ctx.source_name .. "]"
end,
},
},
},
},
documentation = {
auto_show = true,
window = { border = "rounded" },
},
},

signature = {
enabled = true,
window = { border = "rounded" },
},

sources = {
default = { "lsp", "snippets", "buffer", "path", "spell" },
providers = {
lsp = { min_keyword_length = 3, max_items = 5 },
snippets = { min_keyword_length = 3, max_items = 3 },
buffer = { min_keyword_length = 3, max_items = 5 },
spell = {
name = "Spell",
module = "blink-cmp-spell",
min_keyword_length = 3,
max_items = 5,
opts = {
enable_in_context = function()
return true
end,
},
},
},
},

-- cmdline: blink defaults handle `:` `/` `?` (path + cmdline sources)
cmdline = {
keymap = { preset = "cmdline" },
completion = {
menu = { auto_show = true },
},
},

fuzzy = { implementation = "prefer_rust_with_warning" },
},
opts_extend = { "sources.default" },
}
198 changes: 0 additions & 198 deletions lua/plugins/cmp.lua

This file was deleted.

6 changes: 6 additions & 0 deletions lua/plugins/lspconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
return {
"neovim/nvim-lspconfig",
config = function()
-- advertise blink.cmp completion capabilities to every server
local ok_blink, blink = pcall(require, "blink.cmp")
if ok_blink then
vim.lsp.config("*", { capabilities = blink.get_lsp_capabilities() })
end

local path = vim.fn.stdpath("config") .. "/lua/language-servers"
local files = vim.fn.readdir(path)

Expand Down
5 changes: 5 additions & 0 deletions lua/plugins/noice.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ return {
lsp_doc_border = false, -- add a border to hover docs and signature help
},
routes = {
{
-- pyright re-analyzes on every keystroke and spams progress;
filter = { event = "lsp", kind = "progress", find = "[Pp]yright" },
opts = { skip = true },
},
{
filter = {
any = {
Expand Down
2 changes: 2 additions & 0 deletions lua/plugins/tokyonight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ local highlight = vim.api.nvim_set_hl

return {
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
opts = {
transparent = true,
style = "night",
Expand Down
Loading