diff --git a/lua/plugins/alpha.lua b/lua/plugins/alpha.lua new file mode 100644 index 0000000..d6638ae --- /dev/null +++ b/lua/plugins/alpha.lua @@ -0,0 +1,31 @@ +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/plugins/alpha.lua b/lua/plugins/alpha.lua new file mode 100644 index 0000000..d6638ae --- /dev/null +++ b/lua/plugins/alpha.lua @@ -0,0 +1,31 @@ +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/plugins/completions.lua b/lua/plugins/completions.lua new file mode 100644 index 0000000..4d4c7bc --- /dev/null +++ b/lua/plugins/completions.lua @@ -0,0 +1,44 @@ +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 = "nvim_lsp" }, + { name = "luasnip" }, -- For luasnip users. + }, { + { name = "buffer" }, + }), + }) + end, + }, +} diff --git a/lua/plugins/alpha.lua b/lua/plugins/alpha.lua new file mode 100644 index 0000000..d6638ae --- /dev/null +++ b/lua/plugins/alpha.lua @@ -0,0 +1,31 @@ +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/plugins/completions.lua b/lua/plugins/completions.lua new file mode 100644 index 0000000..4d4c7bc --- /dev/null +++ b/lua/plugins/completions.lua @@ -0,0 +1,44 @@ +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 = "nvim_lsp" }, + { name = "luasnip" }, -- For luasnip users. + }, { + { name = "buffer" }, + }), + }) + end, + }, +} diff --git a/lua/plugins/lsp-config.lua b/lua/plugins/lsp-config.lua index 48a2454..db3938b 100644 --- a/lua/plugins/lsp-config.lua +++ b/lua/plugins/lsp-config.lua @@ -1,39 +1,50 @@ return { { "williamboman/mason.nvim", + lazy = false, config = function() require("mason").setup() end, }, { "williamboman/mason-lspconfig.nvim", - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { - "bashls", -- bash - "jsonls", -- json - "lua_ls", -- lua - "lemminx", -- xml - "pyright", -- python - "yamlls", -- yaml - }, - }) - end, + lazy = false, + opts = { + auto_install = true, + }, }, { "neovim/nvim-lspconfig", + lazy = false, config = function() - local lspconfig = require("lspconfig") + local capabilities = require("cmp_nvim_lsp").default_capabilities() - lspconfig.bashls.setup({}) - lspconfig.jsonls.setup({}) - lspconfig.lua_ls.setup({}) - lspconfig.lemminx.setup({}) - lspconfig.pyright.setup({}) - lspconfig.yamlls.setup({}) + local lspconfig = require("lspconfig") + lspconfig.bashls.setup({ + capabilities = capabilities, + }) + lspconfig.gopls.setup({ + capabilities = capabilities, + }) + lspconfig.jsonls.setup({ + capabilities = capabilities, + }) + lspconfig.lua_ls.setup({ + capabilities = capabilities, + }) + lspconfig.lemminx.setup({ + capabilities = capabilities, + }) + lspconfig.pyright.setup({ + capabilities = capabilities, + }) + lspconfig.yamlls.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, },