1
0
Fork 0

nvim: tune yaml

This commit is contained in:
Vladimír Dudr 2023-11-16 09:30:22 +01:00
parent 8dc8f57fc6
commit 1c4260c8b6
2 changed files with 12 additions and 0 deletions

View file

@ -155,6 +155,12 @@ local function on_attach(args) -- {{{
return { noremap = true, silent = true, buffer = args.buf, desc = desc }
end
if client.name == 'yamlls' then
vim.keymap.set('n', '<Leader>os', function()
require('yaml-companion').open_ui_select()
end, mkOpts('Select yaml schema'))
end
-- null-ls has mostly no hover and therefore trashes manpages for shell
if client.supports_method('textDocument/hover') and client.name ~= 'null-ls' then
vim.keymap.set('n', 'K', vim.lsp.buf.hover, mkOpts('LSP hover'))

View file

@ -30,6 +30,12 @@ function M.config()
local modif = kind_func(entry, vim_item)
-- folders don't exist on UNIX!
modif.kind = string.gsub(modif.kind, 'Folder', 'Directory')
local max_len = 30
local content = modif.abbr
if #content > max_len then
modif.abbr = vim.fn.strcharpart(content, 0, max_len) .. '...'
end
return modif
end,
},