b0o / incline.nvim

🎈 Floating statuslines for Neovim, winbar alternative
MIT License
759 stars 14 forks source link

Is there a way to show filename relative to cwd? #20

Closed kuator closed 2 years ago

syphar commented 2 years ago

you can solve this by overriding the render method:

require("incline").setup({
    render = function(props)
        local bufname = vim.api.nvim_buf_get_name(props.buf)
        if bufname == "" then
            return "[No name]"
        else
            return vim.fn.fnamemodify(bufname, ":.")
        end
    end,
})
kuator commented 2 years ago

Thanks!