.config/nvim/lua/kamu/plugins/lualine.lua aktualisiert

This commit is contained in:
2024-03-30 06:34:39 +01:00
parent 91ee686a5d
commit beadaaba8b

View File

@@ -1,42 +1,42 @@
local palette = require("catppuccin.palettes.init").get_palette() local palette = require("catppuccin.palettes.init").get_palette()
local mode_map = { local mode_map = {
['n'] = 'NORMAL', ['n'] = 'NORMAL',
['no'] = 'O-PENDING', ['no'] = 'O-PENDING',
['nov'] = 'O-PENDING', ['nov'] = 'O-PENDING',
['noV'] = 'O-PENDING', ['noV'] = 'O-PENDING',
['no\22'] = 'O-PENDING', ['no\22'] = 'O-PENDING',
['niI'] = 'NORMAL', ['niI'] = 'NORMAL',
['niR'] = 'NORMAL', ['niR'] = 'NORMAL',
['niV'] = 'NORMAL', ['niV'] = 'NORMAL',
['nt'] = 'NORMAL', ['nt'] = 'NORMAL',
['ntT'] = 'NORMAL', ['ntT'] = 'NORMAL',
['v'] = 'VISUAL', ['v'] = 'VISUAL',
['vs'] = 'VISUAL', ['vs'] = 'VISUAL',
['V'] = 'V-LINE', ['V'] = 'V-LINE',
['Vs'] = 'V-LINE', ['Vs'] = 'V-LINE',
['\22'] = 'V-BLOCK', ['\22'] = 'V-BLOCK',
['\22s'] = 'V-BLOCK', ['\22s'] = 'V-BLOCK',
['s'] = 'SELECT', ['s'] = 'SELECT',
['S'] = 'S-LINE', ['S'] = 'S-LINE',
['\19'] = 'S-BLOCK', ['\19'] = 'S-BLOCK',
['i'] = 'INSERT', ['i'] = 'INSERT',
['ic'] = 'INSERT', ['ic'] = 'INSERT',
['ix'] = 'INSERT', ['ix'] = 'INSERT',
['R'] = 'REPLACE', ['R'] = 'REPLACE',
['Rc'] = 'REPLACE', ['Rc'] = 'REPLACE',
['Rx'] = 'REPLACE', ['Rx'] = 'REPLACE',
['Rv'] = 'V-REPLACE', ['Rv'] = 'V-REPLACE',
['Rvc'] = 'V-REPLACE', ['Rvc'] = 'V-REPLACE',
['Rvx'] = 'V-REPLACE', ['Rvx'] = 'V-REPLACE',
['c'] = 'COMMAND', ['c'] = 'COMMAND',
['cv'] = 'EX', ['cv'] = 'EX',
['ce'] = 'EX', ['ce'] = 'EX',
['r'] = 'REPLACE', ['r'] = 'REPLACE',
['rm'] = 'MORE', ['rm'] = 'MORE',
['r?'] = 'CONFIRM', ['r?'] = 'CONFIRM',
['!'] = 'SHELL', ['!'] = 'SHELL',
['t'] = 'TERMINAL', ['t'] = 'TERMINAL',
} }
local mode2themeMap = { local mode2themeMap = {
@@ -65,15 +65,15 @@ end
return { return {
'nvim-lualine/lualine.nvim', 'nvim-lualine/lualine.nvim',
dependencies = {'kyazdani42/nvim-web-devicons', opt = true }, dependencies = { 'kyazdani42/nvim-web-devicons', opt = true },
config = function() config = function()
require('lualine').setup { require('lualine').setup {
options = { options = {
theme = 'catppuccin', theme = 'catppuccin',
--fmt = string.lower, --fmt = string.lower,
icons_enabled = true, icons_enabled = true,
component_separators = { left = '', right = ''}, component_separators = { left = '', right = '' },
section_separators = { left = '', right = ''}, section_separators = { left = '', right = '' },
disabled_filetypes = { disabled_filetypes = {
statusline = {}, statusline = {},
winbar = {}, winbar = {},
@@ -90,18 +90,18 @@ return {
sections = { sections = {
lualine_a = { lualine_a = {
{ {
'mode', 'mode',
color = function() color = function()
if vim.fn.mode() == "n" then return { fg = palette.text, gui = "bold" } end if vim.fn.mode() == "n" then return { fg = palette.text, gui = "bold" } end
return { fg = "#000000", gui = "bold" } return { fg = "#000000", gui = "bold" }
end, end,
-- fmt = function(str) return str:sub(1,1) end, -- fmt = function(str) return str:sub(1,1) end,
}}, } },
lualine_b = { lualine_b = {
{ {
'branch', 'branch',
color = { fg = "#FFF"}, color = { fg = "#FFF" },
icon = {'', color = function() return { fg = getModeColor('a','bg') } end }, icon = { 'εéá', color = function() return { fg = getModeColor('a', 'bg') } end },
}, },
{ {
'diff', 'diff',
@@ -109,52 +109,59 @@ return {
-- custom color for each section of the component in format -- custom color for each section of the component in format
-- {fg = '#rrggbb', bg= '#rrggbb', gui='style'} -- {fg = '#rrggbb', bg= '#rrggbb', gui='style'}
-- or highlight group -- or highlight group
added = nil, -- {fg = '#rrggbb', bg= '#rrggbb', gui='style'}, -- changes diff's added color added = nil, -- {fg = '#rrggbb', bg= '#rrggbb', gui='style'}, -- changes diff's added color
modified = { fg = "#FFFFFF" }, -- changes diff's modified color modified = { fg = "#FFFFFF" }, -- changes diff's modified color
removed = nil, -- changes diff's removed color removed = nil, -- changes diff's removed color
}, },
}, },
-- 'diagnostics' -- 'diagnostics'
}, },
lualine_c = {{ lualine_c = { {
'filename', 'filename',
on_click = function(nc, mb, mods) on_click = function(nc, mb, mods)
local tb = require("telescope.builtin") local tb = require("telescope.builtin")
if mb == "l" then if mb == "l" then
--vim.print(mods) --vim.print(mods)
local mod = mods:gsub("%s+", "") local mod = mods:gsub("%s+", "")
if mod == "c" then tb.find_files(); return end if mod == "c" then
if mod == "a" then tb.buffers(); return end tb.find_files(); return
end
if mod == "a" then
tb.buffers(); return
end
end end
--require("telescope.builtin").find_files() --require("telescope.builtin").find_files()
end, end,
}}, } },
lualine_x = { lualine_x = {
-- { -- print recording messages
-- function() {
-- return getModeColor('a','bg') require("noice").api.statusline.mode.get,
-- end cond = function()
-- }, return require("noice").api.statusline.mode.has() and string.match(require("noice").api.statusline.mode.get(), '^recording @.$') ~= nil
'encoding', 'fileformat', 'filetype'}, end,
color = { fg = "#ff9e64" },
},
'encoding', 'fileformat', 'filetype' },
lualine_y = { lualine_y = {
{ {
'progress', 'progress',
color = { fg = "#FFFFFF"}, color = { fg = "#FFFFFF" },
} }
}, },
lualine_z = {{ lualine_z = { {
'location', 'location',
color = function(section) color = function(section)
if vim.fn.mode() == "n" then return { fg = palette.text } end if vim.fn.mode() == "n" then return { fg = palette.text } end
return { fg = "#000000", } return { fg = "#000000", }
end, end,
}} } }
}, },
inactive_sections = { inactive_sections = {
lualine_a = {}, lualine_a = {},
lualine_b = {}, lualine_b = {},
lualine_c = {'filename'}, lualine_c = { 'filename' },
lualine_x = {'location'}, lualine_x = { 'location' },
lualine_y = {}, lualine_y = {},
lualine_z = {} lualine_z = {}
}, },