summaryrefslogtreecommitdiff
path: root/lua/custom/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'lua/custom/plugins')
-rw-r--r--lua/custom/plugins/cmp.lua41
-rw-r--r--lua/custom/plugins/colorscheme.lua15
-rw-r--r--lua/custom/plugins/lsp.lua35
-rw-r--r--lua/custom/plugins/mini.lua7
-rw-r--r--lua/custom/plugins/oil.lua13
-rw-r--r--lua/custom/plugins/pairs.lua7
-rw-r--r--lua/custom/plugins/telescope.lua17
-rw-r--r--lua/custom/plugins/treesitter.lua17
-rw-r--r--lua/custom/plugins/undotree.lua6
-rw-r--r--lua/custom/plugins/zenmode.lua30
10 files changed, 188 insertions, 0 deletions
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 = {
+ ["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
+ ["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
+ ["<C-y>"] = cmp.mapping.confirm({
+ behavior = cmp.SelectBehavior.Insert,
+ select = true,
+ }),
+ ["<Tab>"] = nil,
+ ["<S-Tab>"] = nil,
+ ["<CR>"] = 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", "-", "<CMD>Oil<CR>", { 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", "<leader>sf", builtin.find_files, { desc = "[s]earch [f]iles" })
+ vim.keymap.set("n", "<leader>sg", builtin.live_grep, { desc = "[s]earch by [g]rep" })
+ vim.keymap.set("n", "<leader>sw", builtin.grep_string, { desc = "[s]earch current [w]ord" })
+ vim.keymap.set("n", "<leader>sb", builtin.buffers, { desc = "[s]earch [b]uffers" })
+ vim.keymap.set("n", "<leader>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", "<leader>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", "<leader>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,
+}