all repos

init.lua @ 32361ce

my nvim config

init.lua/lua/core/utils.lua(view raw)

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
return {
  ---@param mode string
  ---@param from string
  ---@param to string|function
  map = function(mode, from, to)
    vim.keymap.set(mode, from, to, { noremap = true, silent = true })
  end,

  ---@param mode string
  ---@param from string
  ---@param to string|function
  expr = function(mode, from, to)
    vim.keymap.set(mode, from, to, { noremap = true, expr = true })
  end,

  get = {
    ---@param path string
    ---@return string
    config = function(path)
      return string.format("require[[configs.%s]]", path)
    end,

    ---@param path string
    ---@return string
    setup = function(path)
      return string.format("require[[%s]].setup()", path)
    end,

    ---@param plug string
    ---@return string
    other = function(plug)
      return string.format("require[[configs.other]].%s()", plug)
    end,
  },
}