Customize tabline
This commit is contained in:
parent
6e1060fbaf
commit
8242bdd4c4
|
@ -6,6 +6,7 @@ vim.filetype.add({
|
|||
['kitty.conf'] = 'kitty',
|
||||
['neomuttrc'] = 'neomutt',
|
||||
['template'] = 'sh',
|
||||
['mbsyncrc'] = 'mbsyncrc',
|
||||
},
|
||||
pattern = {
|
||||
['${XDG_CONFIG_HOME}/kitty/*.conf'] = 'kitty',
|
||||
|
|
|
@ -13,13 +13,29 @@ return {
|
|||
tabline = {
|
||||
lualine_a = { 'branch' },
|
||||
lualine_b = {},
|
||||
lualine_c = { 'windows' },
|
||||
lualine_c = { { 'windows', show_filename_only = false, symbols = { modified = " ✏️]", alternate_file = " 🔃", folder = " 📁"} ,}},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = { 'tabs' }
|
||||
lualine_z = {
|
||||
{'tabs',
|
||||
mode=1,
|
||||
fmt = function(name, context)
|
||||
local buflist = vim.fn.tabpagebuflist(context.tabnr)
|
||||
local mod = not vim.tbl_isempty(vim.tbl_filter(
|
||||
function(bufnr) return vim.fn.getbufvar(bufnr, '&mod') == 1 end,
|
||||
buflist))
|
||||
|
||||
local wincount = #vim.tbl_filter(
|
||||
function(i) return i == 'leaf' end,
|
||||
vim.tbl_flatten(vim.fn.winlayout(context.tabnr))
|
||||
)
|
||||
|
||||
return name .. (wincount > 1 and ' +' .. (wincount - 1) or '') .. (mod and ' [✏️]]' or '')
|
||||
end
|
||||
} }
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { 'filename' },
|
||||
lualine_a = { filename },
|
||||
lualine_b = { 'diff', 'diagnostics' },
|
||||
lualine_x = { "require'lsp-status'.status()" },
|
||||
lualine_y = { 'filetype' },
|
||||
|
@ -28,7 +44,7 @@ return {
|
|||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { 'filename' },
|
||||
lualine_c = { filename },
|
||||
lualine_x = { 'location' },
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
local function ts_disable(_, bufnr)
|
||||
return vim.api.nvim_buf_line_count(bufnr) > 5000
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
|
@ -32,7 +36,7 @@ return {
|
|||
},
|
||||
---@type TSConfig
|
||||
opts = {
|
||||
highlight = { enable = true },
|
||||
highlight = { enable = true, disable = ts_disable },
|
||||
indent = { enable = true },
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
|
|
Loading…
Reference in a new issue