diff --git a/lua/telescope/previewers.lua b/lua/telescope/previewers.lua index d69f73f..8925a9e 100644 --- a/lua/telescope/previewers.lua +++ b/lua/telescope/previewers.lua @@ -23,6 +23,7 @@ local has_less = (vim.fn.executable('less') == 1) and config.values.use_less local bat_maker = function(filename, lnum, start, finish) local command = {"bat"} + local theme = os.getenv("BAT_THEME") if lnum then table.insert(command, { "--highlight-line", lnum}) @@ -40,6 +41,10 @@ local bat_maker = function(filename, lnum, start, finish) end end + if theme ~= nil then + table.insert(command, { "--theme", string.format("%s", theme) }) + end + return flatten { command, bat_options, "--", filename }