summaryrefslogtreecommitdiff
path: root/pkgs/old-custom-neovim/config/lua/plugins/dropbar.lua
blob: 5d4bb43ccf6c62e9b24b1dd47f023e153cb6e1f7 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
local dropbar = require('dropbar')
local sources = require('dropbar.sources')
local utils = require('dropbar.utils')

Utils.link_highlight("DropBarFileName", "MiniFilesTitleFocused")

local custom_path = {
  get_symbols = function(buff, win, cursor)
    local symbols = sources.path.get_symbols(buff, win, cursor)
    symbols[#symbols].name_hl = 'DropBarFileName'
    if vim.bo[buff].modified then
      symbols[#symbols].name = symbols[#symbols].name .. ' [+]'
      symbols[#symbols].name_hl = 'DropBarFileName'
      symbols[#symbols].truncate = false
    end
    return symbols
  end,
}

dropbar.setup({
  bar = {
    sources = function(buf, _)
      if vim.bo[buf].ft == 'markdown' then
        return {
          custom_path,
          sources.markdown,
        }
      end
      -- if vim.bo[buf].buftype == 'terminal' then
      --   return {
      --     sources.terminal,
      --   }
      -- end
      return {
        custom_path,
        utils.source.fallback {
          sources.lsp,
          sources.treesitter,
        },
      }
    end,
  },
})