-- This file can be loaded by calling `lua require('plugins')` from your init.vim

-- Only required if you have packer configured as `opt`
vim.cmd [[packadd packer.nvim]]

return require('packer').startup(function(use)
    -- Packer can manage itself
    use 'wbthomason/packer.nvim'

    use {
        'nvim-telescope/telescope.nvim', tag = '0.1.8',
        -- or                            , branch = '0.1.x',
        requires = { { 'nvim-lua/plenary.nvim' },
            { 'nvim-lua/popup.nvim' },
            { 'nvim-telescope/telescope-media-files.nvim' }
        }
    }

    use({
        'rose-pine/neovim',
        as = 'rose-pine',
        'catppuccin/nvim',
        as = 'catppuccin',
        'folke/tokyonight.nvim',
        as = 'tokyonight',
        'navarasu/onedark.nvim',
        as = 'onedark',
        'scottmckendry/cyberdream.nvim',
        as = 'cyberdream',
        'Mofiqul/vscode.nvim',
        as = 'vscode',
        'EdenEast/nightfox.nvim',
        as = 'nightfox',
        'sainnhe/sonokai',
        as = 'sonokai',
        'AlexvZyl/nordic.nvim',
        as = 'nordic',
        'uZer/pywal16.nvim',
        as = 'pywal16'
    })

    use({
        'zaldih/themery.nvim',
        config = function()
            require("themery").setup({
                themes = {
                    'rose-pine',
                    'catppuccin',
                    'tokyonight',
                    'onedark',
                    'cyberdream',
                    'vscode',
                    'nightfox',
                    'sonokai',
                    'nordic',
                    'pywal16',
                }
            })
        end
    })

    use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' })
    use {
        'VonHeikemen/lsp-zero.nvim',
        branch = 'v3.x',
        requires = {
            --- Uncomment the two plugins below if you want to manage the language servers from neovim
            -- {'williamboman/mason.nvim'},
            -- {'williamboman/mason-lspconfig.nvim'},

            { 'neovim/nvim-lspconfig' },
            { 'hrsh7th/nvim-cmp' },
            { 'hrsh7th/cmp-nvim-lsp' },
            { 'L3MON4D3/LuaSnip' },
        }
    }

    use {
        "williamboman/mason.nvim",
        "williamboman/mason-lspconfig.nvim",
        "neovim/nvim-lspconfig",
    }

    use("jiangmiao/auto-pairs")

    use 'nvim-tree/nvim-web-devicons' -- OPTIONAL: for file icons
    use 'lewis6991/gitsigns.nvim'     -- OPTIONAL: for git status

    use("stevearc/oil.nvim")

    use("mfussenegger/nvim-jdtls")

    use({
        "kylechui/nvim-surround",
        tag = "*", -- Use for stability; omit to use `main` branch for the latest features
        config = function()
            require("nvim-surround").setup({
                -- Configuration here, or leave empty to use defaults
            })
        end
    })

    use {
        "ray-x/lsp_signature.nvim",
        config = function()
            require("lsp_signature").setup()
        end
    }

    use({
        'brenoprata10/nvim-highlight-colors',
        config = function()
            require('nvim-highlight-colors').setup({
                render = 'background',
            })
        end
    })


    use({
        "stevearc/conform.nvim",
        event = { "BufReadPre", "BufNewFile" },
        config = function()
            require("conform").setup({
                formatters_by_ft = {
                    lua = { "stylua" },
                    c = { "clang-format" },
                    html = { "htmlbeautifier" },
                    javascript = { "biome" },
                    javascriptreact = { "biome" },
                    css = { "prettierd", "prettier", stop_after_first = true },
                    java = { "astyle" },
                    xml = { "xmlformatter" },
                }
            })
        end,
    })
    use({
        "xiyaowong/transparent.nvim",
        config = function()
            -- Optional, you don't have to run setup.
            require("transparent").setup({
                -- table: default groups
                groups = {
                    'Normal', 'NormalNC', 'Comment', 'Constant', 'Special', 'Identifier',
                    'Statement', 'PreProc', 'Type', 'Underlined', 'Todo', 'String', 'Function',
                    'Conditional', 'Repeat', 'Operator', 'Structure', 'LineNr', 'NonText',
                    'SignColumn', 'CursorLine', 'CursorLineNr', 'StatusLine', 'StatusLineNC',
                    'EndOfBuffer',
                },
                -- table: additional groups that should be cleared
                extra_groups = {},
                -- table: groups you don't want to clear
                exclude_groups = {},
                -- function: code to be executed after highlight groups are cleared
                -- Also the user event "TransparentClear" will be triggered
                on_clear = function() end,
            })
        end
    })
end)
