using nvim-autopairs instead of autoclose

This commit is contained in:
Daniel Weber 2024-06-21 10:40:59 -04:00
parent 03b5fffc72
commit ab433893d1
3 changed files with 15 additions and 8 deletions

View File

@ -1,5 +1,8 @@
require("autoclose").setup({ -- If you want insert `(` after select function or method item
keys = { local cmp_autopairs = require('nvim-autopairs.completion.cmp')
[">"] = { escape = false, close = false, pair = "<>", disabled_filetypes = {} }, local cmp = require('cmp')
}, cmp.event:on(
}) 'confirm_done',
cmp_autopairs.on_confirm_done()
)

View File

@ -18,7 +18,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
bufmap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>') bufmap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>')
-- Jumps to the definition of the type symbol -- Jumps to the definition of the type symbol
bufmap('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>') bufmap('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>')
-- Lists all the references -- Lists all the references
bufmap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>') bufmap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>')
-- Displays a function's signature information -- Displays a function's signature information
bufmap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<cr>') bufmap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<cr>')
@ -35,7 +35,7 @@ local capabilities = require('cmp_nvim_lsp').default_capabilities()
require('mason').setup({}) require('mason').setup({})
require('mason-lspconfig').setup({ require('mason-lspconfig').setup({
ensure_installed = {'lua_ls', 'jedi_language_server', 'rust_analyzer', 'clangd' }, ensure_installed = {'lua_ls', 'pyright', 'rust_analyzer', 'clangd' },
handlers = { handlers = {
require('lspconfig').clangd.setup({ require('lspconfig').clangd.setup({
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto","hpp"}, filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto","hpp"},
@ -48,9 +48,12 @@ require('mason-lspconfig').setup({
} }
}), }),
require('lspconfig').jedi_language_server.setup{ require('lspconfig').pyright.setup{
capabilities = capabilities, capabilities = capabilities,
}, },
-- require('lspconfig').jedi_language_server.setup{
-- capabilities = capabilities,
-- },
require('lspconfig').lua_ls.setup{ require('lspconfig').lua_ls.setup{
capabilities = capabilities, capabilities = capabilities,
-- settings = { -- settings = {

View File

@ -45,6 +45,7 @@ require("lazy").setup({
'rafamadriz/friendly-snippets', 'rafamadriz/friendly-snippets',
'saadparwaiz1/cmp_luasnip', 'saadparwaiz1/cmp_luasnip',
}}, }},
{'windwp/nvim-autopairs', event = "InsertEnter", config = true},
'm4xshen/autoclose.nvim', 'm4xshen/autoclose.nvim',
'lewis6991/gitsigns.nvim', 'lewis6991/gitsigns.nvim',
{'xiyaowong/transparent.nvim'}, {'xiyaowong/transparent.nvim'},