vim/lualine: refactor for readability
This commit is contained in:
parent
f7826d81c8
commit
c0ef1e17b9
1 changed files with 6 additions and 9 deletions
|
@ -56,6 +56,8 @@ local config = function()
|
||||||
local window_is_wide = window_is_at_least(80)
|
local window_is_wide = window_is_at_least(80)
|
||||||
local window_is_medium = window_is_at_least(50)
|
local window_is_medium = window_is_at_least(50)
|
||||||
|
|
||||||
|
local concat = require('fschauen.util').concat
|
||||||
|
|
||||||
local my = {
|
local my = {
|
||||||
paste = {
|
paste = {
|
||||||
function() return '' end,
|
function() return '' end,
|
||||||
|
@ -89,14 +91,10 @@ local config = function()
|
||||||
|
|
||||||
status = {
|
status = {
|
||||||
function()
|
function()
|
||||||
local flags = {}
|
local flags = concat(
|
||||||
if vim.bo.modified then
|
vim.bo.modified and {'+'} or {},
|
||||||
table.insert(flags, '+')
|
(vim.bo.readonly or not vim.bo.modifiable) and {'RO'} or {})
|
||||||
end
|
return vim.fn.join(flags, ' ')
|
||||||
if vim.bo.modifiable == false or vim.bo.readonly == true then
|
|
||||||
table.insert(flags, 'RO')
|
|
||||||
end
|
|
||||||
return table.concat(flags, ' ')
|
|
||||||
end,
|
end,
|
||||||
|
|
||||||
color = { fg = '#eee8d5' },
|
color = { fg = '#eee8d5' },
|
||||||
|
@ -146,7 +144,6 @@ local config = function()
|
||||||
lualine_z = { 'location' },
|
lualine_z = { 'location' },
|
||||||
}
|
}
|
||||||
|
|
||||||
local concat = require('fschauen.util').concat
|
|
||||||
|
|
||||||
local active_sections = vim.tbl_extend('force', inactive_sections, {
|
local active_sections = vim.tbl_extend('force', inactive_sections, {
|
||||||
lualine_a = concat({ my.paste, my.mode }, inactive_sections.lualine_a),
|
lualine_a = concat({ my.paste, my.mode }, inactive_sections.lualine_a),
|
||||||
|
|
Loading…
Add table
Reference in a new issue