removed workarounds for old vim version

This commit is contained in:
2022-10-02 21:27:44 +02:00
parent 4bbf17633d
commit f9d34430ae
2 changed files with 25 additions and 60 deletions

View File

@@ -63,18 +63,10 @@ local on_attach = function(client, bufnr)
-- Set some keybinds conditional on server capabilities
if client.server_capabilities.documentFormattingProvider then
if vim.version().minor >= 8 then
vim.keymap.set('n', '<space>f', vim.lsp.buf.format, opts)
else
vim.keymap.set('n', '<space>f', vim.lsp.buf.formatting, opts)
end
vim.keymap.set('n', '<space>f', vim.lsp.buf.format, opts)
end
if client.server_capabilities.documentRangeFormattingProvider then
if vim.version().minor >= 8 then
vim.keymap.set('v', '<space>f', vim.lsp.buf.format, opts)
else
vim.keymap.set('v', '<space>f', vim.lsp.buf.range_formatting, opts)
end
vim.keymap.set('v', '<space>f', vim.lsp.buf.range_formatting, opts)
end
-- Set autocommands conditional on server_capabilities