优化键位设置

This commit is contained in:
cap153 2025-01-20 16:01:00 +08:00 committed by GitHub
parent ab65980ad2
commit ae1bfdf6c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,15 +10,15 @@ return {
['<C-space>'] = { 'show', 'show_documentation', 'hide_documentation' },
-- ['<C-e>'] = { 'hide' },
-- fallback命令将运行下一个非闪烁键盘映射(回车键的默认换行等操作需要)
['<CR>'] = { 'accept', 'fallback' }, -- 'select_and_accept'会选择第一项插入
['<CR>'] = { 'accept', 'fallback' }, -- 更改成'select_and_accept'会选择第一项插入
['<S-Tab>'] = { 'select_prev', 'snippet_backward', 'fallback' },
['<Tab>'] = { 'select_next', 'snippet_forward', 'fallback' },
['<Tab>'] = { 'select_next', 'snippet_forward', 'fallback' }, -- 同时存在补全列表和snippet时补全列表选择优先级更高
['<C-b>'] = { 'scroll_documentation_up', 'fallback' },
['<C-f>'] = { 'scroll_documentation_down', 'fallback' },
['<C-e>'] = { 'snippet_forward', 'fallback' },
['<C-u>'] = { 'snippet_backward', 'fallback' },
['<C-e>'] = { 'snippet_forward', 'select_next', 'fallback' }, -- 同时存在补全列表和snippet时snippet跳转优先级更高
['<C-u>'] = { 'snippet_backward', 'select_prev', 'fallback' },
},
completion = {
@ -54,10 +54,10 @@ return {
default = { 'buffer', 'lsp', 'path', 'snippets', },
providers = {
-- score_offset设置优先级数字越大优先级越高
buffer = { score_offset = 3 },
lsp = { score_offset = 2 },
path = { score_offset = 1 },
snippets = { score_offset = 4 },
buffer = { score_offset = 2 },
lsp = { score_offset = 1 },
path = { score_offset = 4 },
snippets = { score_offset = 3 },
}
},
},