install mason, lsp, cmp
This commit is contained in:
parent
87eb2cf7dd
commit
874a79859f
1 changed files with 74 additions and 0 deletions
|
@ -42,6 +42,72 @@ return require('packer').startup(function(use)
|
|||
'kana/vim-textobj-line',
|
||||
}
|
||||
|
||||
use {
|
||||
'williamboman/mason.nvim',
|
||||
requires = {
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'neovim/nvim-lspconfig',
|
||||
},
|
||||
run = ':MasonUpdate',
|
||||
config = function()
|
||||
require('mason').setup()
|
||||
require('mason-lspconfig').setup()
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
require("mason-lspconfig").setup_handlers({
|
||||
function (server_name) -- default handler
|
||||
require("lspconfig")[server_name].setup({
|
||||
capabilities = capabilities
|
||||
})
|
||||
end,
|
||||
-- Next, you can provide a dedicated handler for specific servers.
|
||||
-- For example, a handler override for the `rust_analyzer`:
|
||||
-- ["rust_analyzer"] = function ()
|
||||
-- require("rust-tools").setup {}
|
||||
-- end
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
use {
|
||||
'hrsh7th/nvim-cmp',
|
||||
requires = {
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'hrsh7th/cmp-path',
|
||||
'hrsh7th/cmp-cmdline',
|
||||
},
|
||||
config = function()
|
||||
local cmp = require('cmp')
|
||||
|
||||
cmp.setup({
|
||||
mapping = cmp.mapping.preset.insert({}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
|
||||
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline({ '/', '?' }, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
}, {
|
||||
{ name = 'cmdline' }
|
||||
})
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
use 'sheerun/vim-polyglot'
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
|
@ -77,6 +143,14 @@ return require('packer').startup(function(use)
|
|||
|
||||
use 'preservim/nerdtree'
|
||||
|
||||
use {
|
||||
'elixir-tools/elixir-tools.nvim',
|
||||
requires = { 'nvim-lua/plenary.nvim' },
|
||||
config = function()
|
||||
require('elixir').setup()
|
||||
end
|
||||
}
|
||||
|
||||
use { 'dracula/vim', as = 'dracula' }
|
||||
|
||||
-- Automatically set up your configuration after cloning packer.nvim
|
||||
|
|
Loading…
Reference in a new issue