summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/extra/twilight.lua
blob: b76563a11136c99c669493bbd3aa427799bf5ebf (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
local M = {}
local Log = require "core.log"

M.config = function()
  local status_ok, twilight = pcall(require, "twilight")
  if not status_ok then
    Log:get_default().error "Failed to load twilight"
    return
  end

  twilight.setup {
    dimming = {
      alpha = 0.25, -- amount of dimming
      -- we try to get the foreground from the highlight groups or fallback color
      color = { "Normal", "#ffffff" },
    },
    context = 15, -- amount of lines we will try to show around the current line
    -- treesitter is used to automatically expand the visible text,
    -- but you can further control the types of nodes that should always be fully expanded
    expand = {
      "function",
      "method",
      "table",
      "if_statement",
    },
    exclude = {}, -- exclude these filetypes
  }
end

return M