nvim: add a bunch of plugins
Prithu Goswami pg@prithu.dev
Fri, 01 Nov 2024 13:32:18 +0530
4 files changed,
171 insertions(+),
0 deletions(-)
A
config/nvim/lua/plugins/avante.lua
@@ -0,0 +1,112 @@
+return { + 'yetone/avante.nvim', + event = 'VeryLazy', + lazy = false, + version = false, -- 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, + 'nvim-tree/nvim-web-devicons', -- or echasnovski/mini.icons + { + -- 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' }, + }, + }, + config = function() + require('avante').setup { + provider = 'claude', -- Recommend using Claude + auto_suggestions_provider = 'claude', -- Since auto-suggestions are a high-frequency operation and therefore expensive, it is recommended to specify an inexpensive provider or even a free provider: copilot + claude = { + endpoint = 'https://api.anthropic.com', + model = 'claude-3-5-sonnet-20240620', + temperature = 0, + max_tokens = 4096, + }, + behaviour = { + auto_suggestions = false, -- Experimental stage + auto_set_highlight_group = true, + auto_set_keymaps = true, + auto_apply_diff_after_generation = false, + support_paste_from_clipboard = false, + }, + mappings = { + diff = { + ours = 'co', + theirs = 'ct', + all_theirs = 'ca', + both = 'cb', + cursor = 'cc', + next = ']x', + prev = '[x', + }, + suggestion = { + accept = '<M-l>', + next = '<M-]>', + prev = '<M-[>', + dismiss = '<C-]>', + }, + jump = { + next = ']]', + prev = '[[', + }, + submit = { + normal = '<CR>', + insert = '<C-s>', + }, + }, + hints = { enabled = false }, + windows = { + ---@type "right" | "left" | "top" | "bottom" + position = 'right', -- the position of the sidebar + wrap = true, -- similar to vim.o.wrap + width = 30, -- default % based on available width + sidebar_header = { + align = 'center', -- left, center, right for title + rounded = true, + }, + }, + highlights = { + ---@type AvanteConflictHighlights + diff = { + current = 'DiffText', + incoming = 'DiffAdd', + }, + }, + --- @class AvanteConflictUserConfig + diff = { + autojump = true, + ---@type string | fun(): any + list_opener = 'copen', + }, + } + end, +}
A
config/nvim/lua/plugins/chatgpt.lua
@@ -0,0 +1,13 @@
+return { + 'jackMort/ChatGPT.nvim', + event = 'VeryLazy', + config = function() + require('chatgpt').setup() + end, + dependencies = { + 'MunifTanjim/nui.nvim', + 'nvim-lua/plenary.nvim', + 'folke/trouble.nvim', + 'nvim-telescope/telescope.nvim', + }, +}
A
config/nvim/lua/plugins/markdown-preview.lua
@@ -0,0 +1,9 @@
+return { + 'iamcco/markdown-preview.nvim', + cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' }, + build = 'cd app && yarn install', + init = function() + vim.g.mkdp_filetypes = { 'markdown' } + end, + ft = { 'markdown' }, +}
A
config/nvim/lua/plugins/trouble.lua
@@ -0,0 +1,37 @@
+return { + 'folke/trouble.nvim', + opts = {}, -- for default options, refer to the configuration section for custom setup. + cmd = 'Trouble', + keys = { + { + '<leader>xx', + '<cmd>Trouble diagnostics toggle<cr>', + desc = 'Diagnostics (Trouble)', + }, + { + '<leader>xX', + '<cmd>Trouble diagnostics toggle filter.buf=0<cr>', + desc = 'Buffer Diagnostics (Trouble)', + }, + { + '<leader>xs', + '<cmd>Trouble symbols toggle focus=false<cr>', + desc = 'Symbols (Trouble)', + }, + { + '<leader>xl', + '<cmd>Trouble lsp toggle focus=false win.position=right<cr>', + desc = 'LSP Definitions / references / ... (Trouble)', + }, + { + '<leader>xL', + '<cmd>Trouble loclist toggle<cr>', + desc = 'Location List (Trouble)', + }, + { + '<leader>xQ', + '<cmd>Trouble qflist toggle<cr>', + desc = 'Quickfix List (Trouble)', + }, + }, +}