
* feat(tabnine): add build cmd for Windows * fix(prettier): use prettier instead of prettierd. Too many people get truncated files. Fixes #712. See #1735 * feat: disable kind_filter for markdown and help * feat(lualine): pretty_path now highlights file basename when modified * fix(root): dont use single-file lsps for root detection. use workspaces only * feat(lualine): new root dir component that only shows when cwd != root_dir * refactor --------- Co-authored-by: edshamis <pc> Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
50 lines
1.3 KiB
Lua
50 lines
1.3 KiB
Lua
local Util = require("lazyvim.util")
|
|
|
|
return {
|
|
-- Tabnine cmp source
|
|
{
|
|
"nvim-cmp",
|
|
dependencies = {
|
|
-- Add TabNine support, make sure you run :CmpTabnineHub after installation.
|
|
{
|
|
"tzachar/cmp-tabnine",
|
|
build = Util.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh",
|
|
dependencies = "hrsh7th/nvim-cmp",
|
|
opts = {
|
|
max_lines = 1000,
|
|
max_num_results = 3,
|
|
sort = true,
|
|
},
|
|
config = function(_, opts)
|
|
require("cmp_tabnine.config"):setup(opts)
|
|
end,
|
|
},
|
|
},
|
|
---@param opts cmp.ConfigSchema
|
|
opts = function(_, opts)
|
|
table.insert(opts.sources, 1, {
|
|
name = "cmp_tabnine",
|
|
group_index = 1,
|
|
priority = 100,
|
|
})
|
|
|
|
opts.formatting.format = Util.inject.args(opts.formatting.format, function(entry, item)
|
|
-- Hide percentage in the menu
|
|
if entry.source.name == "cmp_tabnine" then
|
|
item.menu = ""
|
|
end
|
|
end)
|
|
end,
|
|
},
|
|
-- Show TabNine status in lualine
|
|
{
|
|
"nvim-lualine/lualine.nvim",
|
|
optional = true,
|
|
event = "VeryLazy",
|
|
opts = function(_, opts)
|
|
local icon = require("lazyvim.config").icons.kinds.TabNine
|
|
table.insert(opts.sections.lualine_x, 2, require("lazyvim.util").lualine.cmp_source("cmp_tabnine", icon))
|
|
end,
|
|
},
|
|
}
|