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 {
"rmagatti/auto-session",
config = function()
require("auto-session").setup {
log_level = "error",
auto_session_suppress_dirs = {
"/",
"~/",
"~/Projects",
"~/Downloads",
"~/Development",
"~/Dev",
"~/Dev/Git",
"~/.config",
"~/dev/git/.dotfiles",
},
}
end
opts = {
log_level = "error",
auto_session_suppress_dirs = {
"/",
"~/",
"~/Projects",
"~/Downloads",
"~/Development",
"~/Dev",
"~/Dev/Git",
"~/.config",
"~/dev/git/.dotfiles",
},
}
}

View file

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

View file

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

View file

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

View file

@ -8,15 +8,6 @@ return {
require("lspsaga").setup({
symbol_in_winbar = {
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 = {
enable = false,

View file

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

View file

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

View file

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

View file

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

View file

@ -3,77 +3,76 @@ return {
event = { "BufReadPre", "BufNewFile" },
build = ":TSUpdate",
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",
},
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = {
"vim",
"vimdoc",
"bash",
"lua",
"c",
"cpp",
"c_sharp",
"rust",
"cmake",
"make",
"yaml",
"ninja",
"gitignore",
"markdown",
"markdown_inline",
"hyprlang",
"json",
"html",
"hlsl",
"glsl",
"gdshader",
"gdscript",
"dockerfile",
"dart",
"css",
"regex"
opts = {
ensure_installed = {
"vim",
"vimdoc",
"bash",
"lua",
"c",
"cpp",
"c_sharp",
"rust",
"cmake",
"make",
"yaml",
"ninja",
"gitignore",
"markdown",
"markdown_inline",
"hyprlang",
"json",
"html",
"hlsl",
"glsl",
"gdshader",
"gdscript",
"dockerfile",
"dart",
"css",
"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
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = { enable = true },
incremental_selection = {
},
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
init_selection = "<C-cr>",
node_incremental = "<C-cr>",
scope_incremental = false,
node_decremental = "<C-bs>",
["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" },
},
},
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,
},
}
}