From 107ae0ee76865728922c9f225131bab4cadf788c Mon Sep 17 00:00:00 2001 From: Sean Herman Date: Sun, 26 Jan 2025 18:35:48 -0500 Subject: [PATCH] LazyVim extras (#5) Co-authored-by: Sean Herman --- lazy-lock.json | 23 +++--- lua/plugins/avante.lua | 135 ++++++++++++++++++++++---------- lua/plugins/format.lua | 4 - lua/plugins/lazyvim-extras.lua | 13 +++ lua/plugins/llm.lua | 21 ----- lua/plugins/lsp.lua | 52 +++--------- lua/plugins/mini-identscope.lua | 12 --- lua/plugins/neo-tree.lua | 24 +++--- 8 files changed, 138 insertions(+), 146 deletions(-) create mode 100644 lua/plugins/lazyvim-extras.lua delete mode 100644 lua/plugins/llm.lua delete mode 100644 lua/plugins/mini-identscope.lua diff --git a/lazy-lock.json b/lazy-lock.json index 42645fc..7f1b49c 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,38 +1,35 @@ { "LazyVim": { "branch": "main", "commit": "2bea40c447b72e54ffb2d5cddc98d7798990796f" }, - "SchemaStore.nvim": { "branch": "main", "commit": "5be212138af55d3dcae9d77b5b14f63634243e3d" }, + "SchemaStore.nvim": { "branch": "main", "commit": "bb52c530698654355bbddb9f0035dc35cea401a5" }, "avante.nvim": { "branch": "main", "commit": "0a837a4583d66abaf85c9d31f5efad12af87c736" }, - "blink.cmp": { "branch": "main", "commit": "1cc3b1a908fbcfd15451c4772759549724f38524" }, + "blink.cmp": { "branch": "main", "commit": "b6f11a0aa33e601c469a126e3ed6e35208fe3ea3" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "catppuccin": { "branch": "main", "commit": "f67b886d65a029f12ffa298701fb8f1efd89295d" }, - "conform.nvim": { "branch": "master", "commit": "f8d743ce333bedc47821de2cd4d23c43856ecbe5" }, - "copilot.lua": { "branch": "master", "commit": "886ee73b6d464b2b3e3e6a7ff55ce87feac423a9" }, - "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, + "conform.nvim": { "branch": "master", "commit": "363243c03102a531a8203311d4f2ae704c620d9b" }, + "dressing.nvim": { "branch": "master", "commit": "56ef6a969a4990d938c5fed40c370f65e125fc97" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, - "fzf-lua": { "branch": "main", "commit": "29e2909e576258c0502b27efd865ad054362fdd9" }, - "gitsigns.nvim": { "branch": "main", "commit": "3ec5fbd9202ae3908551c98c4b6c3c05ff7c8e96" }, - "grug-far.nvim": { "branch": "main", "commit": "8e8f3429038d45a6d4144c0642d92f470e5480f3" }, + "fzf-lua": { "branch": "main", "commit": "e68d21bf23f27fae4bb395760e3eb10b8768ea2c" }, + "gitsigns.nvim": { "branch": "main", "commit": "d8918f06624dd53b9a82bd0e29c31bcfd541b40d" }, + "grug-far.nvim": { "branch": "main", "commit": "635e69adf3a714621bd0a289314bc23c5848babb" }, "img-clip.nvim": { "branch": "main", "commit": "da61a81872276b75a2971b056da1b849e0c1870b" }, "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, "lazydev.nvim": { "branch": "main", "commit": "a1b78b2ac6f978c72e76ea90ae92a94edf380cfc" }, - "llm.nvim": { "branch": "main", "commit": "ce69731ba3f8d3ea8bc4c8f58c74c2f9ea0b33de" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "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": "c2c5f6f6d25eedc96a5f406faa5982d1e90f1104" }, + "neo-tree.nvim": { "branch": "main", "commit": "e752d224f914f1ffa18260fecfbfac233d3ca461" }, "noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" }, "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, - "nvim-cmp": { "branch": "main", "commit": "3403e2e9391ed0a28c3afddd8612701b647c8e26" }, "nvim-lint": { "branch": "master", "commit": "789b7ada1b4f00e08d026dffde410dcfa6a0ba87" }, "nvim-lspconfig": { "branch": "master", "commit": "b4d65bce97795438ab6e1974b3672c17a4865e3c" }, - "nvim-treesitter": { "branch": "master", "commit": "51562d44fc6280f92bb9a3d87e7b3cb327377ca5" }, + "nvim-treesitter": { "branch": "master", "commit": "f3d7c0dafcbc86c4d63f765649c884a03bc1360a" }, "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" }, diff --git a/lua/plugins/avante.lua b/lua/plugins/avante.lua index 42507e3..97f5a4e 100644 --- a/lua/plugins/avante.lua +++ b/lua/plugins/avante.lua @@ -1,46 +1,97 @@ 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, - }, - }, - }, - { - -- Make sure to set this up properly if you have lazy=true - "MeanderingProgrammer/render-markdown.nvim", - opts = { - file_types = { "markdown", "Avante" }, - }, - ft = { "markdown", "Avante" }, + "yetone/avante.nvim", + event = "VeryLazy", + lazy = false, + version = "*", -- set this if you want to always pull the latest change + -- 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" }, + }, + }, + + opts = function() + local config = { + provider = "claude", + auto_suggestions_provider = "claude", + behaviour = { + auto_suggestions = false, + auto_set_highlight_group = true, + auto_set_keymaps = true, + }, + claude = { + endpoint = "https://api.anthropic.com", + model = "claude-3-5-sonnet-20241022", + temperature = 0, + max_tokens = 4096, + }, + file_selector = { + provider = "fzf", + provider_opts = {}, + }, + compat = { + "avante_commands", + "avante_mentions", + "avante_files", + }, + suggestion = { + debounce = 600, + throttle = 600, + }, + windows = { + position = "right", + width = 30, + }, + } + + if vim.fn.executable("ollama") == 1 then + config.provider = "ollama" + config.auto_suggestions_provider = "ollama" + config.behaviour.auto_suggestions = true + config.vendors = { + ollama = { + __inherited_from = "openai", + api_key_name = "", + endpoint = "http://127.0.0.1:11434/v1", + model = "codellama:7b", + -- temperature = 0.2, + -- context_length = 4096, + -- stop_tokens = { "", "<|endoftext|>" }, + }, + } + end + + return config + end, } diff --git a/lua/plugins/format.lua b/lua/plugins/format.lua index e6e03b2..ee4305b 100644 --- a/lua/plugins/format.lua +++ b/lua/plugins/format.lua @@ -4,10 +4,6 @@ return { event = { "BufWritePre" }, cmd = { "ConformInfo" }, opts = { - -- format_on_save = { - -- timeout_ms = 500, - -- lsp_fallback = true, - -- }, formatters_by_ft = { nix = { "nixpkgs-fmt" }, lua = { "stylua" }, diff --git a/lua/plugins/lazyvim-extras.lua b/lua/plugins/lazyvim-extras.lua new file mode 100644 index 0000000..078b7fd --- /dev/null +++ b/lua/plugins/lazyvim-extras.lua @@ -0,0 +1,13 @@ +return { + { import = "lazyvim.plugins.extras.lang.go" }, + { import = "lazyvim.plugins.extras.lang.ruby" }, + { import = "lazyvim.plugins.extras.lang.python" }, + { import = "lazyvim.plugins.extras.lang.json" }, + { import = "lazyvim.plugins.extras.lang.markdown" }, + { import = "lazyvim.plugins.extras.lang.typescript" }, + { import = "lazyvim.plugins.extras.lang.terraform" }, + { import = "lazyvim.plugins.extras.lang.tailwind" }, + { import = "lazyvim.plugins.extras.lang.yaml" }, + { import = "lazyvim.plugins.extras.lang.git" }, + { import = "lazyvim.plugins.extras.lang.nix" }, +} diff --git a/lua/plugins/llm.lua b/lua/plugins/llm.lua deleted file mode 100644 index 44e8852..0000000 --- a/lua/plugins/llm.lua +++ /dev/null @@ -1,21 +0,0 @@ -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 ad22318..1c089e0 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -1,45 +1,17 @@ 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, - }, - tailwindcss = { - root_dir = require("lspconfig").util.root_pattern("tailwind.config.js", "tailwind.config.ts"), - }, - }, + { + "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, }, - }, - - -- 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", - }, + tailwindcss = { + root_dir = require("lspconfig").util.root_pattern("tailwind.config.js", "tailwind.config.ts"), }, + }, }, + }, } diff --git a/lua/plugins/mini-identscope.lua b/lua/plugins/mini-identscope.lua deleted file mode 100644 index a1b9229..0000000 --- a/lua/plugins/mini-identscope.lua +++ /dev/null @@ -1,12 +0,0 @@ -return {} --- return { --- "echasnovski/mini.indentscope", --- opts = { --- draw = { --- -- Animation rule for scope's first line --- delay = 0, --- -- Animation rule for scope's last line --- animation = require("mini.indentscope").gen_animation.none(), --- }, --- }, --- } diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua index 83f5305..e0ecb15 100644 --- a/lua/plugins/neo-tree.lua +++ b/lua/plugins/neo-tree.lua @@ -1,21 +1,17 @@ return { { "nvim-neo-tree/neo-tree.nvim", - config = function() - require("neo-tree").setup({ - filesystem = { - filtered_items = { - hide_dotfiles = false, - hide_gitignored = true, - always_show = { - ".aws", - }, - always_show_by_pattern = { - ".env*", - }, + opts = { + filesystem = { + filtered_items = { + hide_dotfiles = false, + hide_gitignored = true, + always_show = { ".aws", ".circleci", ".github" }, + always_show_by_pattern = { + ".env*", }, }, - }) - end, + }, + }, }, }