diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index b5edf96..c917e13 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -12,10 +12,12 @@ vim.cmd("set shiftwidth=2") -- Configure Editor Settings vim.cmd("set number") +vim.cmd("set scrolloff=8") vim.cmd("set splitbelow") vim.cmd("set splitright") vim.cmd("set spl=en_us spell") vim.opt.guifont = "JetBrainsMonoNerdFontMono:14" + -- Custom Key Binds vim.g.mapleader = " " @@ -24,6 +26,11 @@ require("config.lazy") -- Configure nvim Keymaps vim.keymap.set("n", "r", ":source %", { desc = "Reload Config" }) +vim.keymap.set("n", "bs", ":vsplit", { desc = "Vertical Split" }) + +-- remap yank to system clipboard +vim.keymap.set("n", "y", '"+y', { desc = "Yank to Clipboard" }) +vim.keymap.set("v", "y", '"+y', { desc = "Yank to Clipboard" }) -- Configure Telescope Keymaps local builtin = require("telescope.builtin") diff --git a/.config/nvim/lua/plugins/chrome.lua b/.config/nvim/lua/plugins/chrome.lua index c204064..2e262c5 100644 --- a/.config/nvim/lua/plugins/chrome.lua +++ b/.config/nvim/lua/plugins/chrome.lua @@ -28,4 +28,31 @@ return { -- vim.g.barbar_auto_setup = false --end, }, + { + "goolord/alpha-nvim", + vim.keymap.set("n", "", ":BufferPrevious", { desc = "Previous Buffer" }), + vim.keymap.set("n", "", ":BufferNext", { desc = "Next Buffer" }), + vim.keymap.set("n", "bq", ":BufferClose", { desc = "Close Buffer" }), + vim.keymap.set("n", "", ":BufferClose", { desc = "Close Buffer" }), + vim.keymap.set("n", "bp", ":BufferPrevious", { desc = "Previous Buffer" }), + vim.keymap.set("n", "bn", ":BufferNext", { desc = "Next Buffer" }), + 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/.config/nvim/lua/plugins/completions.lua b/.config/nvim/lua/plugins/completions.lua new file mode 100644 index 0000000..2770861 --- /dev/null +++ b/.config/nvim/lua/plugins/completions.lua @@ -0,0 +1,45 @@ +return { + { + "L3MON4D3/LuaSnip", + dependencies = { + "saadparwaiz1/cmp_luasnip", -- Snippets source for nvim-cmp + "rafamadriz/friendly-snippets", -- Collection of snippets + }, + }, + { + "hrsh7th/nvim-cmp", + config = function() + require("luasnip.loaders.from_vscode").lazy_load() -- Load snippets from friendly-snippets + local cmp = require("cmp") + + cmp.setup({ + snippet = { + -- REQUIRED - you must specify a snippet engine + expand = function(args) + require("luasnip").lsp_expand(args.body) -- For `luasnip` users. + 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 }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }), + sources = cmp.config.sources({ + --{ name = "nvim_lsp" }, + { name = "luasnip" }, -- For luasnip users. + }, { + { name = "buffer" }, + }), + }) + end, + }, + { + "hrsh7th/cmp-nvim-lsp", + }, +} diff --git a/.config/nvim/lua/plugins/language-server.lua b/.config/nvim/lua/plugins/language-server.lua index 27d179f..cb77b2a 100644 --- a/.config/nvim/lua/plugins/language-server.lua +++ b/.config/nvim/lua/plugins/language-server.lua @@ -43,16 +43,20 @@ return { "neovim/nvim-lspconfig", tag = "v1.8.0", config = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities() local lspconfig = require("lspconfig") - lspconfig.lua_ls.setup({}) - lspconfig.bashls.setup({}) - lspconfig.dockerls.setup({}) - lspconfig.helm_ls.setup({}) - lspconfig.jsonls.setup({}) - lspconfig.nginx_language_server.setup({}) - lspconfig.marksman.setup({}) - lspconfig.ruff.setup({}) - lspconfig.yamlls.setup({}) + lspconfig.ts_ls.setup({ + capabilities = capabilities, + }) + lspconfig.lua_ls.setup({ capabilities = capabilities }) + lspconfig.bashls.setup({ capabilities = capabilities }) + lspconfig.dockerls.setup({ capabilities = capabilities }) + lspconfig.helm_ls.setup({ capabilities = capabilities }) + lspconfig.jsonls.setup({ capabilities = capabilities }) + lspconfig.nginx_language_server.setup({ capabilities = capabilities }) + lspconfig.marksman.setup({ capabilities = capabilities }) + lspconfig.ruff.setup({ capabilities = capabilities }) + lspconfig.yamlls.setup({ capabilities = capabilities }) vim.keymap.set("n", "d", vim.lsp.buf.hover, { desc = "Show Docstring" }) vim.keymap.set("n", "gt", vim.lsp.buf.definition, { desc = "Go To Definition" }) vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { desc = "Show Code Actions" })