summaryrefslogtreecommitdiff
path: root/pkgs/custom-neovim/config/lua/utilities.lua
blob: 3de4a549a75807968ee5cb29d1fd9f83cf6ed646 (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
utils = {}

utils.mapkey = function(mode, key, desc, action)
  vim.keymap.set(mode, key, action, {noremap = true, silent = true, desc = desc})
end

utils.generate_theme_from_lualine = function()
  local auto_theme = require("lualine.themes.auto")
  return {
    modes = {
      normal = auto_theme.normal.a.bg,
      insert = auto_theme.insert.a.bg,
      visual = auto_theme.visual.a.bg,
      replace = auto_theme.replace.a.bg,
      command = auto_theme.command.a.bg,
      inactive = auto_theme.inactive.a.bg,
    },
    text = {
      dark = auto_theme.normal.a.fg,
      light = auto_theme.normal.c.fg,
    },
    background = auto_theme.normal.c.bg,
  }
end