all repos

init.lua @ fe59924

my nvim config
4 files changed, 38 insertions(+), 35 deletions(-)
refactor(plugins): move on from `config` to `opts` in plugins setup
Author: Smirnov Oleksandr ss2316544@gmail.com
Committed at: 2024-04-15 01:21:23 +0300
Parent: 4478ad7
M lua/plugins/completion.lua

@@ -31,12 +31,10 @@ require("luasnip").lsp_expand(args.body)

end, }, window = {}, - view = { - entries = { - follow_cursor = true, - }, - }, + ---@diagnostic disable-next-line: missing-fields + view = { entries = { follow_cursor = true } }, experimental = { ghost_text = true }, + ---@diagnostic disable-next-line: missing-fields formatting = { format = function(_, vim_item) vim_item.kind = ({
M lua/plugins/core.lua

@@ -29,17 +29,19 @@ },

{ "ahmedkhalf/project.nvim", event = "VeryLazy", - config = function() - require("project_nvim").setup { - patterns = { - "^\\.git$", - "package.json", - "go.mod", - "go.work", - "Cargo.toml", - "deps.edn", - }, - } + ---@type ProjectOptions + opts = { + patterns = { + "^\\.git$", + "package.json", + "go.mod", + "go.work", + "Cargo.toml", + "deps.edn", + }, + }, + config = function(_, opts) + require("project_nvim").setup(opts) end, }, }
M lua/plugins/navigation.lua

@@ -25,13 +25,15 @@ { "<A-s>", function() h:list():select(3) end },

{ "<A-a>", function() h:list():select(4) end }, } end, - config = function() - require("harpoon"):setup { - settings = { - save_on_toggle = true, - sync_on_close = true, - }, - } + ---@type HarpoonPartialConfig + opts = { + settings = { + save_on_toggle = true, + sync_on_close = true, + }, + }, + config = function(_, opts) + require("harpoon"):setup(opts) end, },
M lua/plugins/treesitter.lua

@@ -10,17 +10,18 @@ },

build = function() pcall(vim.cmd.TSUpdate) end, - config = function() - require("nvim-treesitter.configs").setup { - auto_install = true, - -- install explained because most of it uses as injections - -- and it doesnt install automatically - ensure_installed = { "sql", "markdown", "markdown_inline", "vim" }, - indent = { enable = true, disable = { "python" } }, - highlight = { enable = true, additional_vim_regex_highlighting = false }, - autopairs = { enable = true }, - endwise = { enable = true }, - rainbow = { enable = true }, - } + ---@type TSConfig + ---@diagnostic disable-next-line: missing-fields + opts = { + auto_install = true, + ensure_installed = { "sql", "markdown", "markdown_inline", "vim" }, + indent = { enable = true, disable = { "python" } }, + highlight = { enable = true, additional_vim_regex_highlighting = false }, + autopairs = { enable = true }, + endwise = { enable = true }, + rainbow = { enable = true }, + }, + config = function(_, opts) + require("nvim-treesitter.configs").setup(opts) end, }