mirror of
https://github.com/zoriya/flake.git
synced 2026-08-15 18:43:42 +00:00
Disable buffer autocomplete (execpt for comment & strings)
This commit is contained in:
@@ -5,12 +5,12 @@ return {
|
||||
opts = {
|
||||
keymap = {
|
||||
preset = "default",
|
||||
['<C-space>'] = { 'show', },
|
||||
['<C-h>'] = { 'select_and_accept' },
|
||||
['<Up>'] = { 'select_prev', 'fallback' },
|
||||
['<Down>'] = { 'select_next', 'fallback' },
|
||||
['<Tab>'] = {},
|
||||
['<S-Tab>'] = {},
|
||||
["<C-space>"] = { "show", },
|
||||
["<C-h>"] = { "select_and_accept" },
|
||||
["<Up>"] = { "select_prev", "fallback" },
|
||||
["<Down>"] = { "select_next", "fallback" },
|
||||
["<Tab>"] = {},
|
||||
["S-Tab"] = {},
|
||||
},
|
||||
completion = {
|
||||
trigger = {
|
||||
@@ -33,6 +33,16 @@ return {
|
||||
download = false,
|
||||
},
|
||||
},
|
||||
sources = {
|
||||
default = function()
|
||||
local success, node = pcall(vim.treesitter.get_node)
|
||||
if success and node and (string.find(node:type(), "comment") or string.find(node:type(), "string")) then
|
||||
return { "lsp", "path", "buffer" }
|
||||
end
|
||||
|
||||
return { "lsp" }
|
||||
end,
|
||||
},
|
||||
},
|
||||
after = function(plug)
|
||||
require("blink-cmp").setup(plug.opts)
|
||||
|
||||
Reference in New Issue
Block a user