This commit is contained in:
newbie 2023-12-18 23:42:55 +08:00
parent a1c9ef545c
commit adb1e88397
2 changed files with 8 additions and 3 deletions

View File

@ -0,0 +1,3 @@
return{
}

View File

@ -35,6 +35,7 @@ local feedkey = function(key, mode)
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true) vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true)
end end
return { return {
{ {
-- lsp的config -- lsp的config
@ -42,7 +43,7 @@ return {
config = function() config = function()
require 'lspconfig'.lua_ls.setup(require('lsp.lua')) require 'lspconfig'.lua_ls.setup(require('lsp.lua'))
require 'lspconfig'.clangd.setup(require('lsp.c')) require 'lspconfig'.clangd.setup(require('lsp.c'))
-- require'lspconfig'.bash_ls.setup(require('lsp.bash')) require'lspconfig'.bash_ls.setup(require('lsp.bash'))
require 'lspconfig'.pyright.setup(require('lsp.pyright')) require 'lspconfig'.pyright.setup(require('lsp.pyright'))
G.map({ G.map({
{ 'n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>' }, { 'n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>' },
@ -166,7 +167,7 @@ return {
{ name = 'cmdline' }, { name = 'cmdline' },
}), }),
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
['<CR>'] = cmp.mapping.confirm({ select = true }), ['<CR>'] = cmp.mapping.confirm({ select = false }),
["<c-n>"] = cmp.mapping(function(fallback) ["<c-n>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_next_item() cmp.select_next_item()
@ -201,6 +202,7 @@ return {
scrollbar = true, scrollbar = true,
}, },
}, },
fomatting = { fomatting = {
fields = { "kind", "abbr", "menu" }, fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item) format = function(entry, vim_item)
@ -234,7 +236,7 @@ return {
{ name = 'buffer' }, { name = 'buffer' },
}), }),
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
['<CR>'] = cmp.mapping.confirm({ select = true }), ['<CR>'] = cmp.mapping.confirm({ select = false }),
["<c-n>"] = cmp.mapping(function(fallback) ["<c-n>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_next_item() cmp.select_next_item()