removed workarounds for old vim version

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

View File

@ -1,24 +1,5 @@
if vim.version().minor >= 8 then vim.opt.laststatus = 3
local function status_line() require('lualine').setup({
local file_name = "%-.32t"
local modified = " %-m"
local right_align = "%="
local line_no = "%10([%l/%L%)]"
local pct_thru_file = "%5p%%"
return string.format(
"%s%s%s%s%s",
file_name,
modified,
right_align,
line_no,
pct_thru_file
)
end
vim.opt.laststatus = 3
-- vim.opt.winbar = status_line()
require('lualine').setup({
options = { theme = 'gruvbox' }, options = { theme = 'gruvbox' },
sections = { lualine_c = { 'getcwd', { 'filename', path = 1, file_status = true } } }, sections = { lualine_c = { 'getcwd', { 'filename', path = 1, file_status = true } } },
inactive_sections = { lualine_c = { 'getcwd', { 'filename', path = 1, file_status = true } } }, inactive_sections = { lualine_c = { 'getcwd', { 'filename', path = 1, file_status = true } } },
@ -39,12 +20,4 @@ if vim.version().minor >= 8 then
lualine_y = {}, lualine_y = {},
lualine_z = {} lualine_z = {}
}, },
}) })
else
require('lualine').setup({
options = { theme = 'gruvbox' },
sections = { lualine_c = { 'filename' } },
globalstatus = false,
-- inactive_sections = { lualine_c = { 'filename' } },
})
end

View File

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