Light refactoring, move as many config = func uses into opts as

possible.
This commit is contained in:
Martin Larsson 2024-07-12 17:04:53 +02:00
parent 657f9cb7e1
commit 0a53678bb9
10 changed files with 119 additions and 140 deletions

View file

@ -1,19 +1,17 @@
return { return {
"rmagatti/auto-session", "rmagatti/auto-session",
config = function() opts = {
require("auto-session").setup { log_level = "error",
log_level = "error", auto_session_suppress_dirs = {
auto_session_suppress_dirs = { "/",
"/", "~/",
"~/", "~/Projects",
"~/Projects", "~/Downloads",
"~/Downloads", "~/Development",
"~/Development", "~/Dev",
"~/Dev", "~/Dev/Git",
"~/Dev/Git", "~/.config",
"~/.config", "~/dev/git/.dotfiles",
"~/dev/git/.dotfiles", },
}, }
}
end
} }

View file

@ -1,17 +1,15 @@
return { return {
"norcalli/nvim-colorizer.lua", "norcalli/nvim-colorizer.lua",
config = function() opts = {
require("colorizer").setup({ DEFAULT_OPTIONS = {
DEFAULT_OPTIONS = { RGB = true,
RGB = true, RRGGBB = true,
RRGGBB = true, names = false,
names = false, RRGGBBAA = true,
RRGGBBAA = true, css = true,
css = true, css_fn = true,
css_fn = true, mode = "background",
mode = "background", },
}, "*",
"*", }
})
end,
} }

View file

@ -1,11 +1,9 @@
return { return {
"ggandor/flit.nvim", "ggandor/flit.nvim",
config = function() opts = {
require("flit").setup { keys = { f = "f", F = "F", t = "t", T = "T" },
keys = { f = "f", F = "F", t = "t", T = "T" }, labeled_modes = "v",
labeled_modes = "v", multiline = true,
multiline = true, opts = {}
opts = {} }
}
end,
} }

View file

@ -1,12 +1,10 @@
return { return {
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
main = "ibl", main = "ibl",
config = function() opts = {
require("ibl").setup({ debounce = 100,
debounce = 100, scope = {
scope = { enabled = false
enabled = false },
}, }
})
end
} }

View file

@ -8,15 +8,6 @@ return {
require("lspsaga").setup({ require("lspsaga").setup({
symbol_in_winbar = { symbol_in_winbar = {
enable = false, enable = false,
-- separator = " ",
-- hide_keyword = true,
-- ignore_patterns = nil,
-- show_file = true,
-- folder_level = 2,
-- color_mode = true,
-- dely = 300,
-- show_nodes = true,
-- max_nodes = 2,
}, },
implement = { implement = {
enable = false, enable = false,

View file

@ -1,3 +0,0 @@
return {
"nvim-lua/plenary.nvim",
}

View file

@ -1,6 +1,7 @@
return { return {
"LennyPhoenix/project.nvim", "LennyPhoenix/project.nvim",
branch = "fix-get_clients", branch = "fix-get_clients",
-- This plugin does not have a lua module and we have to use config
config = function() config = function()
require("project_nvim").setup({ require("project_nvim").setup({
patterns = { patterns = {

View file

@ -1,8 +1,9 @@
return { return {
"rasulomaroff/reactive.nvim", "rasulomaroff/reactive.nvim",
config = function() opts = {
require("reactive").setup({ load = {
load = { "catppuccin-macchiato-cursor", "catppuccin-macchiato-cursorline" } "catppuccin-macchiato-cursor",
}) "catppuccin-macchiato-cursorline",
end, }
}
} }

View file

@ -2,15 +2,13 @@ return {
"kylechui/nvim-surround", "kylechui/nvim-surround",
version = "*", version = "*",
event = "VeryLazy", event = "VeryLazy",
config = function() opts = {
require("nvim-surround").setup({ -- Make sure that we never get whitespaces when adding surroundings
-- Make sure that we never get whitespaces when adding surroundings surrounds = {
surrounds = { ["("] = { add = { "(", ")" }, },
["("] = { add = { "(", ")" }, }, ["{"] = { add = { "{", "}" }, },
["{"] = { add = { "{", "}" }, }, ["<"] = { add = { "<", ">" }, },
["<"] = { add = { "<", ">" }, }, ["["] = { add = { "[", "]" }, },
["["] = { add = { "[", "]" }, }, }
} }
})
end,
} }

View file

@ -3,77 +3,76 @@ return {
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
build = ":TSUpdate", build = ":TSUpdate",
dependencies = { dependencies = {
"nvim-treesitter/nvim-treesitter-context", {
"nvim-treesitter/nvim-treesitter-context",
opts = {
max_lines = 2, -- How many lines the window should span. Values <= 0 mean no limit.
multiline_threshold = 3, -- Maximum number of lines to show for a single context
trim_scope = "inner", -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
}
},
"nvim-treesitter/nvim-treesitter-textobjects", "nvim-treesitter/nvim-treesitter-textobjects",
}, },
config = function() opts = {
require("nvim-treesitter.configs").setup({ ensure_installed = {
ensure_installed = { "vim",
"vim", "vimdoc",
"vimdoc", "bash",
"bash", "lua",
"lua", "c",
"c", "cpp",
"cpp", "c_sharp",
"c_sharp", "rust",
"rust", "cmake",
"cmake", "make",
"make", "yaml",
"yaml", "ninja",
"ninja", "gitignore",
"gitignore", "markdown",
"markdown", "markdown_inline",
"markdown_inline", "hyprlang",
"hyprlang", "json",
"json", "html",
"html", "hlsl",
"hlsl", "glsl",
"glsl", "gdshader",
"gdshader", "gdscript",
"gdscript", "dockerfile",
"dockerfile", "dart",
"dart", "css",
"css", "regex"
"regex" },
sync_install = false,
-- This can be updated to a list of languages instead of defaulting to true
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-cr>",
node_incremental = "<C-cr>",
scope_incremental = false,
node_decremental = "<C-bs>",
}, },
sync_install = false, },
-- This can be updated to a list of languages instead of defaulting to true textobjects = {
highlight = { select = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = { enable = true },
incremental_selection = {
enable = true, enable = true,
lookahead = true,
keymaps = { keymaps = {
init_selection = "<C-cr>", ["ic"] = { query = "@class.inner" },
node_incremental = "<C-cr>", ["ac"] = { query = "@class.outer" },
scope_incremental = false, ["ii"] = { query = "@conditional.inner" },
node_decremental = "<C-bs>", ["ai"] = { query = "@conditional.outer" },
["if"] = { query = "@function.inner" },
["af"] = { query = "@function.outer" },
["il"] = { query = "@loop.inner" },
["al"] = { query = "@loop.outer" },
}, },
}, },
textobjects = { },
select = { }
enable = true,
lookahead = true,
keymaps = {
["ic"] = { query = "@class.inner" },
["ac"] = { query = "@class.outer" },
["ii"] = { query = "@conditional.inner" },
["ai"] = { query = "@conditional.outer" },
["if"] = { query = "@function.inner" },
["af"] = { query = "@function.outer" },
["il"] = { query = "@loop.inner" },
["al"] = { query = "@loop.outer" },
},
},
},
})
require("treesitter-context").setup({
max_lines = 2, -- How many lines the window should span. Values <= 0 mean no limit.
multiline_threshold = 3, -- Maximum number of lines to show for a single context
trim_scope = "inner", -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
})
end,
} }