chore: format all lua files
This commit is contained in:
+22
-13
@@ -34,7 +34,7 @@ vim.opt.completeopt:append({
|
||||
"noselect",
|
||||
})
|
||||
-- set nowrap
|
||||
vim.opt.matchpairs:append({ "<:>", })
|
||||
vim.opt.matchpairs:append({ "<:>" })
|
||||
-- Only relevant with wrap enabled (default)
|
||||
vim.opt.linebreak = true
|
||||
vim.opt.breakindent = true
|
||||
@@ -65,7 +65,7 @@ vim.opt.diffopt:append("closeoff")
|
||||
vim.opt.diffopt:append("internal")
|
||||
-- These make diffs easier to read, please see the following:
|
||||
-- https://vimways.org/2018/the-power-of-diff/
|
||||
vim.opt.diffopt:append({ "indent-heuristic", "algorithm:histogram", })
|
||||
vim.opt.diffopt:append({ "indent-heuristic", "algorithm:histogram" })
|
||||
vim.opt.diffopt:append("linematch:40")
|
||||
vim.opt.hlsearch = true
|
||||
vim.opt.laststatus = 2
|
||||
@@ -75,7 +75,7 @@ vim.opt.shortmess:append("a")
|
||||
vim.opt.autoread = true
|
||||
-- vim.opt.cmdheight = 0 -- To hide cmdline when not used. Disabled due to
|
||||
-- causing "Press ENTER to continue" messages for small messages.
|
||||
vim.opt.jumpoptions = {'stack', 'view', 'clean'}
|
||||
vim.opt.jumpoptions = { "stack", "view", "clean" }
|
||||
vim.opt.updatetime = 100
|
||||
vim.opt.guicursor:append("a:Cursor")
|
||||
|
||||
@@ -83,7 +83,7 @@ function _G._status_line_git()
|
||||
local status = vim.b.gitsigns_status_dict
|
||||
|
||||
if not status then
|
||||
return ''
|
||||
return ""
|
||||
end
|
||||
|
||||
local added = status.added or 0
|
||||
@@ -93,15 +93,24 @@ function _G._status_line_git()
|
||||
local parts = {}
|
||||
|
||||
if added > 0 then
|
||||
table.insert(parts, string.format("%%#GitSignsAdd#+%d%%*", status.added))
|
||||
table.insert(
|
||||
parts,
|
||||
string.format("%%#GitSignsAdd#+%d%%*", status.added)
|
||||
)
|
||||
end
|
||||
|
||||
if changed > 0 then
|
||||
table.insert(parts, string.format('%%#GitSignsChange#~%d%%*', status.changed))
|
||||
table.insert(
|
||||
parts,
|
||||
string.format("%%#GitSignsChange#~%d%%*", status.changed)
|
||||
)
|
||||
end
|
||||
|
||||
if removed > 0 then
|
||||
table.insert(parts, string.format('%%#GitSignsDelete#-%d%%*', status.removed))
|
||||
table.insert(
|
||||
parts,
|
||||
string.format("%%#GitSignsDelete#-%d%%*", status.removed)
|
||||
)
|
||||
end
|
||||
|
||||
return table.concat(parts, " ")
|
||||
@@ -120,24 +129,24 @@ function _G._status_line_diagnostics()
|
||||
end
|
||||
|
||||
if warn > 0 then
|
||||
table.insert(parts, string.format('%%#DiagnosticWarn#W%d%%*', warn))
|
||||
table.insert(parts, string.format("%%#DiagnosticWarn#W%d%%*", warn))
|
||||
end
|
||||
|
||||
if hint > 0 then
|
||||
table.insert(parts, string.format('%%#DiagnosticHint#H%d%%*', hint))
|
||||
table.insert(parts, string.format("%%#DiagnosticHint#H%d%%*", hint))
|
||||
end
|
||||
|
||||
if info > 0 then
|
||||
table.insert(parts, string.format('%%#DiagnosticInfo#I%d%%*', info))
|
||||
table.insert(parts, string.format("%%#DiagnosticInfo#I%d%%*", info))
|
||||
end
|
||||
|
||||
return table.concat(parts, " ")
|
||||
end
|
||||
|
||||
vim.opt.statusline = " %{expand('%:.')}%4( %m%) %{%v:lua._status_line_git()%} %="
|
||||
.. " %{%v:lua._status_line_diagnostics()%} "
|
||||
.. " %{&filetype} %-6.6{&fileencoding}"
|
||||
.. " %-4.4{&fileformat} %4.4(%p%%%)%6.6l:%-3.3v"
|
||||
.. " %{%v:lua._status_line_diagnostics()%} "
|
||||
.. " %{&filetype} %-6.6{&fileencoding}"
|
||||
.. " %-4.4{&fileformat} %4.4(%p%%%)%6.6l:%-3.3v"
|
||||
|
||||
vim.cmd("syntax on")
|
||||
vim.cmd("filetype plugin indent on")
|
||||
|
||||
Reference in New Issue
Block a user