diff --git a/sources/nvim/lua/plugins/avante.lua b/sources/nvim/lua/plugins/avante.lua new file mode 100644 index 0000000..3875f30 --- /dev/null +++ b/sources/nvim/lua/plugins/avante.lua @@ -0,0 +1,92 @@ +return { + "yetone/avante.nvim", + opts = { + ---@alias Provider "claude" | "openai" | "azure" | "gemini" | "cohere" | "copilot" | string + 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 + providers = { + claude = { + endpoint = "https://api.anthropic.com", + api_key_name = "ANTHROPIC_API_KEY", + extra_request_body = { + temperature = 0, + max_tokens = 8192, + }, + }, + }, + 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 = true, + }, + input = { + provider = "snacks", -- Use folke/snacks.nvim already installed by LazyVim + provider_opts = { + title = "Avante — API Key", + icon = " ", + placeholder = "sk-ant-...", + }, + }, + mappings = { + --- @class AvanteConflictMappings + ask = "aa", + edit = "ae", + refresh = "ar", + diff = { + ours = "co", + theirs = "ct", + all_theirs = "ca", + both = "cb", + cursor = "cc", + next = "]x", + prev = "[x", + }, + suggestion = { + accept = "", + next = "", + prev = "", + dismiss = "", + }, + jump = { + next = "]]", + prev = "[[", + }, + submit = { + normal = "", + insert = "", + }, + sidebar = { + apply_all = "A", + apply_cursor = "a", + switch_windows = "", + reverse_switch_windows = "", + }, + }, + hints = { enabled = true }, + 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", + }, + }, +} diff --git a/sources/nvim/lua/plugins/mason.lua b/sources/nvim/lua/plugins/mason.lua new file mode 100644 index 0000000..fce6fe5 --- /dev/null +++ b/sources/nvim/lua/plugins/mason.lua @@ -0,0 +1,40 @@ +return { + "mason-org/mason.nvim", + opts = { + ensure_installed = { + -- LSP Servers + "typescript-language-server", -- TypeScript/JavaScript LSP + "eslint-lsp", -- ESLint LSP for linting + "tailwindcss-language-server", -- Tailwind CSS LSP + "css-lsp", -- CSS LSP + "html-lsp", -- HTML LSP + "emmet-ls", -- Emmet for HTML/CSS abbreviations + "json-lsp", -- JSON LSP + "graphql-language-service-cli", -- GraphQL LSP + "prisma-language-server", -- Prisma ORM LSP (often used with tRPC) + "lua-language-server", -- Lua LSP for Neovim config + + -- Formatters + "prettier", -- JavaScript/TypeScript/CSS/HTML/JSON/Markdown formatter + "prettierd", -- Faster Prettier daemon + "stylua", -- Lua formatter + "rustywind", -- Tailwind CSS class sorter + + -- Linters + "eslint_d", -- Fast ESLint daemon + "stylelint", -- CSS/SCSS/Less linter + "markdownlint", -- Markdown linter + + -- DAP (Debuggers) + "js-debug-adapter", -- JavaScript/TypeScript debugger + "node-debug2-adapter", -- Node.js debugger (alternative) + + -- Additional Tools + "shellcheck", -- Shell script linter + "shfmt", -- Shell script formatter + "hadolint", -- Dockerfile linter + "yamllint", -- YAML linter + "yamlfmt", -- YAML formatter + }, + }, +} diff --git a/sources/nvim/lua/plugins/neo-tree.lua b/sources/nvim/lua/plugins/neo-tree.lua new file mode 100644 index 0000000..a37702a --- /dev/null +++ b/sources/nvim/lua/plugins/neo-tree.lua @@ -0,0 +1,159 @@ +return { + "nvim-neo-tree/neo-tree.nvim", + opts = { + close_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab + popup_border_style = "rounded", + enable_git_status = true, + enable_diagnostics = true, + open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, -- when opening files, do not replace these filetypes + sort_case_insensitive = false, -- used when sorting files and directories in the tree + sort_function = nil, -- use a custom function for sorting files and directories in the tree + default_component_configs = { + container = { + enable_character_fade = true, + }, + indent = { + indent_size = 2, + padding = 1, -- extra padding on left hand side + with_markers = true, + indent_marker = "│", + last_indent_marker = "└", + highlight = "NeoTreeIndentMarker", + with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders + expander_collapsed = "", + expander_expanded = "", + expander_highlight = "NeoTreeExpander", + }, + icon = { + folder_closed = "", + folder_open = "", + folder_empty = "", + default = "*", + highlight = "NeoTreeFileIcon", + }, + modified = { + symbol = "[+]", + highlight = "NeoTreeModified", + }, + name = { + trailing_slash = false, + use_git_status_colors = true, + highlight = "NeoTreeFileName", + }, + git_status = { + symbols = { + -- Change type + added = "✚", -- or "✚", but this is redundant info if you use git_status_colors on the name + modified = "", -- or "", but this is redundant info if you use git_status_colors on the name + deleted = "✖", -- this can only be used in the git_status source + renamed = "󰁕", -- this can only be used in the git_status source + -- Status type + untracked = "", + ignored = "", + unstaged = "󰄱", + staged = "", + conflict = "", + }, + }, + }, + filesystem = { + filtered_items = { + visible = true, -- Show hidden files by default + hide_dotfiles = false, + hide_gitignored = false, + hide_hidden = false, -- only works on Windows for hidden files/directories + hide_by_name = { + -- "node_modules" + }, + hide_by_pattern = { -- uses glob style patterns + -- "*.meta", + -- "*/src/*/tsconfig.json", + }, + always_show = { -- remains visible even if other settings would normally hide it + ".gitignored", + ".env", + }, + never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show + ".DS_Store", + "thumbs.db", + }, + never_show_by_pattern = { -- uses glob style patterns + -- ".null-ls_*", + }, + }, + follow_current_file = { + enabled = true, -- This will find and focus the file in the active buffer every time + leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal` + }, + group_empty_dirs = false, -- when true, empty folders will be grouped together + hijack_netrw_behavior = "open_default", -- netrw disabled, opening a directory opens neo-tree + use_libuv_file_watcher = true, -- This will use the OS level file watchers to detect changes + window = { + mappings = { + [""] = "navigate_up", + ["."] = "set_root", + ["H"] = "toggle_hidden", + ["/"] = "fuzzy_finder", + ["D"] = "fuzzy_finder_directory", + ["#"] = "fuzzy_sorter", -- fuzzy sorting using the fzy algorithm + ["f"] = "filter_on_submit", + [""] = "clear_filter", + ["[g"] = "prev_git_modified", + ["]g"] = "next_git_modified", + ["o"] = { "show_help", nowait = false, config = { title = "Order by", prefix_key = "o" } }, + ["oc"] = { "order_by_created", nowait = false }, + ["od"] = { "order_by_diagnostics", nowait = false }, + ["og"] = { "order_by_git_status", nowait = false }, + ["om"] = { "order_by_modified", nowait = false }, + ["on"] = { "order_by_name", nowait = false }, + ["os"] = { "order_by_size", nowait = false }, + ["ot"] = { "order_by_type", nowait = false }, + }, + }, + }, + buffers = { + follow_current_file = { + enabled = true, -- This will find and focus the file in the active buffer every time + leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal` + }, + group_empty_dirs = true, -- when true, empty folders will be grouped together + show_unloaded = true, + window = { + mappings = { + ["bd"] = "buffer_delete", + [""] = "navigate_up", + ["."] = "set_root", + ["o"] = { "show_help", nowait = false, config = { title = "Order by", prefix_key = "o" } }, + ["oc"] = { "order_by_created", nowait = false }, + ["od"] = { "order_by_diagnostics", nowait = false }, + ["om"] = { "order_by_modified", nowait = false }, + ["on"] = { "order_by_name", nowait = false }, + ["os"] = { "order_by_size", nowait = false }, + ["ot"] = { "order_by_type", nowait = false }, + }, + }, + }, + git_status = { + window = { + position = "float", + mappings = { + ["A"] = "git_add_all", + ["gu"] = "git_unstage_file", + ["ga"] = "git_add_file", + ["gr"] = "git_revert_file", + ["gc"] = "git_commit", + ["gp"] = "git_push", + ["gg"] = "git_commit_and_push", + ["o"] = { "show_help", nowait = false, config = { title = "Order by", prefix_key = "o" } }, + ["oc"] = { "order_by_created", nowait = false }, + ["od"] = { "order_by_diagnostics", nowait = false }, + ["om"] = { "order_by_modified", nowait = false }, + ["on"] = { "order_by_name", nowait = false }, + ["os"] = { "order_by_size", nowait = false }, + ["ot"] = { "order_by_type", nowait = false }, + }, + }, + }, + }, +} +