aboutsummaryrefslogtreecommitdiff
path: root/plugin-settings
diff options
context:
space:
mode:
Diffstat (limited to 'plugin-settings')
-rw-r--r--plugin-settings/indent-blankline.lua68
-rw-r--r--plugin-settings/lspconfig.lua2
-rw-r--r--plugin-settings/nvim-treesitter.lua14
3 files changed, 55 insertions, 29 deletions
diff --git a/plugin-settings/indent-blankline.lua b/plugin-settings/indent-blankline.lua
index a0f1096..2797156 100644
--- a/plugin-settings/indent-blankline.lua
+++ b/plugin-settings/indent-blankline.lua
@@ -1,27 +1,63 @@
-vim.api.nvim_set_hl(0, "IblScope", { ctermfg = "Gray" })
-vim.api.nvim_set_hl(0, "IblWhitespace", { ctermfg = "DarkGray" })
-vim.api.nvim_set_hl(0, "RainbowRed", { ctermfg = "Red" })
-vim.api.nvim_set_hl(0, "RainbowYellow", { ctermfg = "Yellow" })
-vim.api.nvim_set_hl(0, "RainbowBlue", { ctermfg = "Blue" })
-vim.api.nvim_set_hl(0, "RainbowGreen", { ctermfg = "Green" })
-vim.api.nvim_set_hl(0, "RainbowMagenta", { ctermfg = "Magenta" })
-vim.api.nvim_set_hl(0, "RainbowCyan", { ctermfg = "Cyan" })
-
local highlight = {
"RainbowRed",
"RainbowYellow",
"RainbowBlue",
+ "RainbowOrange",
"RainbowGreen",
- "RainbowMagenta",
+ "RainbowViolet",
"RainbowCyan",
}
-require("ibl").setup {
- indent = {
- char = "›",
- highlight = highlight,
- },
-}
+--- Replace undercurls with underlines as tmux does not show undercurls
+local function replace_undercurl_with_underline()
+ local hlg = vim.api.nvim_get_hl(0, { link = true })
+ for name, attributes in pairs(hlg) do
+ if attributes.undercurl then
+ attributes.undercurl = false
+ attributes.underline = true
+ vim.api.nvim_set_hl(0, name, attributes)
+ end
+ end
+end
+
+--- Remove the background attribute from the given highlight group
+-- @param name string
+local function remove_background(name)
+ local attributes = vim.api.nvim_get_hl(0, { name = name })
+ if attributes.bg then
+ local without_bg = {}
+ for k, v in pairs(attributes) do
+ if k ~= "bg" then
+ without_bg[k] = v
+ end
+ end
+ vim.api.nvim_set_hl(0, name, without_bg)
+ end
+end
+
+local hooks = require("ibl.hooks")
+-- create the highlight groups in the highlight setup hook, so they are reset
+-- every time the colorscheme changes
+hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
+ remove_background("Normal")
+ remove_background("EndOfBuffer")
+ replace_undercurl_with_underline() -- as tmux does not show undercurls
+ vim.api.nvim_set_hl(0, "NonText", { fg = "DarkGray" })
+ vim.api.nvim_set_hl(0, "Whitespace", { fg = "DarkGray" })
+ vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
+ vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
+ vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
+ vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
+ vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
+ vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
+ vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
+end)
+
+vim.g.rainbow_delimiters = { highlight = highlight }
+
+hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
+
+require("ibl").setup { indent = { char = "›", highlight = highlight, }, }
vim.opt.list = true
vim.opt.listchars = {
diff --git a/plugin-settings/lspconfig.lua b/plugin-settings/lspconfig.lua
index e8417df..8cd26c3 100644
--- a/plugin-settings/lspconfig.lua
+++ b/plugin-settings/lspconfig.lua
@@ -51,6 +51,7 @@ local simple_servers = {
}
for _, lsp in ipairs(simple_servers) do
vim.lsp.config(lsp, { capabilities = capabilities, on_attach = on_attach })
+ vim.lsp.enable(lsp)
end
vim.lsp.config("lua_ls", {
@@ -90,3 +91,4 @@ vim.lsp.config("lua_ls", {
Lua = {},
},
})
+vim.lsp.enable("lua_ls")
diff --git a/plugin-settings/nvim-treesitter.lua b/plugin-settings/nvim-treesitter.lua
index 4afe91e..2fd60d2 100644
--- a/plugin-settings/nvim-treesitter.lua
+++ b/plugin-settings/nvim-treesitter.lua
@@ -1,13 +1 @@
-require("nvim-treesitter.configs").setup({
- -- A list of parser names, or "all" (the four listed parsers should always be installed)
- ensure_installed = { "c", "lua", "vim" },
- ignore_install = { "org" },
-
- -- Automatically install missing parsers when entering buffer
- -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
- auto_install = true,
-
- highlight = {
- enable = true,
- },
-})
+require('nvim-treesitter').install({ 'c', 'lua', 'markdown', 'vim' }):wait(300000) -- wait max. 5 minutes