From 3b2163b821f4dbf1003804b9b19fd276dc4bc350 Mon Sep 17 00:00:00 2001 From: tdback Date: Wed, 4 Dec 2024 18:48:24 -0500 Subject: initial commit to new repo --- lua/custom/plugins/cmp.lua | 41 ++++++++++++++++++++++++++++++++++++++ lua/custom/plugins/colorscheme.lua | 15 ++++++++++++++ lua/custom/plugins/lsp.lua | 35 ++++++++++++++++++++++++++++++++ lua/custom/plugins/mini.lua | 7 +++++++ lua/custom/plugins/oil.lua | 13 ++++++++++++ lua/custom/plugins/pairs.lua | 7 +++++++ lua/custom/plugins/telescope.lua | 17 ++++++++++++++++ lua/custom/plugins/treesitter.lua | 17 ++++++++++++++++ lua/custom/plugins/undotree.lua | 6 ++++++ lua/custom/plugins/zenmode.lua | 30 ++++++++++++++++++++++++++++ 10 files changed, 188 insertions(+) create mode 100644 lua/custom/plugins/cmp.lua create mode 100644 lua/custom/plugins/colorscheme.lua create mode 100644 lua/custom/plugins/lsp.lua create mode 100644 lua/custom/plugins/mini.lua create mode 100644 lua/custom/plugins/oil.lua create mode 100644 lua/custom/plugins/pairs.lua create mode 100644 lua/custom/plugins/telescope.lua create mode 100644 lua/custom/plugins/treesitter.lua create mode 100644 lua/custom/plugins/undotree.lua create mode 100644 lua/custom/plugins/zenmode.lua (limited to 'lua/custom/plugins') diff --git a/lua/custom/plugins/cmp.lua b/lua/custom/plugins/cmp.lua new file mode 100644 index 0000000..b092f65 --- /dev/null +++ b/lua/custom/plugins/cmp.lua @@ -0,0 +1,41 @@ +return { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + }, + lazy = false, + config = function() + vim.opt.completeopt = { "menu", "menuone", "noselect" } + vim.opt.shortmess:append("c") + + local cmp = require("cmp") + cmp.setup({ + preselect = cmp.PreselectMode.Item, + + sources = { + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "path" }, + { name = "buffer" }, + }, + + mapping = { + [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping.confirm({ + behavior = cmp.SelectBehavior.Insert, + select = true, + }), + [""] = nil, + [""] = nil, + [""] = nil, + }, + + snippet = { expand = function(args) vim.snippet.expand(args.body) end }, + }) + end, +} diff --git a/lua/custom/plugins/colorscheme.lua b/lua/custom/plugins/colorscheme.lua new file mode 100644 index 0000000..1d1370e --- /dev/null +++ b/lua/custom/plugins/colorscheme.lua @@ -0,0 +1,15 @@ +return { + "rose-pine/neovim", + config = function() + require("rose-pine").setup({ + dim_inactive_windows = true, + styles = { + bold = true, + italic = false, + transparency = true, + }, + }) + + vim.cmd.colorscheme("rose-pine") + end, +} diff --git a/lua/custom/plugins/lsp.lua b/lua/custom/plugins/lsp.lua new file mode 100644 index 0000000..256b460 --- /dev/null +++ b/lua/custom/plugins/lsp.lua @@ -0,0 +1,35 @@ +return { + "neovim/nvim-lspconfig", + config = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()) + + local on_attach = function(client, bufnr) + local opts = { buffer = bufnr, noremap = true, silent = true } + + if client.server_capabilities.inlayHintProvider then + vim.lsp.inlay_hint.enable(true) + end + + vim.diagnostic.config({ virtual_text = true }) + + vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) + vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) + vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) + end + + local lspc = require("lspconfig") + local servers = { + "clangd", + "gopls", + "hls", + "nixd", + "pylsp", + "rust_analyzer", + "zls", + } + + for _, s in ipairs(servers) do + lspc[s].setup({ on_attach = on_attach, capabilities = capabilities }) + end + end, +} diff --git a/lua/custom/plugins/mini.lua b/lua/custom/plugins/mini.lua new file mode 100644 index 0000000..084cb02 --- /dev/null +++ b/lua/custom/plugins/mini.lua @@ -0,0 +1,7 @@ +return { + "echasnovski/mini.nvim", + config = function() + require("mini.ai").setup() + require("mini.surround").setup() + end, +} diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua new file mode 100644 index 0000000..32950fa --- /dev/null +++ b/lua/custom/plugins/oil.lua @@ -0,0 +1,13 @@ +return { + "stevearc/oil.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + require("oil").setup({ + default_file_explorer = true, + skip_confirm_for_simple_edits = true, + view_options = { show_hidden = true }, + }) + + vim.keymap.set("n", "-", "Oil", { desc = "Open parent directory" }) + end, +} diff --git a/lua/custom/plugins/pairs.lua b/lua/custom/plugins/pairs.lua new file mode 100644 index 0000000..637b524 --- /dev/null +++ b/lua/custom/plugins/pairs.lua @@ -0,0 +1,7 @@ +return { + "windwp/nvim-autopairs", + event = "InsertEnter", + config = function() + require("nvim-autopairs").setup({ map_c_h = true }) + end, +} diff --git a/lua/custom/plugins/telescope.lua b/lua/custom/plugins/telescope.lua new file mode 100644 index 0000000..8593110 --- /dev/null +++ b/lua/custom/plugins/telescope.lua @@ -0,0 +1,17 @@ +return { + "nvim-telescope/telescope.nvim", + tag = "0.1.8", + dependencies = { + "nvim-lua/plenary.nvim", + }, + config = function() + require("telescope").setup({}) + + local builtin = require("telescope.builtin") + vim.keymap.set("n", "sf", builtin.find_files, { desc = "[s]earch [f]iles" }) + vim.keymap.set("n", "sg", builtin.live_grep, { desc = "[s]earch by [g]rep" }) + vim.keymap.set("n", "sw", builtin.grep_string, { desc = "[s]earch current [w]ord" }) + vim.keymap.set("n", "sb", builtin.buffers, { desc = "[s]earch [b]uffers" }) + vim.keymap.set("n", "sh", builtin.help_tags, { desc = "[s]earch [h]elp" }) + end, +} diff --git a/lua/custom/plugins/treesitter.lua b/lua/custom/plugins/treesitter.lua new file mode 100644 index 0000000..3de7c04 --- /dev/null +++ b/lua/custom/plugins/treesitter.lua @@ -0,0 +1,17 @@ +return { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + lazy = false, + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { "nix", "lua", "bash" }, + auto_install = true, + sync_install = false, + indent = { enable = true }, + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, + }) + end, +} diff --git a/lua/custom/plugins/undotree.lua b/lua/custom/plugins/undotree.lua new file mode 100644 index 0000000..fe71c5a --- /dev/null +++ b/lua/custom/plugins/undotree.lua @@ -0,0 +1,6 @@ +return { + "mbbill/undotree", + config = function() + vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) + end, +} diff --git a/lua/custom/plugins/zenmode.lua b/lua/custom/plugins/zenmode.lua new file mode 100644 index 0000000..7f4cc88 --- /dev/null +++ b/lua/custom/plugins/zenmode.lua @@ -0,0 +1,30 @@ +return { + "folke/zen-mode.nvim", + config = function() + vim.keymap.set("n", "zz", function() + require("zen-mode").setup({ + window = { + width = 80, + options = { + signcolumn = "no", + number = false, + relativenumber = false, + wrap = true, + linebreak = true, + cursorline = false, + colorcolumn = "0", + }, + }, + plugins = { + gitsigns = { enabled = false }, + options = { + enabled = true, + ruler = false, + showcmd = false, + }, + }, + }) + require("zen-mode").toggle() + end) + end, +} -- cgit v1.2.3