From b0f86dc82d0b148e708e72fbe0cc6fc2fab188bb Mon Sep 17 00:00:00 2001 From: Ray Andrew <4437323+rayandrew@users.noreply.github.com> Date: Sun, 30 Jul 2023 18:04:37 -0500 Subject: [PATCH] update plugin settings --- lazy-lock.json | 2 + lua/rayandrew/lazy.lua | 10 +- lua/rayandrew/plugins.lua | 259 ++++++++++++++++++++++++++++++++++++-- lua/rayandrew/theme.lua | 8 ++ 4 files changed, 270 insertions(+), 9 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index fc53ec0..b8e2a12 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -33,6 +33,7 @@ "nvim-web-devicons": { "branch": "master", "commit": "efbfed0567ef4bfac3ce630524a0f6c8451c5534" }, "playground": { "branch": "master", "commit": "2b81a018a49f8e476341dfcb228b7b808baba68b" }, "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, + "readline.nvim": { "branch": "master", "commit": "cab666cbd026dea9c817182e22255ecb3b3419b1" }, "refactoring.nvim": { "branch": "master", "commit": "5359e74291164fcaeaaecdea9ba753ad54eb53d0" }, "rose-pine": { "branch": "main", "commit": "e29002cbee4854a9c8c4b148d8a52fae3176070f" }, "telescope.nvim": { "branch": "master", "commit": "b6fccfb0f7589a87587875206786daccba62acc3" }, @@ -41,6 +42,7 @@ "undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" }, "vim-fugitive": { "branch": "master", "commit": "b3b838d690f315a503ec4af8c634bdff3b200aaf" }, "vim-illuminate": { "branch": "master", "commit": "a2907275a6899c570d16e95b9db5fd921c167502" }, + "vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" }, "vim-tmux-navigator": { "branch": "master", "commit": "cdd66d6a37d991bba7997d593586fc51a5b37aa8" }, "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" }, "zen-mode.nvim": { "branch": "main", "commit": "68f554702de63f4b7b6b6d4bcb10178f41a0acc7" } diff --git a/lua/rayandrew/lazy.lua b/lua/rayandrew/lazy.lua index f82c2b0..ffcd9e5 100644 --- a/lua/rayandrew/lazy.lua +++ b/lua/rayandrew/lazy.lua @@ -20,12 +20,20 @@ require("lazy").setup({ lazy = false, version = false, }, + checker = { + enabled = true, + notify = false, + frequency = 3600 * 12, + }, change_detection = { enabled = true, notify = false, }, - checker = { enabled = true }, performance = { + cache = { + enabled = true, + }, + reset_packpath = true, rtp = { -- disable some rtp plugins disabled_plugins = { diff --git a/lua/rayandrew/plugins.lua b/lua/rayandrew/plugins.lua index d58ba26..93c4836 100644 --- a/lua/rayandrew/plugins.lua +++ b/lua/rayandrew/plugins.lua @@ -4,6 +4,16 @@ return { { "folke/lazy.nvim", version = "*" }, { "nvim-lua/plenary.nvim", lazy = true }, + { + "dstein64/vim-startuptime", + -- lazy-load on a command + cmd = "StartupTime", + -- init is called during startup. Configuration for vim plugins typically should be set in an init function + init = function() + vim.g.startuptime_tries = 10 + end, + }, + ------------------------------ -- Telescope ------------------------------ @@ -23,6 +33,17 @@ return { end, desc = "Find in Files (Grep)", }, + { + "ps", + function() + local Util = require("rayandrew.util") + local fun = Util.telescope("grep_string", { + search = vim.fn.input("Grep > "), + }) + fun() + end, + desc = "Find in Files (Grep)", + }, { "bb", function() @@ -50,6 +71,33 @@ return { end, desc = "Find Files (cwd)", }, + { + "", + function() + local Util = require("rayandrew.util") + local fun = Util.telescope("git_files") + fun() + end, + desc = "Find Git Files", + }, + { + "sm", + function() + local Util = require("rayandrew.util") + local fun = Util.telescope("man_pages") + fun() + end, + desc = "Find Manual", + }, + { + "sh", + function() + local Util = require("rayandrew.util") + local fun = Util.telescope("help_tags") + fun() + end, + desc = "Find Help Tags", + }, }, }, @@ -290,7 +338,6 @@ return { { "folke/noice.nvim", - enabled = true, event = "VeryLazy", opts = { lsp = { @@ -299,6 +346,16 @@ return { ["vim.lsp.util.stylize_markdown"] = true, ["cmp.entry.get_documentation"] = true, }, + hover = { + enabled = false, + }, + signature = { + enabled = false, + }, + }, + cmdline = { + enabled = true, + view = "cmdline", }, routes = { { @@ -567,7 +624,7 @@ return { "hrsh7th/nvim-cmp", event = "InsertEnter", dependencies = { - { "L3MON4D3/LuaSnip" }, + { "L3MON4D3/LuaSnip", build = "make install_jsregexp" }, { "zbirenbaum/copilot-cmp", dependencies = "copilot.lua", @@ -601,23 +658,28 @@ return { { name = "path", group_index = 2 }, { name = "luasnip", group_index = 2 }, }, - mapping = { + mapping = cmp.mapping.preset.insert({ [""] = cmp.mapping.complete(), [""] = cmp_action.luasnip_jump_forward(), [""] = cmp_action.luasnip_jump_backward(), [""] = cmp.mapping.select_prev_item(cmp_select), [""] = cmp.mapping.select_next_item(cmp_select), [""] = cmp.mapping.confirm({ select = true }), - [""] = nil, - [""] = nil, + [""] = cmp_action.luasnip_supertab(), + [""] = cmp_action.luasnip_supertab(), [""] = cmp.mapping.confirm({ -- documentation says this is important. -- I don't know why. behavior = cmp.ConfirmBehavior.Replace, select = false, }), - }, + }), sorting, + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, }) end, }, @@ -797,10 +859,12 @@ return { }, -- comments - { "JoosepAlviste/nvim-ts-context-commentstring", lazy = true }, { "echasnovski/mini.comment", event = "VeryLazy", + dependencies = { + { "JoosepAlviste/nvim-ts-context-commentstring", lazy = true }, + }, opts = { options = { custom_commentstring = function() @@ -811,11 +875,154 @@ return { }, }, + -- RSI compatibility + { + "linty-org/readline.nvim", + event = "VeryLazy", + keys = { + { + "", + function() + require("readline").forward_word() + end, + mode = "!", + }, + { + "", + function() + require("readline").backward_word() + end, + mode = "!", + }, + { + "", + function() + require("readline").kill_word() + end, + mode = "!", + }, + { + "", + function() + require("readline").backward_kill_word() + end, + mode = "!", + }, + { + "", + function() + require("readline").unix_word_rubout() + end, + mode = "!", + }, + { + "", + function() + require("readline").kill_line() + end, + mode = "!", + }, + { + "", + function() + require("readline").backward_kill_line() + end, + mode = "!", + }, + { + "", + function() + require("readline").beginning_of_line() + end, + mode = "!", + }, + { + "", + function() + require("readline").end_of_line() + end, + mode = "!", + }, + { "", "", mode = "!" }, -- forward-char + { "", "", mode = "!" }, -- backward-char + { "", "", mode = "!" }, -- next-line + { "", "", mode = "!" }, -- previous-line + { "", "", mode = "!" }, -- delete-char + { "", "", mode = "!" }, -- backward-delete-char + }, + }, { "tpope/vim-fugitive", + cmd = { "Git" }, + }, + { + "laytan/cloak.nvim", + event = { + "BufEnter .env*", + }, + cmd = { + "CloakEnable", + "CloakDisable", + "CloakToggle", + }, + opts = { + enabled = true, + cloak_character = "*", + -- The applied highlight group (colors) on the cloaking, see `:h highlight`. + highlight_group = "Comment", + patterns = { + { + file_pattern = { + ".env*", + ".dev.vars", + }, + -- Match an equals sign and any character after it. + -- This can also be a table of patterns to cloak, + -- example: cloak_pattern = { ":.+", "-.+" } for yaml files. + cloak_pattern = "=.+", + }, + }, + }, + config = function(_, opts) + require("cloak").setup(opts) + end, }, { "theprimeagen/harpoon", + event = "VeryLazy", + keys = { + { + "ha", + function() + local mark = require("harpoon.mark") + mark.add_file() + vim.print("Added to Harpoon " .. vim.fn.expand("%")) + end, + desc = "Harpoon Add File", + }, + { + "he", + function() + local ui = require("harpoon.ui") + ui.toggle_quick_menu() + end, + desc = "Harpoon UI", + }, + { + "h1", + function() + local ui = require("harpoon.ui") + ui.nav_file(1) + end, + }, + { + "h2", + function() + local ui = require("harpoon.ui") + ui.nav_file(2) + end, + }, + }, }, { "theprimeagen/refactoring.nvim", @@ -949,8 +1156,45 @@ return { wk.register(opts.defaults) end, }, + + -- zen { "folke/zen-mode.nvim", + opts = { + window = { + width = 90, + }, + plugins = { + tmux = { + enabled = true, + }, + }, + on_open = function(_win) + vim.wo.wrap = false + vim.wo.number = false + vim.wo.rnu = false + end, + on_close = function() + vim.wo.wrap = true + vim.wo.number = true + vim.wo.rnu = true + end, + }, + keys = { + { + "z", + function() + -- require("zen-mode").setup({ + -- window = { + -- width = 90, + -- options = {}, + -- }, + -- }) + require("zen-mode").toggle() + require("rayandrew.theme").recolor() + end, + }, + }, }, -- Flash Telescope config @@ -999,7 +1243,6 @@ return { }, -- Copilot Lualine - { "nvim-lualine/lualine.nvim", -- optional = true, diff --git a/lua/rayandrew/theme.lua b/lua/rayandrew/theme.lua index c4d68ad..a837c98 100644 --- a/lua/rayandrew/theme.lua +++ b/lua/rayandrew/theme.lua @@ -77,4 +77,12 @@ M.icons = { }, } +function M.recolor(color) + color = color or M.colorscheme + vim.cmd.colorscheme(color) + + vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) + vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) +end + return M