From 4e2e019d927401c99f6d695009f132fd76ecf7e3 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Sat, 20 Jan 2024 04:55:17 +0100 Subject: [PATCH] plugins!!! --- lua/custom/plugins.lua | 202 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 200 insertions(+), 2 deletions(-) diff --git a/lua/custom/plugins.lua b/lua/custom/plugins.lua index 8d95572..1ce888f 100644 --- a/lua/custom/plugins.lua +++ b/lua/custom/plugins.lua @@ -1,5 +1,21 @@ local overrides = require "custom.configs.overrides" local utils = require "core.utils" +local function get_header() + -- see https://github.com/MaximilianLloyd/ascii.nvim + return { + -- The following is a customized version! + [[ ]], + [[ ]], + [[ █ ████████ █████ ███████ ████ ]], + [[ ███ ██████ █████ █████████ ██████ ]], + [[ █████ ██████████████████████ ████ ███████████████ ]], + [[ ██ ██ █████ █████████████ ████ ████████████████ ]], + [[ ████ ███████████████ █████████ ████ █████ ██████ ████ ]], + [[ ██████ ██████ ███ █████████ ████ █████ █████ ████ ]], + [[ ████████ ███████████████████ ████ ████ █████ ████ ████ ]], + [[ ]], + } +end ---@type NvPluginSpec[] local plugins = { @@ -101,6 +117,52 @@ local plugins = { }, }, { "echasnovski/mini.trailspace", lazy = false, event = { "BufReadPost", "BufNewFile" }, opts = {} }, + { + "itchyny/vim-cursorword", + event = "FileType", + init = function() + vim.g.cursorword = 0 + end, + config = function() + local augroup = vim.api.nvim_create_augroup("plex_cursorword", {}) + vim.api.nvim_create_autocmd("FileType", { + group = augroup, + pattern = { + "conf", + "dosini", + "json", + "markdown", + "nginx", + "text", + "yaml", + }, + callback = function() + if vim.wo.diff or vim.wo.previewwindow then + vim.b.cursorword = 0 + else + vim.b.cursorword = 1 + end + end, + }) + vim.api.nvim_create_autocmd("InsertEnter", { + group = augroup, + callback = function() + if vim.b["cursorword"] == 1 then + vim.b["cursorword"] = 0 + end + end, + }) + vim.api.nvim_create_autocmd("InsertLeave", { + group = augroup, + callback = function() + if vim.b["cursorword"] == 0 then + vim.b["cursorword"] = 1 + end + end, + }) + end, + }, + { "RRethy/vim-illuminate", lazy = false, @@ -234,9 +296,9 @@ local plugins = { }, { "akinsho/toggleterm.nvim", - init = function () + init = function() require("core.utils").load_mappings "toggleterm" - end, + end, cmd = "ToggleTerm", opts = { open_mapping = false, @@ -245,6 +307,142 @@ local plugins = { }, }, }, + -- lazy.nvim + { + "folke/noice.nvim", + event = "VeryLazy", + opts = { + -- add any options here + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + "MunifTanjim/nui.nvim", + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + "rcarriga/nvim-notify", + }, + config = function() + require("noice").setup { + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, + } + end, + }, + { + "goolord/alpha-nvim", + lazy = false, + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + local dash = require "alpha.themes.dashboard" + require("alpha").setup(dash.config) + end, + + opts = { + header = get_header(), + }, + }, + { + "stevearc/dressing.nvim", + init = function() + ---@diagnostic disable-next-line: duplicate-set-field + vim.ui.select = function(...) + require("lazy").load { plugins = { "dressing.nvim" } } + return vim.ui.select(...) + end + ---@diagnostic disable-next-line: duplicate-set-field + vim.ui.input = function(...) + require("lazy").load { plugins = { "dressing.nvim" } } + return vim.ui.input(...) + end + end, + }, + { + "chentoast/marks.nvim", + lazy = false, + dependencies = "lewis6991/gitsigns.nvim", + event = "FileType", + opts = { + sign_priority = { lower = 10, upper = 15, builtin = 8, bookmark = 20 }, + bookmark_1 = { sign = "󰉀" }, -- ⚐ ⚑ 󰈻 󰈼 󰈽 󰈾 󰈿 󰉀 + }, + }, + { + "kevinhwang91/nvim-bqf", + ft = "qf", + cmd = "BqfAutoToggle", + event = "QuickFixCmdPost", + opts = { + auto_resize_height = false, + func_map = { + tab = "st", + split = "sv", + vsplit = "sg", + + stoggleup = "K", + stoggledown = "J", + stogglevm = "", + + ptoggleitem = "p", + ptoggleauto = "P", + ptogglemode = "zp", + + pscrollup = "", + pscrolldown = "", + + prevfile = "gk", + nextfile = "gj", + + prevhist = "", + nexthist = "", + }, + preview = { + auto_preview = true, + should_preview_cb = function(bufnr) + -- file size greater than 100kb can't be previewed automatically + local filename = vim.api.nvim_buf_get_name(bufnr) + local fsize = vim.fn.getfsize(filename) + if fsize > 100 * 1024 then + return false + end + return true + end, + }, + }, + }, + { + "uga-rosa/ccc.nvim", + lazy = false, + event = "FileType", + keys = { + { "cp", "CccPick", desc = "Color-picker" }, + }, + opts = { + highlighter = { + auto_enable = true, + lsp = true, + excludes = { "lazy", "mason", "help", "neo-tree" }, + }, + }, + }, + { + "Bekaboo/deadcolumn.nvim", + event = { "BufReadPre", "BufNewFile" }, + }, } return plugins