Linted all files

This commit is contained in:
Kristofers Solo
2022-08-01 08:26:03 +03:00
parent a7bec557b8
commit d68a56ae9a
37 changed files with 3225 additions and 3102 deletions

View File

@@ -1,93 +1,93 @@
local status_ok, lualine = pcall(require, 'lualine')
local status_ok, lualine = pcall(require, "lualine")
if not status_ok then
return
return
end
local hide_in_width = function()
return vim.fn.winwidth(0) > 80
return vim.fn.winwidth(0) > 80
end
local diagnostics = {
'diagnostics',
sources = { 'nvim_diagnostic' },
sections = { 'error', 'warn' },
symbols = { error = '', warn = '' },
colored = false,
update_in_insert = false,
always_visible = true,
"diagnostics",
sources = { "nvim_diagnostic" },
sections = { "error", "warn" },
symbols = { error = "", warn = "" },
colored = false,
update_in_insert = false,
always_visible = true,
}
local diff = {
'diff',
colored = false,
symbols = { added = '', modified = '', removed = '' }, -- changes diff symbols
cond = hide_in_width
"diff",
colored = false,
symbols = { added = "", modified = "", removed = "" }, -- changes diff symbols
cond = hide_in_width,
}
local mode = {
'mode',
fmt = function(str)
return '-- ' .. str .. ' --'
end,
"mode",
fmt = function(str)
return "-- " .. str .. " --"
end,
}
local filetype = {
'filetype',
icons_enabled = false,
icon = nil,
"filetype",
icons_enabled = false,
icon = nil,
}
local branch = {
'branch',
icons_enabled = true,
icon = '',
"branch",
icons_enabled = true,
icon = "",
}
local location = {
'location',
padding = 0,
"location",
padding = 0,
}
-- cool function for progress
local progress = function()
local current_line = vim.fn.line('.')
local total_lines = vim.fn.line('$')
local chars = { '__', '▁▁', '▂▂', '▃▃', '▄▄', '▅▅', '▆▆', '▇▇', '██' }
local line_ratio = current_line / total_lines
local index = math.ceil(line_ratio * #chars)
return chars[index]
local current_line = vim.fn.line(".")
local total_lines = vim.fn.line("$")
local chars = { "__", "▁▁", "▂▂", "▃▃", "▄▄", "▅▅", "▆▆", "▇▇", "██" }
local line_ratio = current_line / total_lines
local index = math.ceil(line_ratio * #chars)
return chars[index]
end
local spaces = function()
return 'spaces: ' .. vim.api.nvim_buf_get_option(0, 'shiftwidth')
return "spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
end
lualine.setup({
options = {
icons_enabled = true,
theme = 'auto',
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
disabled_filetypes = {},
always_divide_middle = true,
globalstatus = false,
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { 'filename' },
lualine_x = { 'location' },
lualine_y = {},
lualine_z = {},
},
tabline = {},
extensions = {},
options = {
icons_enabled = true,
theme = "auto",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = {},
always_divide_middle = true,
globalstatus = false,
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { "filename" },
lualine_x = { "encoding", "fileformat", "filetype" },
lualine_y = { "progress" },
lualine_z = { "location" },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
},
tabline = {},
extensions = {},
})