onsails / lspkind.nvim

vscode-like pictograms for neovim lsp completion items
MIT License
1.47k stars 36 forks source link

feat: limit the width of labelDetails #84

Closed OnlyWick closed 5 days ago

OnlyWick commented 1 week ago

labelDetails may be very long, it may occupy most of the screen space.

nvim-cmp config:

format = lspkind.cmp_format({
    preset = "codicons",
    mode = "symbol",
    maxwidth = 20,
    show_labelDetails = true,
    ellipsis_char = "…",
    menu = {
        buffer = "[buf]",
        nvim_lsp = "[LSP]",
        nvim_lua = "[api]",
        path = "[path]",
        luasnip = "[snip]",
        gh_issues = "[issues]",
        tn = "[TabNine]",
        eruby = "[erb]",
    },
}),

before: Too long, the document will obscure the completion information.

image

after: No obscuring situation.

image

or remove menu config.

image
OnlyWick commented 1 week ago

Just wanna like in VS Code. :-P