diff --git a/lazy-lock.json b/lazy-lock.json index 837e26a..42645fc 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,44 +1,45 @@ { - "LazyVim": { "branch": "main", "commit": "3660c52017462dfc472ff436261100a98ebea34d" }, - "SchemaStore.nvim": { "branch": "main", "commit": "b62efcb71077bfeb407dcd05fb0584e422131150" }, + "LazyVim": { "branch": "main", "commit": "2bea40c447b72e54ffb2d5cddc98d7798990796f" }, + "SchemaStore.nvim": { "branch": "main", "commit": "5be212138af55d3dcae9d77b5b14f63634243e3d" }, "avante.nvim": { "branch": "main", "commit": "0a837a4583d66abaf85c9d31f5efad12af87c736" }, "blink.cmp": { "branch": "main", "commit": "1cc3b1a908fbcfd15451c4772759549724f38524" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "catppuccin": { "branch": "main", "commit": "f67b886d65a029f12ffa298701fb8f1efd89295d" }, - "conform.nvim": { "branch": "master", "commit": "6dc21d4ce050c2e592d9635b7983d67baf216e3d" }, + "conform.nvim": { "branch": "master", "commit": "f8d743ce333bedc47821de2cd4d23c43856ecbe5" }, "copilot.lua": { "branch": "master", "commit": "886ee73b6d464b2b3e3e6a7ff55ce87feac423a9" }, "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, - "fzf-lua": { "branch": "main", "commit": "a534583995c6e521c55793d2cd11e5a4330a5d0a" }, - "gitsigns.nvim": { "branch": "main", "commit": "817bd848fffe82e697b4da656e3f2834cd0665c5" }, + "fzf-lua": { "branch": "main", "commit": "29e2909e576258c0502b27efd865ad054362fdd9" }, + "gitsigns.nvim": { "branch": "main", "commit": "3ec5fbd9202ae3908551c98c4b6c3c05ff7c8e96" }, "grug-far.nvim": { "branch": "main", "commit": "8e8f3429038d45a6d4144c0642d92f470e5480f3" }, - "img-clip.nvim": { "branch": "main", "commit": "5ff183655ad98b5fc50c55c66540375bbd62438c" }, + "img-clip.nvim": { "branch": "main", "commit": "da61a81872276b75a2971b056da1b849e0c1870b" }, "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, - "lazydev.nvim": { "branch": "main", "commit": "8620f82ee3f59ff2187647167b6b47387a13a018" }, + "lazydev.nvim": { "branch": "main", "commit": "a1b78b2ac6f978c72e76ea90ae92a94edf380cfc" }, + "llm.nvim": { "branch": "main", "commit": "ce69731ba3f8d3ea8bc4c8f58c74c2f9ea0b33de" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "e942edf5c85b6a2ab74059ea566cac5b3e1514a4" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mini.ai": { "branch": "main", "commit": "ebb04799794a7f94628153991e6334c3304961b8" }, "mini.icons": { "branch": "main", "commit": "910db5df9724d65371182948f921fce23c2c881e" }, "mini.pairs": { "branch": "main", "commit": "7e834c5937d95364cc1740e20d673afe2d034cdb" }, - "neo-tree.nvim": { "branch": "main", "commit": "d175a0ce24bcb022ec1c93635841c043d764418e" }, + "neo-tree.nvim": { "branch": "main", "commit": "c2c5f6f6d25eedc96a5f406faa5982d1e90f1104" }, "noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" }, "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, "nvim-cmp": { "branch": "main", "commit": "3403e2e9391ed0a28c3afddd8612701b647c8e26" }, - "nvim-lint": { "branch": "master", "commit": "9195dd0fa532f6657ff3bbc4bf7c5afa8a55ca43" }, - "nvim-lspconfig": { "branch": "master", "commit": "14b5a806c928390fac9ff4a5630d20eb902afad8" }, - "nvim-treesitter": { "branch": "master", "commit": "5da195ac3dfafd08d8b10756d975f0e01e1d563a" }, + "nvim-lint": { "branch": "master", "commit": "789b7ada1b4f00e08d026dffde410dcfa6a0ba87" }, + "nvim-lspconfig": { "branch": "master", "commit": "b4d65bce97795438ab6e1974b3672c17a4865e3c" }, + "nvim-treesitter": { "branch": "master", "commit": "51562d44fc6280f92bb9a3d87e7b3cb327377ca5" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, "nvim-web-devicons": { "branch": "master", "commit": "aafa5c187a15701a7299a392b907ec15d9a7075f" }, "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, "plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" }, "render-markdown.nvim": { "branch": "main", "commit": "ad055861d17afe058bd835e82292e14a64b51b1d" }, - "snacks.nvim": { "branch": "main", "commit": "cd58a14e20fdcd810b55e8aee535486a3ad8719f" }, + "snacks.nvim": { "branch": "main", "commit": "b96bd540f785c725289f9f15f0147b1b2dac5a35" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, - "tokyonight.nvim": { "branch": "main", "commit": "775f82f08a3d1fb55a37fc6d3a4ab10cd7ed8a10" }, + "tokyonight.nvim": { "branch": "main", "commit": "c3ab53c3f544e4a04f2a05d43451fd9bedff51b4" }, "trouble.nvim": { "branch": "main", "commit": "50481f414bd3c1a40122c1d759d7e424d5fafe84" }, "ts-comments.nvim": { "branch": "main", "commit": "872dcfa0418f4a33b7437fb4d9f4e89f2f000d74" }, - "which-key.nvim": { "branch": "main", "commit": "1f8d414f61e0b05958c342df9b6a4c89ce268766" } + "which-key.nvim": { "branch": "main", "commit": "6cebd86917df559a88de0f806b2989799c6e6423" } } diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index d73bfa1..c652b10 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -12,6 +12,7 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then os.exit(1) end end + vim.opt.rtp:prepend(lazypath) require("lazy").setup({ diff --git a/lua/plugins/avante.lua b/lua/plugins/avante.lua index 41b63c9..42507e3 100644 --- a/lua/plugins/avante.lua +++ b/lua/plugins/avante.lua @@ -1,46 +1,46 @@ return { - "yetone/avante.nvim", - event = "VeryLazy", - lazy = false, - version = "*", -- set this if you want to always pull the latest change - opts = { - -- add any opts here - }, - -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` - build = "make", - -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows - dependencies = { - "stevearc/dressing.nvim", - "nvim-lua/plenary.nvim", - "MunifTanjim/nui.nvim", - --- The below dependencies are optional, - "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions - "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons - "zbirenbaum/copilot.lua", -- for providers='copilot' - { - -- support for image pasting - "HakonHarnes/img-clip.nvim", - event = "VeryLazy", - opts = { - -- recommended settings - default = { - embed_image_as_base64 = false, - prompt_for_file_name = false, - drag_and_drop = { - insert_mode = true, - }, - -- required for Windows users - use_absolute_path = true, + "yetone/avante.nvim", + event = "VeryLazy", + lazy = false, + version = "*", -- set this if you want to always pull the latest change + opts = { + -- add any opts here + }, + -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` + build = "make", + -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows + dependencies = { + "stevearc/dressing.nvim", + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + --- The below dependencies are optional, + -- "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions + -- "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons + -- "zbirenbaum/copilot.lua", -- for providers='copilot' + { + -- support for image pasting + "HakonHarnes/img-clip.nvim", + event = "VeryLazy", + opts = { + -- recommended settings + default = { + embed_image_as_base64 = false, + prompt_for_file_name = false, + drag_and_drop = { + insert_mode = true, + }, + -- required for Windows users + use_absolute_path = true, + }, + }, + }, + { + -- Make sure to set this up properly if you have lazy=true + "MeanderingProgrammer/render-markdown.nvim", + opts = { + file_types = { "markdown", "Avante" }, + }, + ft = { "markdown", "Avante" }, }, - }, }, - { - -- Make sure to set this up properly if you have lazy=true - "MeanderingProgrammer/render-markdown.nvim", - opts = { - file_types = { "markdown", "Avante" }, - }, - ft = { "markdown", "Avante" }, - }, - }, } diff --git a/lua/plugins/format.lua b/lua/plugins/format.lua index 16e45f7..e6e03b2 100644 --- a/lua/plugins/format.lua +++ b/lua/plugins/format.lua @@ -1,73 +1,72 @@ -vim.api.nvim_create_autocmd("BufWritePre", { - pattern = "*", - callback = function() - vim.lsp.buf.format({ async = false }) - end, -}) - return { - { - "stevearc/conform.nvim", - opts = { - formatters_by_ft = { - nix = { "nixfmt" }, - lua = { "stylua" }, - javascript = { { "prettierd" } }, - javascriptreact = { { "prettierd" } }, - typescript = { { "prettierd" } }, - typescriptreact = { { "prettierd" } }, - json = { "prettierd" }, - jsonc = { "prettierd" }, - yaml = { "prettierd" }, - markdown = { "prettierd" }, - ["markdown.mdx"] = { "prettierd" }, - css = { "prettierd" }, - scss = { "prettierd" }, - html = { "prettierd" }, - }, - -- Configure formatters - formatters = { - eslint_d = { - -- Only run eslint if we find a config file in the project - condition = function(ctx) - return vim.fs.find({ - ".eslintrc.js", - ".eslintrc.cjs", - ".eslintrc.yaml", - ".eslintrc.yml", - ".eslintrc.json", - "eslint.config.js", - "package.json", - }, { path = ctx.filename, upward = true })[1] ~= nil - end, - }, - nixfmt = { - command = "nixfmt", - args = {}, - }, - prettierd = { - -- This tells conform to only run prettier when it finds a config file - condition = function(ctx) - return vim.fs.find({ - ".prettierrc", - ".prettierrc.js", - ".prettierrc.json", - ".prettierrc.yml", - ".prettierrc.yaml", - ".prettierrc.json5", - ".prettierrc.cjs", - "prettier.config.js", - "prettier.config.cjs", - "prettier.config.mjs", - "package.json", - }, { path = ctx.filename, upward = true })[1] ~= nil - end, - }, - stylua = { - command = "stylua", - args = { "--search-parent-directories", "--stdin-filepath", "$FILENAME", "-" }, - }, - }, + { + "stevearc/conform.nvim", + event = { "BufWritePre" }, + cmd = { "ConformInfo" }, + opts = { + -- format_on_save = { + -- timeout_ms = 500, + -- lsp_fallback = true, + -- }, + formatters_by_ft = { + nix = { "nixpkgs-fmt" }, + lua = { "stylua" }, + javascript = { { "prettierd" } }, + javascriptreact = { { "prettierd" } }, + typescript = { { "prettierd" } }, + typescriptreact = { { "prettierd" } }, + json = { "prettierd" }, + jsonc = { "prettierd" }, + yaml = { "prettierd" }, + markdown = { "prettierd" }, + ["markdown.mdx"] = { "prettierd" }, + css = { "prettierd" }, + scss = { "prettierd" }, + html = { "prettierd" }, + }, + -- Configure formatters + formatters = { + eslint_d = { + -- Only run eslint if we find a config file in the project + condition = function(ctx) + return vim.fs.find({ + ".eslintrc.js", + ".eslintrc.cjs", + ".eslintrc.yaml", + ".eslintrc.yml", + ".eslintrc.json", + "eslint.config.js", + "package.json", + }, { path = ctx.filename, upward = true })[1] ~= nil + end, }, + ["nixpkgs-fmt"] = { + command = "nixpkgs-fmt", + stdin = true, + }, + prettierd = { + -- This tells conform to only run prettier when it finds a config file + condition = function(ctx) + return vim.fs.find({ + ".prettierrc", + ".prettierrc.js", + ".prettierrc.json", + ".prettierrc.yml", + ".prettierrc.yaml", + ".prettierrc.json5", + ".prettierrc.cjs", + "prettier.config.js", + "prettier.config.cjs", + "prettier.config.mjs", + "package.json", + }, { path = ctx.filename, upward = true })[1] ~= nil + end, + }, + stylua = { + command = "stylua", + args = { "--search-parent-directories", "--stdin-filepath", "$FILENAME", "-" }, + }, + }, }, + }, } diff --git a/lua/plugins/llm.lua b/lua/plugins/llm.lua new file mode 100644 index 0000000..44e8852 --- /dev/null +++ b/lua/plugins/llm.lua @@ -0,0 +1,21 @@ +if vim.fn.executable("ollama") ~= 1 then + return {} +end + +return { + "huggingface/llm.nvim", + opts = { + model = "codellama:13b", + backend = "ollama", + url = "http://localhost:11434", + request_body = { + -- Modelfile options for the model you use + options = { + temperature = 0.2, + top_p = 0.95, + }, + }, + enable_suggestions_on_startup = true, + enable_suggestions_on_files = { "*.py", "*.ts", "*.go", "*.lua" }, + }, +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index bce4ccd..ad22318 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -1,45 +1,45 @@ return { - { - "neovim/nvim-lspconfig", - opts = { - inlay_hints = { enabled = false }, - servers = { - denols = { - root_dir = require("lspconfig").util.root_pattern("deno.json", "deno.jsonc"), - single_file_support = false, + { + "neovim/nvim-lspconfig", + opts = { + inlay_hints = { enabled = false }, + servers = { + denols = { + root_dir = require("lspconfig").util.root_pattern("deno.json", "deno.jsonc"), + single_file_support = false, + }, + tailwindcss = { + root_dir = require("lspconfig").util.root_pattern("tailwind.config.js", "tailwind.config.ts"), + }, + }, }, - tailwindcss = { - root_dir = require("lspconfig").util.root_pattern("tailwind.config.js", "tailwind.config.ts"), + }, + + -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, + -- treesitter, mason and typescript.nvim. So instead of the above, you can use: + { import = "lazyvim.plugins.extras.lang.typescript" }, + + -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc + { import = "lazyvim.plugins.extras.lang.json" }, + + -- add any tools you want to have installed below + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "stylua", + "shellcheck", + "shfmt", + "flake8", + "eslint_d", + "prettierd", + "ruff", + "nixpkgs-fmt", + "markuplint", + "tflint", + "shellcheck", + "editorconfig-checker", + }, }, - }, }, - }, - - -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, - -- treesitter, mason and typescript.nvim. So instead of the above, you can use: - { import = "lazyvim.plugins.extras.lang.typescript" }, - - -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc - { import = "lazyvim.plugins.extras.lang.json" }, - - -- add any tools you want to have installed below - { - "williamboman/mason.nvim", - opts = { - ensure_installed = { - "stylua", - "shellcheck", - "shfmt", - "flake8", - "eslint_d", - "prettierd", - "ruff", - -- "nixfmt", - "markuplint", - "tflint", - "shellcheck", - "editorconfig-checker", - }, - }, - }, }