more refinement
This commit is contained in:
BIN
nvim/.config/nvim/lua/plugins/._completion.lua
Normal file
BIN
nvim/.config/nvim/lua/plugins/._completion.lua
Normal file
Binary file not shown.
105
nvim/.config/nvim/lua/plugins/completion.lua
Normal file
105
nvim/.config/nvim/lua/plugins/completion.lua
Normal file
@@ -0,0 +1,105 @@
|
||||
return {
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
version = "v2.*",
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets",
|
||||
},
|
||||
-- install jsregexp (optional!).
|
||||
build = "make install_jsregexp",
|
||||
config = function()
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
|
||||
ls.add_snippets("lua", {
|
||||
s("hello", {
|
||||
t('print("hello world!")'),
|
||||
}),
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
-- use a release tag to download pre-built binaries
|
||||
version = "1.*",
|
||||
dependencies = {
|
||||
"moyiz/blink-emoji.nvim",
|
||||
},
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
|
||||
-- 'super-tab' for mappings similar to vscode (tab to accept)
|
||||
-- 'enter' for enter to accept
|
||||
-- 'none' for no mappings
|
||||
--
|
||||
-- All presets have the following mappings:
|
||||
-- C-space: Open menu or open docs if already open
|
||||
-- C-n/C-p or Up/Down: Select next/previous item
|
||||
-- C-e: Hide menu
|
||||
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||
--
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
keymap = { preset = "default" },
|
||||
|
||||
appearance = {
|
||||
nerd_font_variant = "mono",
|
||||
},
|
||||
|
||||
-- (Default) Only show the documentation popup when manually triggered
|
||||
completion = { documentation = { auto_show = true } },
|
||||
cmdline = {
|
||||
keymap = {
|
||||
-- recommended, as the default keymap will only show and select the next item
|
||||
["<Tab>"] = { "show", "accept" },
|
||||
},
|
||||
completion = {
|
||||
menu = { auto_show = true },
|
||||
ghost_text = { enabled = true },
|
||||
},
|
||||
},
|
||||
|
||||
snippets = { preset = "luasnip" },
|
||||
-- Default list of enabled providers defined so that you can extend it
|
||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer", "emoji" },
|
||||
providers = {
|
||||
cmdline = {
|
||||
min_keyword_length = function(ctx)
|
||||
-- when typing a command, only show when the keyword is 3 characters or longer
|
||||
if ctx.mode == "cmdline" and string.find(ctx.line, " ") == nil then
|
||||
return 3
|
||||
end
|
||||
return 0
|
||||
end,
|
||||
},
|
||||
emoji = {
|
||||
module = "blink-emoji",
|
||||
name = "Emoji",
|
||||
score_offset = 15, -- Tune by preference
|
||||
opts = { insert = true }, -- Insert emoji (default) or complete its name
|
||||
should_show_items = function()
|
||||
return vim.tbl_contains(
|
||||
-- Enable emoji completion only for git commits and markdown.
|
||||
-- By default, enabled for all file-types.
|
||||
{ "gitcommit", "markdown" },
|
||||
vim.o.filetype
|
||||
)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
||||
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||
--
|
||||
-- See the fuzzy documentation for more information
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||
},
|
||||
opts_extend = { "sources.default" },
|
||||
},
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets",
|
||||
},
|
||||
-- install jsregexp (optional!).
|
||||
build = "make install_jsregexp",
|
||||
config = function()
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
|
||||
ls.add_snippets("lua", {
|
||||
s("hello", {
|
||||
t('print("hello world!")'),
|
||||
}),
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -43,11 +43,22 @@ return {
|
||||
"node_modules",
|
||||
"target",
|
||||
".terraform",
|
||||
".git",
|
||||
".venv",
|
||||
"Cargo.toml",
|
||||
".git",
|
||||
-- Ignore git submodules
|
||||
"^./.git/",
|
||||
"^./*/.git/",
|
||||
".gitmodules",
|
||||
".gitignore",
|
||||
".*/%.git/.*", -- Ignore any .git directories in subdirectories
|
||||
},
|
||||
hidden = true,
|
||||
-- Ignore git submodules
|
||||
follow = true,
|
||||
},
|
||||
git_files = {
|
||||
recurse_submodules = false,
|
||||
show_untracked = true,
|
||||
},
|
||||
buffers = {
|
||||
initial_mode = "normal",
|
||||
|
||||
Reference in New Issue
Block a user