Nvim: revisit statusline
This commit is contained in:
parent
431891e497
commit
c5bf8a3b98
3 changed files with 150 additions and 145 deletions
|
@ -1,6 +1,6 @@
|
||||||
-- statusline
|
-- statusline
|
||||||
vim.api.nvim_set_option("laststatus", 2)
|
vim.api.nvim_set_option("laststatus", 2)
|
||||||
vim.api.nvim_set_option("statusline", " %F %h%m%r %= %= %l,%c ")
|
vim.api.nvim_set_option("statusline", " ")
|
||||||
|
|
||||||
-- tabline
|
-- tabline
|
||||||
-- always show tabline (0 = never, 1 = only with at least 2 tabs, 2 = always) and colors
|
-- always show tabline (0 = never, 1 = only with at least 2 tabs, 2 = always) and colors
|
||||||
|
|
|
@ -1,135 +1,152 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
vim.api.nvim_set_option("showmode", false)
|
vim.api.nvim_set_option("showmode", false)
|
||||||
local custom_gruvbox = require 'lualine.themes.gruvbox-material'
|
local custom_gruvbox = require 'lualine.themes.gruvbox-material'
|
||||||
custom_gruvbox.normal.a.bg = '#89b482'
|
custom_gruvbox.normal.a.bg = '#89b482'
|
||||||
custom_gruvbox.normal.c.bg = '#141617'
|
custom_gruvbox.normal.c.bg = '#141617'
|
||||||
custom_gruvbox.insert.a.bg = '#d8a657'
|
custom_gruvbox.insert.a.bg = '#d8a657'
|
||||||
custom_gruvbox.visual.a.bg = '#a9b665'
|
custom_gruvbox.visual.a.bg = '#a9b665'
|
||||||
custom_gruvbox.replace.a.bg = '#ea6962'
|
custom_gruvbox.replace.a.bg = '#ea6962'
|
||||||
require('lualine').setup {
|
require('lualine').setup {
|
||||||
options = {
|
options = {
|
||||||
theme = custom_gruvbox,
|
theme = custom_gruvbox,
|
||||||
component_separators = { left = '', right = '' },
|
component_separators = { left = '', right = '' },
|
||||||
section_separators = { left = '▙', right = '▟' },
|
section_separators = { left = '', right = '' },
|
||||||
-- section_separators = ' ',
|
disabled_filetypes = { 'netrw', 'Trouble' }
|
||||||
-- component_separators = ' '
|
},
|
||||||
disabled_filetypes = { 'netrw', 'Trouble' }
|
sections = {
|
||||||
},
|
lualine_a = {
|
||||||
sections = {
|
{
|
||||||
lualine_a = {
|
'mode',
|
||||||
{
|
padding = 1,
|
||||||
'mode',
|
}
|
||||||
padding = 1,
|
},
|
||||||
}
|
lualine_b = {
|
||||||
},
|
{
|
||||||
lualine_b = {
|
'branch',
|
||||||
{
|
icon = '',
|
||||||
'branch',
|
color = { fg = '#d8a657', bg = '#141617', gui = 'bold' },
|
||||||
icon = '',
|
padding = 1,
|
||||||
color = { fg = '#d8a657', bg = '#141617', gui = 'bold' },
|
}
|
||||||
padding = 1,
|
},
|
||||||
}
|
lualine_c = {
|
||||||
},
|
{
|
||||||
lualine_c = {
|
'filename',
|
||||||
{
|
color = { gui = 'italic', fg = '#d3869b', bg = '#1d2021' },
|
||||||
'filename',
|
padding = 1,
|
||||||
color = { gui = 'italic', fg = '#d3869b', bg = '#1d2021' },
|
path = 1,
|
||||||
padding = 1,
|
}
|
||||||
path = 1,
|
},
|
||||||
}
|
lualine_x = {
|
||||||
},
|
{
|
||||||
lualine_x = {
|
'filetype',
|
||||||
{
|
color = { bg = '#1d2021', fg = '#d4be98', gui = 'italic' },
|
||||||
'filetype',
|
padding = 1,
|
||||||
color = { bg = '#1d2021', fg = '#d4be98', gui = 'italic' },
|
fmt = function(str)
|
||||||
padding = 1,
|
return (str:gsub("^%l", string.upper))
|
||||||
fmt = function(str)
|
end,
|
||||||
return (str:gsub("^%l", string.upper))
|
},
|
||||||
end,
|
{
|
||||||
}
|
'fileformat',
|
||||||
},
|
color = {gui = 'italic'},
|
||||||
lualine_y = {
|
symbols = {
|
||||||
{
|
unix = '(unix)',
|
||||||
'diagnostics',
|
dos = '(dos)',
|
||||||
color = { gui = 'bold', bg = '#141617' },
|
mac = '(mac)',
|
||||||
sections = { 'error', 'warn', 'info', 'hint' },
|
},
|
||||||
symbols = { error = "✘ ", warn = " ", info = " ", hint = " " },
|
}
|
||||||
padding = 1,
|
|
||||||
update_in_insert = true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'diff',
|
|
||||||
icon = { ' ', color = { bg = '#141617', fg = '#d8a657', gui = 'bold' } },
|
|
||||||
color = { gui = 'bold', bg = '#141617' },
|
|
||||||
padding = 1,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
lualine_z = {
|
|
||||||
{
|
|
||||||
'location',
|
|
||||||
padding = 1,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
inactive_sections = {
|
},
|
||||||
lualine_a = {
|
lualine_y = {
|
||||||
{
|
{
|
||||||
'mode',
|
'diagnostics',
|
||||||
padding = 1,
|
color = { gui = 'bold', bg = '#141617' },
|
||||||
}
|
sections = { 'error', 'warn', 'info', 'hint' },
|
||||||
},
|
symbols = { error = "✘ ", warn = " ", info = " ", hint = " " },
|
||||||
lualine_b = {
|
padding = 1,
|
||||||
{
|
update_in_insert = true
|
||||||
'branch',
|
},
|
||||||
icon = '',
|
{
|
||||||
padding = 1,
|
'diff',
|
||||||
}
|
icon = { ' ', color = { bg = '#141617', fg = '#d8a657', gui = 'bold' } },
|
||||||
},
|
color = { gui = 'bold', bg = '#141617' },
|
||||||
lualine_c = {
|
padding = 1,
|
||||||
{
|
}
|
||||||
'filename',
|
},
|
||||||
padding = 1,
|
lualine_z = {
|
||||||
path = 1,
|
{
|
||||||
}
|
'location',
|
||||||
},
|
padding = 1,
|
||||||
lualine_x = {
|
}
|
||||||
{
|
}
|
||||||
'filetype',
|
},
|
||||||
color = { gui = 'italic' },
|
|
||||||
padding = 1,
|
inactive_sections = {
|
||||||
fmt = function(str)
|
lualine_a = {
|
||||||
return (str:gsub("^%l", string.upper))
|
{
|
||||||
end,
|
'mode',
|
||||||
}
|
padding = 1,
|
||||||
},
|
}
|
||||||
lualine_y = {
|
},
|
||||||
{
|
lualine_b = {
|
||||||
'diagnostics',
|
{
|
||||||
color = { gui = 'bold', bg = '#141617' },
|
'branch',
|
||||||
sections = { 'error', 'warn', 'info', 'hint' },
|
icon = '',
|
||||||
symbols = { error = "✘ ", warn = " ", info = " ", hint = " " },
|
padding = 1,
|
||||||
padding = 1,
|
}
|
||||||
update_in_insert = true
|
},
|
||||||
},
|
lualine_c = {
|
||||||
{
|
{
|
||||||
'diff',
|
'filename',
|
||||||
icon = { ' ', color = { bg = '#141617', gui = 'bold' } },
|
padding = 1,
|
||||||
color = { gui = 'bold', bg = '#141617' },
|
path = 1,
|
||||||
padding = 1,
|
}
|
||||||
}
|
},
|
||||||
},
|
lualine_x = {
|
||||||
lualine_z = {
|
{
|
||||||
{
|
'filetype',
|
||||||
'location',
|
color = { gui = 'italic' },
|
||||||
padding = 1,
|
padding = 1,
|
||||||
}
|
fmt = function(str)
|
||||||
}
|
return (str:gsub("^%l", string.upper))
|
||||||
},
|
end,
|
||||||
}
|
},
|
||||||
end,
|
{
|
||||||
},
|
'fileformat',
|
||||||
|
color = {gui = 'italic'},
|
||||||
|
symbols = {
|
||||||
|
unix = 'Unix',
|
||||||
|
dos = 'Dos',
|
||||||
|
mac = 'Mac',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lualine_y = {
|
||||||
|
{
|
||||||
|
'diagnostics',
|
||||||
|
color = { gui = 'bold', bg = '#141617' },
|
||||||
|
sections = { 'error', 'warn', 'info', 'hint' },
|
||||||
|
symbols = { error = "✘ ", warn = " ", info = " ", hint = " " },
|
||||||
|
padding = 1,
|
||||||
|
update_in_insert = true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'diff',
|
||||||
|
icon = { ' ', color = { bg = '#141617', gui = 'bold' } },
|
||||||
|
color = { gui = 'bold', bg = '#141617' },
|
||||||
|
padding = 1,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
lualine_z = {
|
||||||
|
{
|
||||||
|
'location',
|
||||||
|
padding = 1,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
return {
|
|
||||||
{
|
|
||||||
"folke/twilight.nvim",
|
|
||||||
keys = {
|
|
||||||
{ "<leader>T", "<cmd>Twilight <cr>", desc = "Twilight" },
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("twilight").setup {
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue