diff options
| author | Abouzar Parvan <[email protected]> | 2022-09-20 14:11:58 +0430 | 
|---|---|---|
| committer | GitHub <[email protected]> | 2022-09-20 14:11:58 +0430 | 
| commit | 518b1d4167162a54a6e76784038d30191613b76d (patch) | |
| tree | 6007451a5e1f77db9ee116ee1a262c8f0639115d /lua/lvim/core | |
| parent | 03ec31253fc868b3ab5a8217640ec04248ae0046 (diff) | |
Fix: make sure latest plugins are customizable (#3044)
* fix: make navim-navic configurable
* fix: make sure vim-illuminate is configurable
* fix: make sure theme is configurable
* fix(ci): don't verify uninstalled plugins
* refactor(lsp): add setup_document_symbols util
* revert: keep onedarker on freeze branch
* refactor(lsp): avoid duplicate hl autocmds
Co-authored-by: kylo252 <[email protected]>
Diffstat (limited to 'lua/lvim/core')
| -rw-r--r-- | lua/lvim/core/breadcrumbs.lua | 106 | ||||
| -rw-r--r-- | lua/lvim/core/builtins/init.lua | 1 | ||||
| -rw-r--r-- | lua/lvim/core/illuminate.lua | 98 | ||||
| -rw-r--r-- | lua/lvim/core/theme.lua | 50 | 
4 files changed, 161 insertions, 94 deletions
| diff --git a/lua/lvim/core/breadcrumbs.lua b/lua/lvim/core/breadcrumbs.lua index 3b038473..9289cb03 100644 --- a/lua/lvim/core/breadcrumbs.lua +++ b/lua/lvim/core/breadcrumbs.lua @@ -3,60 +3,66 @@ local M = {}  -- local Log = require "lvim.core.log"  M.config = function() +  lvim.builtin.breadcrumbs = { +    active = false, +    on_config_done = nil, +    options = { +      icons = { +        Text = " ", +        Method = " ", +        Function = " ", +        Constructor = " ", +        Field = " ", +        Variable = " ", +        Class = " ", +        Interface = " ", +        Module = " ", +        Property = " ", +        Unit = " ", +        Value = " ", +        Enum = " ", +        Keyword = " ", +        Snippet = " ", +        Color = " ", +        File = " ", +        Reference = " ", +        Folder = " ", +        EnumMember = " ", +        Constant = " ", +        Struct = " ", +        Event = " ", +        Operator = " ", +        TypeParameter = " ", +        Array = " ", +        Number = " ", +        String = " ", +        Boolean = "蘒", +        Object = " ", +        Package = " ", +        Namespace = "", +        Key = "", +        Null = "ﳠ", +      }, +      highlight = true, +      separator = " " .. ">" .. " ", +      depth_limit = 0, +      depth_limit_indicator = "..", +    }, +  } +end + +M.setup = function()    local status_ok, navic = pcall(require, "nvim-navic")    if not status_ok then      return    end -  navic.setup { -    icons = { -      Text = " ", -      -- Method = "m", -      -- Function = "", -      -- Constructor = "", -      Method = " ", -      Function = " ", -      Constructor = " ", -      Field = " ", -      -- Variable = "", -      Variable = " ", -      Class = " ", -      Interface = " ", -      -- Module = "", -      Module = " ", -      Property = " ", -      Unit = " ", -      Value = " ", -      Enum = " ", -      -- Keyword = "", -      Keyword = " ", -      -- Snippet = "", -      Snippet = " ", -      Color = " ", -      File = " ", -      Reference = " ", -      Folder = " ", -      EnumMember = " ", -      Constant = " ", -      Struct = " ", -      Event = " ", -      Operator = " ", -      TypeParameter = " ", -      Array = " ", -      Number = " ", -      String = " ", -      Boolean = "蘒", -      Object = " ", -      Package = " ", -      Namespace = "", -      Key = "", -      Null = "ﳠ", -    }, -    highlight = true, -    separator = " " .. ">" .. " ", -    depth_limit = 0, -    depth_limit_indicator = "..", -  } +  M.create_winbar() +  navic.setup(lvim.builtin.breadcrumbs.options) + +  if lvim.builtin.breadcrumbs.on_config_done then +    lvim.builtin.breadcrumbs.on_config_done() +  end  end  M.winbar_filetype_exclude = { @@ -199,6 +205,4 @@ M.create_winbar = function()    end  end -M.create_winbar() -  return M diff --git a/lua/lvim/core/builtins/init.lua b/lua/lvim/core/builtins/init.lua index 14afe4ea..36d09d2e 100644 --- a/lua/lvim/core/builtins/init.lua +++ b/lua/lvim/core/builtins/init.lua @@ -1,6 +1,7 @@  local M = {}  local builtins = { +  "lvim.core.theme",    "lvim.core.which-key",    "lvim.core.gitsigns",    "lvim.core.cmp", diff --git a/lua/lvim/core/illuminate.lua b/lua/lvim/core/illuminate.lua index e29b091a..e0c8c775 100644 --- a/lua/lvim/core/illuminate.lua +++ b/lua/lvim/core/illuminate.lua @@ -1,53 +1,65 @@  local M = {}  M.config = function() +  lvim.builtin.illuminate = { +    active = true, +    on_config_done = nil, +    options = { +      -- providers: provider used to get references in the buffer, ordered by priority +      providers = { +        "lsp", +        "treesitter", +        "regex", +      }, +      -- delay: delay in milliseconds +      delay = 120, +      -- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist +      filetypes_denylist = { +        "dirvish", +        "fugitive", +        "alpha", +        "NvimTree", +        "packer", +        "neogitstatus", +        "Trouble", +        "lir", +        "Outline", +        "spectre_panel", +        "toggleterm", +        "DressingSelect", +        "TelescopePrompt", +      }, +      -- filetypes_allowlist: filetypes to illuminate, this is overriden by filetypes_denylist +      filetypes_allowlist = {}, +      -- modes_denylist: modes to not illuminate, this overrides modes_allowlist +      modes_denylist = {}, +      -- modes_allowlist: modes to illuminate, this is overriden by modes_denylist +      modes_allowlist = {}, +      -- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist +      -- Only applies to the 'regex' provider +      -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name') +      providers_regex_syntax_denylist = {}, +      -- providers_regex_syntax_allowlist: syntax to illuminate, this is overriden by providers_regex_syntax_denylist +      -- Only applies to the 'regex' provider +      -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name') +      providers_regex_syntax_allowlist = {}, +      -- under_cursor: whether or not to illuminate under the cursor +      under_cursor = true, +    }, +  } +end + +M.setup = function()    local status_ok, illuminate = pcall(require, "illuminate")    if not status_ok then      return    end -  -- default configuration -  illuminate.configure { -    -- providers: provider used to get references in the buffer, ordered by priority -    providers = { -      "lsp", -      "treesitter", -      "regex", -    }, -    -- delay: delay in milliseconds -    delay = 120, -    -- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist -    filetypes_denylist = { -      "dirvish", -      "fugitive", -      "alpha", -      "NvimTree", -      "packer", -      "neogitstatus", -      "Trouble", -      "lir", -      "Outline", -      "spectre_panel", -      "toggleterm", -      "DressingSelect", -      "TelescopePrompt", -    }, -    -- filetypes_allowlist: filetypes to illuminate, this is overriden by filetypes_denylist -    filetypes_allowlist = {}, -    -- modes_denylist: modes to not illuminate, this overrides modes_allowlist -    modes_denylist = {}, -    -- modes_allowlist: modes to illuminate, this is overriden by modes_denylist -    modes_allowlist = {}, -    -- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist -    -- Only applies to the 'regex' provider -    -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name') -    providers_regex_syntax_denylist = {}, -    -- providers_regex_syntax_allowlist: syntax to illuminate, this is overriden by providers_regex_syntax_denylist -    -- Only applies to the 'regex' provider -    -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name') -    providers_regex_syntax_allowlist = {}, -    -- under_cursor: whether or not to illuminate under the cursor -    under_cursor = true, -  } + +  illuminate.configure(lvim.builtin.illuminate.options) + +  if lvim.builtin.illuminate.on_config_done then +    lvim.builtin.illuminate.on_config_done() +  end  end  return M diff --git a/lua/lvim/core/theme.lua b/lua/lvim/core/theme.lua new file mode 100644 index 00000000..c02aaa7e --- /dev/null +++ b/lua/lvim/core/theme.lua @@ -0,0 +1,50 @@ +local M = {} + +M.config = function() +  lvim.builtin.theme = { +    name = "tokyonight", +    options = { +      style = "night", -- The theme comes in three styles, `storm`, a darker variant `night` and `day` +      transparent = lvim.transparent_window, -- Enable this to disable setting the background color +      terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim +      styles = { +        -- Style to be applied to different syntax groups +        -- Value is any valid attr-list value for `:help nvim_set_hl` +        comments = { italic = true }, +        keywords = { italic = true }, +        functions = {}, +        variables = {}, +        -- Background styles. Can be "dark", "transparent" or "normal" +        sidebars = "dark", -- style for sidebars, see below +        floats = "dark", -- style for floating windows +      }, +      -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]` +      sidebars = { +        "qf", +        "vista_kind", +        "terminal", +        "packer", +        "spectre_panel", +        "NeogitStatus", +        "help", +      }, +      day_brightness = 0.3, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors +      hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**. +      dim_inactive = false, -- dims inactive windows +      lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold +      use_background = true, -- can be light/dark/auto. When auto, background will be set to vim.o.background +    }, +  } +end + +M.setup = function() +  local status_ok, theme = pcall(require, "tokyonight") +  if not status_ok then +    return +  end + +  theme.setup(lvim.builtin.theme.options) +  lvim.builtin.lualine.options.theme = "tokyonight" +end + +return M | 
