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

View File

@ -63,18 +63,10 @@ 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.range_formatting, opts)
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
end end
-- Set autocommands conditional on server_capabilities -- Set autocommands conditional on server_capabilities