Skip to content

Display indentation in lualine #3

@aquaherd

Description

@aquaherd
local indent = {
    function()
        local style = vim.bo.expandtab and "Spaces" or "Tab Size"
        local size = vim.bo.expandtab and vim.bo.tabstop or vim.bo.shiftwidth
        return style .. ": " .. size
    end,
    cond = function()
        return vim.bo.filetype ~= ""
    end,
}

-- in your lualine section
-- ...
sections = {
    -- ...
    lualine_x = { indent, 'encoding', 'fileformat', 'filetype' },
    -- ...
},

-- ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions