diff --git a/lua/conf-nvim-cmp.lua b/lua/conf-nvim-cmp.lua index 0ad2b1b..0b0adba 100644 --- a/lua/conf-nvim-cmp.lua +++ b/lua/conf-nvim-cmp.lua @@ -9,8 +9,8 @@ cmp.setup({ end, }, window = { - -- completion = cmp.config.window.bordered(), - -- documentation = cmp.config.window.bordered(), + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), }, mapping = cmp.mapping.preset.insert({ [''] = 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(':', { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ { name = 'path' } }, { - { name = 'cmdline' } + { + name = 'cmdline', + option = { + ignore_cmds = { 'Man', '!' } + } + } }) }) diff --git a/lua/my-lspconfig.lua b/lua/my-lspconfig.lua index 94fcf26..d39556f 100644 --- a/lua/my-lspconfig.lua +++ b/lua/my-lspconfig.lua @@ -97,10 +97,9 @@ local cfg = { 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, - capabilities = capabilities, -} +----------------- +-- attaching all lsp servers, order matters (for example in autocompletion) +----------------- require 'lspconfig'.pylsp.setup { on_attach = on_attach, capabilities = capabilities @@ -127,7 +126,7 @@ require 'lspconfig'.pylsp.setup { pyflakes = { enabled = true }, pyodestyle = { enabled = true }, pydocstyle = { - enabled = false, + enabled = true, ignore = { 'D100', -- disable missing module docstring info '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 { on_attach = on_attach, capabilities = capabilities, @@ -237,7 +244,3 @@ require 'lspconfig'.marksman.setup { on_attach = on_attach, capabilities = capabilities, } -require'lspconfig'.jedi_language_server.setup{ - on_attach = on_attach, - capabilities = capabilities, -} diff --git a/lua/packer-setup.lua b/lua/packer-setup.lua index 8343e6e..f34d62b 100644 --- a/lua/packer-setup.lua +++ b/lua/packer-setup.lua @@ -9,6 +9,8 @@ return require('packer').startup(function(use) use 'neovim/nvim-lspconfig' use 'hrsh7th/cmp-nvim-lsp' use 'hrsh7th/cmp-buffer' + use 'hrsh7th/cmp-cmdline' + use 'hrsh7th/cmp-path' use 'hrsh7th/nvim-cmp' use 'williamboman/mason.nvim' use 'williamboman/mason-lspconfig.nvim' @@ -20,7 +22,6 @@ return require('packer').startup(function(use) use 'petertriho/nvim-scrollbar' use 'kevinhwang91/nvim-hlslens' use 'windwp/nvim-ts-autotag' - use 'hrsh7th/cmp-path' use { 'L3MON4D3/LuaSnip', tag = '*' } use 'saadparwaiz1/cmp_luasnip' use 'lambdalisue/suda.vim'