diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-08-10 23:15:04 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-08-10 23:15:04 +0200 |
commit | 540268d618627079c9b958a955b586e1888b46a8 (patch) | |
tree | 1a22a5feb457135178b9d4fe8b6c1755f5ca66bc /.config/nvim/lua/extra/twilight.lua | |
parent | e79bd3273f58ba38e8fcd716090b89326791afbb (diff) |
Major refactor of nvim
Diffstat (limited to '.config/nvim/lua/extra/twilight.lua')
-rw-r--r-- | .config/nvim/lua/extra/twilight.lua | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/.config/nvim/lua/extra/twilight.lua b/.config/nvim/lua/extra/twilight.lua new file mode 100644 index 0000000..b76563a --- /dev/null +++ b/.config/nvim/lua/extra/twilight.lua @@ -0,0 +1,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 |