add cmp-cmdline, small lsp conf fixes

This commit is contained in:
Szwendacz99 2022-12-26 09:02:42 +01:00
parent fda3d3ea1f
commit e50da7681e
3 changed files with 23 additions and 14 deletions

View file

@ -9,8 +9,8 @@ cmp.setup({
end, end,
}, },
window = { window = {
-- completion = cmp.config.window.bordered(), completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(),
}, },
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4), ['<C-b>'] = cmp.mapping.scroll_docs(-4),
@ -55,12 +55,17 @@ cmp.setup.cmdline({ '/', '?' }, {
} }
}) })
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). -- `:` cmdline setup.
cmp.setup.cmdline(':', { cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'path' } { name = 'path' }
}, { }, {
{ name = 'cmdline' } {
name = 'cmdline',
option = {
ignore_cmds = { 'Man', '!' }
}
}
}) })
}) })

View file

@ -97,10 +97,9 @@ local cfg = {
require 'lsp_signature'.setup(cfg) -- no need to specify bufnr if you don't use toggle_key require 'lsp_signature'.setup(cfg) -- no need to specify bufnr if you don't use toggle_key
require 'lspconfig'.pyright.setup { -----------------
on_attach = on_attach, -- attaching all lsp servers, order matters (for example in autocompletion)
capabilities = capabilities, -----------------
}
require 'lspconfig'.pylsp.setup { require 'lspconfig'.pylsp.setup {
on_attach = on_attach, on_attach = on_attach,
capabilities = capabilities capabilities = capabilities
@ -127,7 +126,7 @@ require 'lspconfig'.pylsp.setup {
pyflakes = { enabled = true }, pyflakes = { enabled = true },
pyodestyle = { enabled = true }, pyodestyle = { enabled = true },
pydocstyle = { pydocstyle = {
enabled = false, enabled = true,
ignore = { ignore = {
'D100', -- disable missing module docstring info 'D100', -- disable missing module docstring info
'D203', -- disable one line before class docstring required 'D203', -- disable one line before class docstring required
@ -139,6 +138,14 @@ require 'lspconfig'.pylsp.setup {
} }
} }
} }
require'lspconfig'.jedi_language_server.setup{
on_attach = on_attach,
capabilities = capabilities,
}
require 'lspconfig'.pyright.setup {
on_attach = on_attach,
capabilities = capabilities,
}
require 'lspconfig'.pyre.setup { require 'lspconfig'.pyre.setup {
on_attach = on_attach, on_attach = on_attach,
capabilities = capabilities, capabilities = capabilities,
@ -237,7 +244,3 @@ require 'lspconfig'.marksman.setup {
on_attach = on_attach, on_attach = on_attach,
capabilities = capabilities, capabilities = capabilities,
} }
require'lspconfig'.jedi_language_server.setup{
on_attach = on_attach,
capabilities = capabilities,
}

View file

@ -9,6 +9,8 @@ return require('packer').startup(function(use)
use 'neovim/nvim-lspconfig' use 'neovim/nvim-lspconfig'
use 'hrsh7th/cmp-nvim-lsp' use 'hrsh7th/cmp-nvim-lsp'
use 'hrsh7th/cmp-buffer' use 'hrsh7th/cmp-buffer'
use 'hrsh7th/cmp-cmdline'
use 'hrsh7th/cmp-path'
use 'hrsh7th/nvim-cmp' use 'hrsh7th/nvim-cmp'
use 'williamboman/mason.nvim' use 'williamboman/mason.nvim'
use 'williamboman/mason-lspconfig.nvim' use 'williamboman/mason-lspconfig.nvim'
@ -20,7 +22,6 @@ return require('packer').startup(function(use)
use 'petertriho/nvim-scrollbar' use 'petertriho/nvim-scrollbar'
use 'kevinhwang91/nvim-hlslens' use 'kevinhwang91/nvim-hlslens'
use 'windwp/nvim-ts-autotag' use 'windwp/nvim-ts-autotag'
use 'hrsh7th/cmp-path'
use { 'L3MON4D3/LuaSnip', tag = '*' } use { 'L3MON4D3/LuaSnip', tag = '*' }
use 'saadparwaiz1/cmp_luasnip' use 'saadparwaiz1/cmp_luasnip'
use 'lambdalisue/suda.vim' use 'lambdalisue/suda.vim'