summaryrefslogtreecommitdiff
path: root/pkgs/custom-neovim/config/lua/plugins/incline.lua
blob: 92ced03ac00c369172b7ba60c64bda824bca455b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
local icons = require 'mini.icons'
require('incline').setup {
  hide = {
    only_win = true,
  },
  window = {
    padding = 0,
    margin = { horizontal = 0 },
  },
  render = function(props)
    local filename = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ':t')
    if filename == '' then
      filename = '[No Name]'
    end
    local ft_icon, ft_hl = icons.get("file", filename)
    local modified = vim.bo[props.buf].modified
    return {
      ft_icon and { ' ', ft_icon, ' ', gui = ft_hl } or '',
      ' ',
      { filename, gui = 'bold' },
      ' ',
      modified and '[+] ' or '',
    }
  end,
}