2 -local icon
= require 'std.icon' 3 -local auto
= require 'std.auto' 4 -local ignored
= require 'std.ignored' 2 +local icon
= require(
"std.icon")
3 +local auto
= require(
"std.auto")
4 +local ignored
= require(
"std.ignored")
6 -local NEW_FILE
= '~untitled~' 6 +local NEW_FILE
= "~untitled~" 10 - 'rebelot/heirline.nvim',
10 + "rebelot/heirline.nvim",
14 - 'nvim-tree/nvim-web-devicons',
15 - 'lewis6991/gitsigns.nvim',
16 - 'SmiteshP/nvim-navic',
14 + "nvim-tree/nvim-web-devicons",
15 + {
"lewis6991/gitsigns.nvim",
lazy =
true },
16 + {
"SmiteshP/nvim-navic",
lazy =
true },
18 - config =
function ()
19 - local heirline
= require 'heirline' 20 - local conditions
= require 'heirline.conditions' 21 - local utils
= require 'heirline.utils' 19 + local heirline
= require(
"heirline")
20 + local conditions
= require(
"heirline.conditions")
21 + local utils
= require(
"heirline.utils")
23 - local nugu
= require 'bugabinga.nugu.palette' 24 - heirline.load_colors( nugu )
23 + local nugu
= require(
"bugabinga.nugu.palette")
24 + heirline.load_colors(nugu)
26 - auto
'reload_heirline_colors' {
27 - description =
'Reload dark/light nugu colors for Heirline',
28 - events =
'ColorScheme',
29 - command =
function () utils.on_colorscheme( nugu )
end,
26 + auto(
"reload_heirline_colors")({
27 + description =
"Reload dark/light nugu colors for Heirline",
28 + events =
"ColorScheme",
29 + command =
function()
30 + utils.on_colorscheme(nugu)
33 - init =
function ( self )
34 - self.mode
= vim.fn.mode(
1 )
35 + init =
function(self)
36 + self.mode
= vim.fn.mode(
1)
40 - no = icon.normal
.. '?',
41 - nov = icon.normal
.. '?',
42 - noV = icon.normal
.. '?',
43 - [
'no\22'] = icon.normal
.. '?',
44 - niI = icon.normal
.. 'i',
45 - niR = icon.normal
.. 'r',
46 - niV = icon.normal
.. 'v',
47 - nt = icon.normal
.. 't',
42 + no = icon.normal
.. "?",
43 + nov = icon.normal
.. "?",
44 + noV = icon.normal
.. "?",
45 + [
"no\22"] = icon.normal
.. "?",
46 + niI = icon.normal
.. "i",
47 + niR = icon.normal
.. "r",
48 + niV = icon.normal
.. "v",
49 + nt = icon.normal
.. "t",
49 - vs = icon.visual
.. 's',
50 - V = icon.visual
.. '_',
51 - Vs = icon.visual
.. 's',
52 - [
'\22'] =
'^' .. icon.visual,
53 - [
'\22s'] =
'^' .. icon.visual,
51 + vs = icon.visual
.. "s",
52 + V = icon.visual
.. "_",
53 + Vs = icon.visual
.. "s",
54 + [
"\22"] =
"^" .. icon.visual,
55 + [
"\22s"] =
"^" .. icon.visual,
55 - S = icon.select
.. '_',
56 - [
'\19'] =
'^' .. icon.select,
57 + S = icon.select
.. "_",
58 + [
"\19"] =
"^" .. icon.select,
58 - ic = icon.insert
.. 'c',
59 - ix = icon.insert
.. 'x',
60 + ic = icon.insert
.. "c",
61 + ix = icon.insert
.. "x",
61 - Rc = icon.replace
.. 'c',
62 - Rx = icon.replace
.. 'x',
63 - Rv = icon.replace
.. 'v',
64 - Rvc = icon.replace
.. 'v',
65 - Rvx = icon.replace
.. 'v',
63 + Rc = icon.replace
.. "c",
64 + Rx = icon.replace
.. "x",
65 + Rv = icon.replace
.. "v",
66 + Rvc = icon.replace
.. "v",
67 + Rvx = icon.replace
.. "v",
67 - cv = icon.command
.. 'x',
69 + cv = icon.command
.. "x",
69 - rm = icon.pending
.. 'm',
70 - [
'r?'] = icon.pending
.. '?',
71 - [
'!'] = icon.exclaim,
71 + rm = icon.pending
.. "m",
72 + [
"r?"] = icon.pending
.. "?",
73 + [
"!"] = icon.exclaim,
77 - v =
'ui_important_global',
78 - V =
'ui_important_global',
79 - [
'\22'] =
'ui_important_global',
80 - c =
'ui_important_global',
81 - s =
'ui_important_global',
82 - S =
'ui_important_global',
83 - [
'\19'] =
'ui_important_global',
84 - R =
'ui_important_global',
85 - r =
'ui_important_global',
86 - [
'!'] =
'ui_important_global',
87 - t =
'ui_important_global',
79 + v =
"ui_important_global",
80 + V =
"ui_important_global",
81 + [
"\22"] =
"ui_important_global",
82 + c =
"ui_important_global",
83 + s =
"ui_important_global",
84 + S =
"ui_important_global",
85 + [
"\19"] =
"ui_important_global",
86 + R =
"ui_important_global",
87 + r =
"ui_important_global",
88 + [
"!"] =
"ui_important_global",
89 + t =
"ui_important_global",
91 - provider =
function ( self )
93 + provider =
function(self)
92 94 local mode_name
= self.mode_names[self.mode]
93 - return ' ' .. icon.vim
.. ' %3(' .. mode_name
.. '%) ' 95 + return " " .. icon.vim
.. " %3(" .. mode_name
.. "%) " 96 - hl =
function ( self )
97 - local mode
= self.mode:sub(
1,
1 )
98 - return {
fg = self.mode_colors[mode],
bold =
true, }
99 + local mode
= self.mode:sub(
1,
1)
100 + return {
fg = self.mode_colors[mode],
bold =
true }
104 - callback = vim.schedule_wrap(
function () vim.cmd.redrawstatus()
end ),
106 + callback = vim.schedule_wrap(
function()
107 + vim.cmd.redrawstatus()
108 - local file_icon
= {
109 - init =
function ( self )
112 + local file_icon
= {
113 + init =
function(self)
110 114 local filename
= self.filename
111 - local extension
= vim.fn.fnamemodify( filename,
':e' )
112 - self.icon
= require 'nvim-web-devicons'.get_icon_color( filename, extension, {
default =
true, } )
115 + local extension
= vim.fn.fnamemodify(filename,
":e")
116 + self.icon
= require(
"nvim-web-devicons").get_icon_color(filename, extension, {
default =
true })
114 - provider =
function ( self )
115 - return self.icon
and (self.icon
.. ' ')
118 + provider =
function(self)
119 + return self.icon
and (self.icon
.. " ")
117 - hl =
'DefaultIcon',
121 + hl =
"DefaultIcon",
120 - local file_name
= {
121 - init =
function ( self )
122 - self.lfilename
= vim.fs.normalize( vim.fn.fnamemodify( self.filename,
':.' ) )
123 - if self.lfilename
== '' then self.lfilename
= NEW_FILE
end 124 + local file_name
= {
125 + init =
function(self)
126 + self.lfilename
= vim.fs.normalize(vim.fn.fnamemodify(self.filename,
":."))
127 + if self.lfilename
== "" then 128 + self.lfilename
= NEW_FILE
129 - provider =
function ( self )
135 + provider =
function(self)
130 136 return self.lfilename
134 - provider =
function ( self )
135 - return vim.fs.normalize( vim.fn.pathshorten( self.lfilename ) )
140 + provider =
function(self)
141 + return vim.fs.normalize(vim.fn.pathshorten(self.lfilename))
140 - local file_flags
= {
146 + local file_flags
= {
142 - condition =
function ()
148 + condition =
function()
143 149 return vim.bo.modified
145 - provider =
string.
format(
' %s ', icon.modified ),
151 + provider =
string.
format(
" %s ", icon.modified),
149 - condition =
function ()
155 + condition =
function()
150 156 return not vim.bo.modifiable
or vim.bo.readonly
152 - provider =
string.
format(
' %s ', icon.lock ),
158 + provider =
string.
format(
" %s ", icon.lock),
157 - local file_name_block
= {
158 - init =
function ( self )
159 - self.filename
= vim.fs.normalize( vim.api.nvim_buf_get_name(
0 ) )
163 + local file_name_block
= {
164 + init =
function(self)
165 + self.filename
= vim.fs.normalize(vim.api.nvim_buf_get_name(
0))
163 - {
provider =
' ', },
169 + {
provider =
" " },
166 - {
provider =
'%<', },
172 + {
provider =
"%<" },
169 - local file_type
= {
170 - provider =
function ()
171 - return icon.file
.. ' ' .. string.
upper( vim.bo.filetype )
175 + local file_type
= {
176 + provider =
function()
177 + return icon.file
.. " " .. string.
upper(vim.bo.filetype)
175 - local file_encoding
= {
176 - provider =
function ()
177 - local enc
= (vim.bo.fenc
~= '' and vim.bo.fenc)
or vim.o.enc
178 - return enc
~= 'utf-8' and enc:upper()
181 + local file_encoding
= {
182 + provider =
function()
183 + local enc
= (vim.bo.fenc
~= "" and vim.bo.fenc)
or vim.o.enc
184 + return enc
~= "utf-8" and enc:upper()
182 - local file_format
= {
188 + local file_format
= {
184 190 dos = icon.newline
.. icon.carriage_return,
185 191 unix = icon.newline,
186 192 mac = icon.carriage_return,
188 - provider =
function ( self )
194 + provider =
function(self)
189 195 local fileformat
= vim.bo.fileformat
190 196 return self[fileformat]
194 - local file_size
= {
195 - provider =
function ()
200 + local file_size
= {
201 + provider =
function()
198 - local suffix
= {
'b',
'k',
'M',
'G',
'T',
'P',
'E', }
199 - local fsize
= vim.fn.getfsize( vim.api.nvim_buf_get_name(
0 ) )
204 + local suffix
= {
"b",
"k",
"M",
"G",
"T",
"P",
"E" }
205 + local fsize
= vim.fn.getfsize(vim.api.nvim_buf_get_name(
0))
200 206 fsize
= (fsize
< 0 and 0)
or fsize
201 207 if fsize
< 1024 then 202 208 return fsize
.. suffix[
1]
204 - local i
= math.
floor( (
math.
log( fsize )
/ math.
log(
1024 )) )
205 - return string.
format(
'%.2g%s', fsize
/ math.
pow(
1024, i ), suffix[i
+ 1] )
210 + local i
= math.
floor((
math.
log(fsize)
/ math.
log(
1024)))
211 + return string.
format(
"%.2g%s", fsize
/ math.
pow(
1024, i), suffix[i
+ 1])
209 - local file_last_modified
= {
210 - provider =
function ()
211 - local ftime
= vim.fn.getftime( vim.api.nvim_buf_get_name(
0 ) )
215 + local file_last_modified
= {
216 + provider =
function()
217 + local ftime
= vim.fn.getftime(vim.api.nvim_buf_get_name(
0))
212 218 if ftime
> 0 then 213 - local timeago
= require 'std.timeago' 214 - return timeago.format( ftime )
219 + local timeago
= require(
"std.timeago")
220 + return timeago.format(ftime)
219 - local lsp_active
= {
225 + local lsp_active
= {
220 226 condition = conditions.lsp_attached,
223 - update = {
'LspAttach',
'LspDetach',
'BufEnter',
'BufLeave', },
229 + update = {
"LspAttach",
"LspDetach",
"BufEnter",
"BufLeave" },
225 - provider =
function ()
231 + provider =
function()
227 - for _, client
in pairs( vim.lsp.get_clients {
bufnr =
0, } )
do 228 - table.
insert( names, client.name )
233 + for _, client
in pairs(vim.lsp.get_clients({
bufnr =
0 }))
do 234 + table.
insert(names, client.name)
230 - return icon.lsp
.. ' ' .. table.
concat( names,
' ' )
236 + return icon.lsp
.. " " .. table.
concat(names,
" ")
235 - condition =
function ()
return require 'nvim-navic'.is_available()
end,
241 + condition =
function()
242 + local ok, navic
= pcall(
require,
"nvim-navic")
243 + return ok
and navic.is_available()
239 - File =
'Directory',
240 - Module =
'@include',
241 - Namespace =
'@namespace',
242 - Package =
'@include',
243 - Class =
'@structure',
244 - Method =
'@method',
245 - Property =
'@property',
247 - Constructor =
'@constructor',
249 - Interface =
'@type',
250 - Function =
'@function',
251 - Variable =
'@variable',
252 - Constant =
'@constant',
253 - String =
'@string',
254 - Number =
'@number',
255 - Boolean =
'@boolean',
260 - EnumMember =
'@field',
261 - Struct =
'@structure',
262 - Event =
'@keyword',
263 - Operator =
'@operator',
264 - TypeParameter =
'@type',
248 + File =
"Directory",
249 + Module =
"@include",
250 + Namespace =
"@namespace",
251 + Package =
"@include",
252 + Class =
"@structure",
253 + Method =
"@method",
254 + Property =
"@property",
256 + Constructor =
"@constructor",
258 + Interface =
"@type",
259 + Function =
"@function",
260 + Variable =
"@variable",
261 + Constant =
"@constant",
262 + String =
"@string",
263 + Number =
"@number",
264 + Boolean =
"@boolean",
269 + EnumMember =
"@field",
270 + Struct =
"@structure",
271 + Event =
"@keyword",
272 + Operator =
"@operator",
273 + TypeParameter =
"@type",
267 - enc =
function ( line, col, winnr )
268 - return bit.bor( bit.lshift( line,
16 ), bit.lshift( col,
6 ), winnr )
276 + enc =
function(line, col, winnr)
277 + return bit.bor(bit.lshift(line,
16), bit.lshift(col,
6), winnr)
271 - dec =
function ( c )
272 - local line
= bit.rshift( c,
16 )
273 - local col
= bit.band( bit.rshift( c,
6 ),
1023 )
274 - local winnr
= bit.band( c,
63 )
281 + local line
= bit.rshift(c,
16)
282 + local col
= bit.band(bit.rshift(c,
6),
1023)
283 + local winnr
= bit.band(c,
63)
275 284 return line, col, winnr
278 - init =
function ( self )
279 - local data
= require 'nvim-navic'.get_data()
or {}
287 + init =
function(self)
288 + local data
= require(
"nvim-navic").get_data()
or {}
280 289 local children
= {}
282 - for i, d
in ipairs( data )
do 291 + for i, d
in ipairs(data)
do 284 - local pos
= self.enc( d.scope.start.line, d.scope.start.character, self.winnr )
293 + local pos
= self.enc(d.scope.start.line, d.scope.start.character, self.winnr)
287 296 provider = d.icon,
292 - provider = d.name:gsub(
'%%',
'%%%%' ):gsub(
'%s*->%s*',
'' ),
301 + provider = d.name:gsub(
"%%",
"%%%%"):gsub(
"%s*->%s*",
""),
294 303 hl = self.type_hl[d.type],
299 - callback =
function ( _, minwid )
308 + callback =
function(_, minwid)
301 - local line, col, winnr
= self.dec( minwid )
302 - vim.api.nvim_win_set_cursor( vim.fn.win_getid( winnr ), { line, col, } )
310 + local line, col, winnr
= self.dec(minwid)
311 + vim.api.nvim_win_set_cursor(vim.fn.win_getid(winnr), { line, col })
304 - name =
'heirline_navic',
313 + name =
"heirline_navic",
309 318 if #data
> 1 and i
< #data
then 310 - table.
insert( child, {
319 + table.
insert(child, {
315 - table.
insert( children, child )
324 + table.
insert(children, child)
318 - self.child
= self:new( children,
1 )
327 + self.child
= self:new(children,
1)
321 - provider = function ( self )
330 + provider = function(self)
322 331 return self.child:eval()
325 - update
= 'CursorMoved',
334 + update
= "CursorMoved",
328 - local diagnostic_enabled
= {
329 - init =
function ( self )
337 + local diagnostic_enabled
= {
338 + init =
function(self)
330 339 self.icon
= vim.diagnostic.is_disabled()
and icon.toggle_off
or icon.toggle_on
332 - provider =
function ( self )
333 - return icon.diagnostic
.. ' ' .. self.icon
341 + provider =
function(self)
342 + return icon.diagnostic
.. " " .. self.icon
337 - local diagnostic
= {
346 + local diagnostic
= {
338 347 condition = conditions.has_diagnostics,
344 353 hint_icon
= icon.hint,
347 - init = function ( self )
348 - self.errors
= #vim.diagnostic.get(
0, {
severity = vim.diagnostic.severity.ERROR, } )
349 - self.warnings
= #vim.diagnostic.get(
0, {
severity = vim.diagnostic.severity.WARN, } )
350 - self.hints
= #vim.diagnostic.get(
0, {
severity = vim.diagnostic.severity.HINT, } )
351 - self.info
= #vim.diagnostic.get(
0, {
severity = vim.diagnostic.severity.INFO, } )
356 + init = function(self)
357 + self.errors
= #vim.diagnostic.get(
0, {
severity = vim.diagnostic.severity.ERROR })
358 + self.warnings
= #vim.diagnostic.get(
0, {
severity = vim.diagnostic.severity.WARN })
359 + self.hints
= #vim.diagnostic.get(
0, {
severity = vim.diagnostic.severity.HINT })
360 + self.info
= #vim.diagnostic.get(
0, {
severity = vim.diagnostic.severity.INFO })
354 - update
= {
'DiagnosticChanged',
'BufEnter',
'BufLeave', },
363 + update
= {
"DiagnosticChanged",
"BufEnter",
"BufLeave" },
357 - provider =
function ( self )
366 + provider =
function(self)
359 - return self.errors
> 0 and (self.error_icon
.. ' ' .. self.errors
.. ' ')
368 + return self.errors
> 0 and (self.error_icon
.. " " .. self.errors
.. " ")
361 - hl =
'DiagnosticError',
370 + hl =
"DiagnosticError",
364 - provider =
function ( self )
365 - return self.warnings
> 0 and (self.warn_icon
.. ' ' .. self.warnings
.. ' ')
373 + provider =
function(self)
374 + return self.warnings
> 0 and (self.warn_icon
.. " " .. self.warnings
.. " ")
367 - hl =
'DiagnosticWarn',
376 + hl =
"DiagnosticWarn",
370 - provider =
function ( self )
371 - return self.info
> 0 and (self.info_icon
.. ' ' .. self.info
.. ' ')
379 + provider =
function(self)
380 + return self.info
> 0 and (self.info_icon
.. " " .. self.info
.. " ")
373 - hl =
'DiagnosticInfo',
382 + hl =
"DiagnosticInfo",
376 - provider =
function ( self )
377 - return self.hints
> 0 and (self.hint_icon
.. ' ' .. self.hints)
385 + provider =
function(self)
386 + return self.hints
> 0 and (self.hint_icon
.. " " .. self.hints)
379 - hl =
'DiagnosticHint',
388 + hl =
"DiagnosticHint",
383 - local is_svn_repo = function ()
384 - local svn_dir
= vim.fs.find(
'.svn', {
392 + local is_svn_repo = function()
393 + local svn_dir
= vim.fs.find(
".svn", {
386 395 stop = vim.uv.os_homedir(),
387 - path = vim.fs.dirname( vim.api.nvim_buf_get_name(
0 ) ),
388 - type =
'directory',
396 + path = vim.fs.dirname(vim.api.nvim_buf_get_name(
0)),
397 + type =
"directory",
391 - return not vim.tbl_isempty( svn_dir )
400 + return not vim.tbl_isempty(svn_dir)
394 - local svn_get_relative_url = function ()
403 + local svn_get_relative_url = function()
396 - local job
= require 'plenary.job' 397 - local relative_url
= {
'[ERR]', }
405 + local job
= require(
"plenary.job")
406 + local relative_url
= {
"[ERR]" }
401 - args = {
'info',
'--show-item',
'relative-url',
'--no-newline', },
402 - on_exit =
function ( current_job, exit_code )
403 - if exit_code
== 0 then relative_url
= current_job:result()
end 411 + args = {
"info",
"--show-item",
"relative-url",
"--no-newline" },
412 + on_exit =
function(current_job, exit_code)
413 + if exit_code
== 0 then 414 + relative_url
= current_job:result()
407 420 return relative_url[
1]
411 424 condition = is_svn_repo,
413 - update =
'BufEnter',
426 + update =
"BufEnter",
415 - init =
function ( self )
428 + init =
function(self)
416 429 self.relative_url
= svn_get_relative_url()
420 - provider =
function ( self )
421 - return icon.subversion
.. ' ' .. icon.branch
.. ' ' .. self.relative_url
433 + provider =
function(self)
434 + return icon.subversion
.. " " .. icon.branch
.. " " .. self.relative_url
428 440 condition = conditions.is_git_repo,
430 - init =
function ( self )
442 + init =
function(self)
431 443 self.status_dict
= vim.b.gitsigns_status_dict
435 - provider =
function ( self )
436 - return icon.git
.. ' ' .. icon.branch
.. ' ' .. self.status_dict.head
.. ' ' 447 + provider =
function(self)
448 + return icon.git
.. " " .. icon.branch
.. " " .. self.status_dict.head
.. " " 440 - provider =
function ( self )
452 + provider =
function(self)
441 453 local count
= self.status_dict.added
or 0 442 - return count
> 0 and (icon.diff_add
.. ' ' .. count
.. ' ')
454 + return count
> 0 and (icon.diff_add
.. " " .. count
.. " ")
447 - provider =
function ( self )
459 + provider =
function(self)
448 460 local count
= self.status_dict.removed
or 0 449 - return count
> 0 and (icon.diff_remove
.. ' ' .. count
.. ' ')
461 + return count
> 0 and (icon.diff_remove
.. " " .. count
.. " ")
454 - provider =
function ( self )
466 + provider =
function(self)
455 467 local count
= self.status_dict.changed
or 0 456 - return count
> 0 and (icon.diff_change
.. ' ' .. count
.. ' ')
468 + return count
> 0 and (icon.diff_change
.. " " .. count
.. " ")
463 - init =
function ( self )
464 - self.icon
= (vim.fn.haslocaldir(
0 )
== 1 and icon[
'local']
or '')
.. ' ' .. icon.global
.. ' ' 465 - self.cwd
= vim.fs.normalize( vim.uv.cwd() ):gsub( vim.fs.normalize( vim.uv.os_homedir() ),
'~' )
475 + init =
function(self)
476 + self.icon
= (vim.fn.haslocaldir(
0)
== 1 and icon[
"local"]
or "")
.. " " .. icon.global
.. " " 477 + self.cwd
= vim.fs.normalize(vim.uv.cwd()):gsub(vim.fs.normalize(vim.uv.os_homedir()),
"~")
471 - provider =
function ( self )
483 + provider =
function(self)
472 484 return self.icon
.. self.cwd
476 - provider =
function ( self )
477 - local cwd
= vim.fn.pathshorten( self.cwd )
488 + provider =
function(self)
489 + local cwd
= vim.fn.pathshorten(self.cwd)
478 490 return self.icon
.. cwd
486 - local help_file_name
= {
487 - condition =
function ()
488 - return vim.bo.filetype
== 'help' 498 + local help_file_name
= {
499 + condition =
function()
500 + return vim.bo.filetype
== "help" 490 - provider =
function ()
491 - local filename
= vim.api.nvim_buf_get_name(
0 )
492 - return vim.fn.fnamemodify( filename,
':t' )
502 + provider =
function()
503 + local filename
= vim.api.nvim_buf_get_name(
0)
504 + return vim.fn.fnamemodify(filename,
":t")
497 - local terminal_name
= {
498 - provider =
function ()
499 - local name, _
= vim.api.nvim_buf_get_name(
0 ):gsub(
'.*:',
'' )
500 - local basename
= vim.fs.basename( name )
501 - return icon.terminal
.. ' ' .. (basename
or 'noname')
509 + local terminal_name
= {
510 + provider =
function()
511 + local name, _
= vim.api.nvim_buf_get_name(
0):gsub(
".*:",
"")
512 + local basename
= vim.fs.basename(name)
513 + return icon.terminal
.. " " .. (basename
or "noname")
507 - provider =
function ()
508 - local togglers
= require 'bugabinga.options.togglers' 509 - return tostring( togglers )
519 + provider =
function()
520 + local togglers
= require(
"bugabinga.options.togglers")
521 + return tostring(togglers)
513 - local macro_recording
= {
514 - condition =
function ()
515 - return vim.fn.reg_recording()
~= '' and vim.o.cmdheight
== 0 525 + local macro_recording
= {
526 + condition =
function()
527 + return vim.fn.reg_recording()
~= "" and vim.o.cmdheight
== 0 517 - provider = icon.macro
.. ' ',
519 - utils.surround( {
'░▒▓ ',
' ▓▒░', },
nil, {
520 - provider =
function ()
529 + provider = icon.macro
.. " ",
531 + utils.surround({
"░▒▓ ",
" ▓▒░" },
nil, {
532 + provider =
function()
521 533 return vim.fn.reg_recording()
532 - condition =
function ()
533 - local ok, lazy_status
= pcall(
require,
'lazy.status' )
544 + condition =
function()
545 + local ok, lazy_status
= pcall(
require,
"lazy.status")
534 546 return ok
and lazy_status.has_updates()
536 - update = {
'User',
pattern =
'LazyUpdate', },
537 - provider =
function ()
return ' ' .. icon.lazy
.. ' ' .. require 'lazy.status'.updates()
.. ' ' end,
548 + update = {
"User",
pattern =
"LazyUpdate" },
549 + provider =
function()
550 + return " " .. icon.lazy
.. " " .. require(
"lazy.status").updates()
.. " " 539 - callback =
function ()
require 'lazy'.update()
end,
540 - name =
'update_plugins',
553 + callback =
function()
554 + require(
"lazy").update()
556 + name =
"update_plugins",
544 - local align
= {
provider =
'%=', }
545 - local space
= {
provider =
' ', }
560 + local align
= {
provider =
"%=" }
561 + local space
= {
provider =
" " }
547 - local default_statusline
= {
548 - vi_mode, macro_recording, work_dir, space, git, svn, align,
549 - diagnostic, space, lsp_active, align,
550 - togglers, space, space, diagnostic_enabled, space, lazy, space,
551 - file_encoding, space, file_format, space, file_type, space, file_size, space, file_last_modified,
563 + local default_statusline
= {
578 + diagnostic_enabled,
590 + file_last_modified,
554 - local special_statusline
= {
555 - condition =
function ()
556 - return conditions.buffer_matches {
593 + local special_statusline
= {
594 + condition =
function()
595 + return conditions.buffer_matches({
557 596 buftype = ignored.buftypes,
558 597 filetype = ignored.filetypes,
568 - local terminal_statusline
= {
607 + local terminal_statusline
= {
570 - condition =
function ()
571 - return conditions.buffer_matches {
buftype = {
'terminal', }, }
609 + condition =
function()
610 + return conditions.buffer_matches({
buftype = {
"terminal" } })
574 - {
condition = conditions.is_active, vi_mode, space, },
613 + {
condition = conditions.is_active, vi_mode, space },
581 - local inactive_statusline
= {
620 + local inactive_statusline
= {
582 621 condition = conditions.is_not_active,
589 - local statuslines
= {
628 + local statuslines
= {
591 630 if conditions.is_active()
then 592 - return 'StatusLine' 631 + return "StatusLine" 594 - return 'StatusLineNC' 633 + return "StatusLineNC" 603 642 default_statusline,
608 647 if conditions.is_active()
then 615 654 fallthrough =
false,
618 - condition =
function ()
619 - return conditions.buffer_matches {
buftype = {
'terminal', }, }
657 + condition =
function()
658 + return conditions.buffer_matches({
buftype = {
"terminal" } })
737 - provider =
function ( self )
738 - return '%' .. self.tabnr
.. 'T ' .. self.tabpage
.. ' %T' 776 + provider =
function(self)
777 + return "%" .. self.tabnr
.. "T " .. self.tabpage
.. " %T" 740 - hl =
function ( self )
779 + hl =
function(self)
741 780 if self.is_active
then 742 - return 'TabLineSel' 781 + return "TabLineSel" 749 - local tab_pages
= {
750 - {
provider =
'%=', },
751 - utils.make_tablist( tabpage ),
788 + local tab_pages
= {
789 + {
provider =
"%=" },
790 + utils.make_tablist(tabpage),
759 798 statusline = statuslines,
760 799 winbar = winbars,
761 800 tabline = tab_pages,
767 - disable_winbar_cb =
function ( args )
768 - return conditions.buffer_matches(
770 - buftype = ignored.buftypes,
771 - filetype = ignored.filetypes,
806 + disable_winbar_cb =
function(args)
807 + return conditions.buffer_matches({
808 + buftype = ignored.buftypes,
809 + filetype = ignored.filetypes,