From eb1c7997a42b48dfa22cccb3e841008f5a908016 Mon Sep 17 00:00:00 2001 From: Plamen Kutinchev Date: Mon, 25 Mar 2024 21:25:48 +0200 Subject: [PATCH] first working bunch of plugins --- lua/custom/plugins/autopairs.lua | 0 lua/custom/plugins/catpuccin.lua | 11 +++++++ lua/custom/plugins/completions.lua | 46 ++++++++++++++++++++++++++++++ lua/custom/plugins/copilot.lua | 19 ++++++++++++ lua/custom/plugins/git.lua | 14 +++++++++ lua/custom/plugins/go.lua | 16 +++++++++++ lua/custom/plugins/lsp-config.lua | 42 +++++++++++++++++++++++++++ lua/custom/plugins/neo-tree.lua | 15 ++++++++++ lua/custom/plugins/none-ls.lua | 19 ++++++++++++ lua/custom/plugins/starter.lua | 34 ++++++++++++++++++++++ lua/custom/plugins/swagger.lua | 7 +++++ lua/custom/plugins/tabs.lua | 0 12 files changed, 223 insertions(+) create mode 100644 lua/custom/plugins/autopairs.lua create mode 100644 lua/custom/plugins/catpuccin.lua create mode 100644 lua/custom/plugins/completions.lua create mode 100644 lua/custom/plugins/copilot.lua create mode 100644 lua/custom/plugins/git.lua create mode 100644 lua/custom/plugins/go.lua create mode 100644 lua/custom/plugins/lsp-config.lua create mode 100644 lua/custom/plugins/neo-tree.lua create mode 100644 lua/custom/plugins/none-ls.lua create mode 100644 lua/custom/plugins/starter.lua create mode 100644 lua/custom/plugins/swagger.lua create mode 100644 lua/custom/plugins/tabs.lua diff --git a/lua/custom/plugins/autopairs.lua b/lua/custom/plugins/autopairs.lua new file mode 100644 index 00000000..e69de29b diff --git a/lua/custom/plugins/catpuccin.lua b/lua/custom/plugins/catpuccin.lua new file mode 100644 index 00000000..b4bb53ae --- /dev/null +++ b/lua/custom/plugins/catpuccin.lua @@ -0,0 +1,11 @@ +return { + { + "catppuccin/nvim", + lazy = false, + name = "catppuccin", + priority = 1000, + config = function() + vim.cmd.colorscheme "catppuccin-mocha" + end + } +} \ No newline at end of file diff --git a/lua/custom/plugins/completions.lua b/lua/custom/plugins/completions.lua new file mode 100644 index 00000000..4a11a7db --- /dev/null +++ b/lua/custom/plugins/completions.lua @@ -0,0 +1,46 @@ +return { + { + "hrsh7th/cmp-nvim-lsp" + }, + { + "L3MON4D3/LuaSnip", + dependencies = { + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + }, + }, + { + "hrsh7th/nvim-cmp", + config = function() + local cmp = require("cmp") + require("luasnip.loaders.from_vscode").lazy_load() + + cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { name = "copilot" }, + { name = "nvim_lsp" }, + { name = "gopls" }, + { name = "luasnip" }, -- For luasnip users. + }, { + { name = "buffer" }, + }), + }) + end, + }, +} \ No newline at end of file diff --git a/lua/custom/plugins/copilot.lua b/lua/custom/plugins/copilot.lua new file mode 100644 index 00000000..61a64096 --- /dev/null +++ b/lua/custom/plugins/copilot.lua @@ -0,0 +1,19 @@ +return { +{ + "zbirenbaum/copilot.lua", + cmd = "Copilot", + event = "InsertEnter", + config = function() + require("copilot").setup({ + suggestion = { enabled = false }, + panel = { enabled = false }, + }) + end, +}, +{ + "zbirenbaum/copilot-cmp", + config = function () + require("copilot_cmp").setup() + end +}, +} \ No newline at end of file diff --git a/lua/custom/plugins/git.lua b/lua/custom/plugins/git.lua new file mode 100644 index 00000000..790923cf --- /dev/null +++ b/lua/custom/plugins/git.lua @@ -0,0 +1,14 @@ +return { + { + "tpope/vim-fugitive" + }, + { + "lewis6991/gitsigns.nvim", + config = function() + require("gitsigns").setup() + + vim.keymap.set("n", "gp", ":Gitsigns preview_hunk", {}) + vim.keymap.set("n", "gt", ":Gitsigns toggle_current_line_blame", {}) + end + } +} \ No newline at end of file diff --git a/lua/custom/plugins/go.lua b/lua/custom/plugins/go.lua new file mode 100644 index 00000000..d5e83853 --- /dev/null +++ b/lua/custom/plugins/go.lua @@ -0,0 +1,16 @@ +return { + { + "ray-x/go.nvim", + dependencies = { -- optional packages + "ray-x/guihua.lua", + "neovim/nvim-lspconfig", + "nvim-treesitter/nvim-treesitter", + }, + config = function() + require("go").setup() + end, + event = {"CmdlineEnter"}, + ft = {"go", 'gomod'}, + build = ':lua require("go.install").update_all_sync()' -- if you need to install/update all binaries + }, +} \ No newline at end of file diff --git a/lua/custom/plugins/lsp-config.lua b/lua/custom/plugins/lsp-config.lua new file mode 100644 index 00000000..5c7100f8 --- /dev/null +++ b/lua/custom/plugins/lsp-config.lua @@ -0,0 +1,42 @@ +return { + { + "williamboman/mason.nvim", + lazy = false, + config = function() + require("mason").setup() + end, + }, + { + "williamboman/mason-lspconfig.nvim", + lazy = false, + opts = { + auto_install = true, + }, + }, + { + "neovim/nvim-lspconfig", + lazy = false, + config = function() + local capabilities = require('cmp_nvim_lsp').default_capabilities() + + local lspconfig = require("lspconfig") + lspconfig.tsserver.setup({ + capabilities = capabilities + }) + lspconfig.solargraph.setup({ + capabilities = capabilities + }) + lspconfig.html.setup({ + capabilities = capabilities + }) + lspconfig.lua_ls.setup({ + capabilities = capabilities + }) + + vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) + vim.keymap.set("n", "gr", vim.lsp.buf.references, {}) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) + end, + }, +} \ No newline at end of file diff --git a/lua/custom/plugins/neo-tree.lua b/lua/custom/plugins/neo-tree.lua new file mode 100644 index 00000000..2ed9d938 --- /dev/null +++ b/lua/custom/plugins/neo-tree.lua @@ -0,0 +1,15 @@ +return { + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + config = function() + vim.keymap.set("n", "", ":Neotree filesystem reveal left", {}) + vim.keymap.set("n", "bf", ":Neotree buffers reveal float", {}) + end, + } +} \ No newline at end of file diff --git a/lua/custom/plugins/none-ls.lua b/lua/custom/plugins/none-ls.lua new file mode 100644 index 00000000..3c7170ab --- /dev/null +++ b/lua/custom/plugins/none-ls.lua @@ -0,0 +1,19 @@ +return { + { + "nvimtools/none-ls.nvim", + config = function() + local null_ls = require("null-ls") + null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua, + null_ls.builtins.formatting.prettier, + null_ls.builtins.diagnostics.erb_lint, + null_ls.builtins.diagnostics.rubocop, + null_ls.builtins.formatting.rubocop, + }, + }) + + vim.keymap.set("n", "gf", vim.lsp.buf.format, {}) + end, + } +} \ No newline at end of file diff --git a/lua/custom/plugins/starter.lua b/lua/custom/plugins/starter.lua new file mode 100644 index 00000000..0d4b44ad --- /dev/null +++ b/lua/custom/plugins/starter.lua @@ -0,0 +1,34 @@ +return { + { + "goolord/alpha-nvim", + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + + config = function() + local alpha = require("alpha") + local dashboard = require("alpha.themes.startify") + + dashboard.section.header.val = { + [[ ]], + [[ ]], + [[ ]], + [[ ]], + [[  ]], + [[ ████ ██████ █████ ██ ]], + [[ ███████████ █████  ]], + [[ █████████ ███████████████████ ███ ███████████ ]], + [[ █████████ ███ █████████████ █████ ██████████████ ]], + [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], + [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], + [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], + [[ ]], + [[ ]], + [[ ]], + } + + alpha.setup(dashboard.opts) + end, + } +} + diff --git a/lua/custom/plugins/swagger.lua b/lua/custom/plugins/swagger.lua new file mode 100644 index 00000000..a6c134ea --- /dev/null +++ b/lua/custom/plugins/swagger.lua @@ -0,0 +1,7 @@ +return { + { + "vinnymeller/swagger-preview.nvim", + build = "npm install -g swagger-ui-watcher", + config = true, + } +} \ No newline at end of file diff --git a/lua/custom/plugins/tabs.lua b/lua/custom/plugins/tabs.lua new file mode 100644 index 00000000..e69de29b