Skip to content

Status line display editor indentation #938

Answered by fitrh
Gitfz810 asked this question in Q&A
Discussion options

You must be logged in to vote

I think you can try something like this

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' },
    -- ...
},
-- ...

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Gitfz810
Comment options

Answer selected by Gitfz810
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants