Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmp completion window too long #309

Closed
kulac opened this issue Aug 31, 2023 · 3 comments
Closed

Cmp completion window too long #309

kulac opened this issue Aug 31, 2023 · 3 comments

Comments

@kulac
Copy link

kulac commented Aug 31, 2023

I'm using very basic configuration and don't have a separate lsp-kind configuration

screenshot
{
    "VonHeikemen/lsp-zero.nvim",
    branch = "v2.x",
    dependencies = {
      {"neovim/nvim-lspconfig"},
      {"williamboman/mason.nvim"},
      {"williamboman/mason-lspconfig.nvim"},

      {"hrsh7th/nvim-cmp"},
      {"hrsh7th/cmp-nvim-lsp"},
      {"L3MON4D3/LuaSnip"},

      {"onsails/lspkind.nvim"}
    },
    config = function()
      local lsp = require('lsp-zero').preset({})

      lsp.on_attach(function(client, bufnr)
        lsp.default_keymaps({buffer = bufnr})
      end)

      require('lspconfig').pyright.setup({
        settings = {
          python = {
            analysis = {
              typeCheckingMode = "off"
            }
          }
        }
      })

      lsp.ensure_installed({
        "lua_ls",
        "pyright",
        "rust_analyzer"
      })

      require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())

      lsp.setup()

      local cmp = require("cmp")

      cmp.setup({
        formatting = {
          fields = {'abbr', 'kind'},
          format = require('lspkind').cmp_format({
            mode = 'symbol',
            maxwidth = 50,
            ellipsis_char = '...',
          })
        },
        mapping = {
          ['<CR>'] = cmp.mapping.confirm({select = false}),
        }
      })
    end
  },
@VonHeikemen
Copy link
Owner

Try adding 'menu' to the fields option.

    fields = {'abbr', 'kind', 'menu'},

@kulac
Copy link
Author

kulac commented Aug 31, 2023

Can i use it without menu?

@VonHeikemen
Copy link
Owner

Menu should not show up because you have mode symbol in lsp-kind.

@kulac kulac closed this as completed Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants