update plugs save 20ms on load wooooooo

This commit is contained in:
Christian Nieves
2024-01-16 22:01:10 -06:00
parent c19d01dc21
commit a37f9dab1c
7 changed files with 165 additions and 141 deletions

View File

@ -1,26 +1,18 @@
local use_google = require("utils").use_google local use_google = require("utils").use_google
return { return {
-- "sindrets/diffview.nvim", "kdheepak/lazygit.nvim",
{ "johmsalas/text-case.nvim" }, "flwyd/vim-conjoin",
"vim-scripts/vcscommand.vim",
"jghauser/mkdir.nvim",
"AndrewRadev/tagalong.vim",
{ "nvim-lua/plenary.nvim", lazy = false }, { "nvim-lua/plenary.nvim", lazy = false },
{ "squk/java-syntax.vim", ft = "java" }, { "squk/java-syntax.vim", ft = "java" },
{ "udalov/kotlin-vim", ft = "kotlin" },
{ "ray-x/go.nvim", ft = "go" },
{ "ray-x/guihua.lua", ft = "go" },
{ "andymass/vim-matchup", event = "VimEnter" },
{ "squk/gdrama-syntax.vim", dir = vim.fn.expand("$HOME/dev/gdrama-syntax.vim") }, { "squk/gdrama-syntax.vim", dir = vim.fn.expand("$HOME/dev/gdrama-syntax.vim") },
{
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {},
},
{
"mawkler/modicator.nvim",
init = function()
-- These are required for Modicator to work
vim.o.cursorline = true
vim.o.number = true
vim.o.termguicolors = true
end,
opts = {},
},
{ {
"NvChad/nvim-colorizer.lua", "NvChad/nvim-colorizer.lua",
ft = "lua", ft = "lua",
@ -29,15 +21,16 @@ return {
end, end,
}, },
{ {
"andweeb/presence.nvim", "andweeb/presence.nvim",
cond = not use_google(), cond = not use_google(),
config = function() config = function()
require("presence").setup({ show_time = false }) require("presence").setup({
main_image = "file",
show_time = false,
})
end, end,
}, },
{ "udalov/kotlin-vim", ft = "kotlin" },
{ "ray-x/go.nvim", ft = "go" },
{ "ray-x/guihua.lua", ft = "go" },
{ {
"rafcamlet/nvim-luapad", "rafcamlet/nvim-luapad",
config = function() config = function()
@ -46,28 +39,24 @@ return {
}) })
end, end,
}, },
"kdheepak/lazygit.nvim", {
"flwyd/vim-conjoin", "kosayoda/nvim-lightbulb",
"godlygeek/tabular", opts = {
"wesQ3/vim-windowswap", autocmd = { enabled = true },
"cakebaker/scss-syntax.vim", virtual_text = {
"vim-scripts/vcscommand.vim", enabled = true,
"jghauser/mkdir.nvim", text = " 󱐋",
"google/vim-searchindex", hl = "DiagnosticWarn",
"kosayoda/nvim-lightbulb", },
sign = { enabled = false },
},
},
{ {
"ntpeters/vim-better-whitespace", "ntpeters/vim-better-whitespace",
config = function() config = function()
vim.g.better_whitespace_filetypes_blacklist = { "dashboard" } vim.g.better_whitespace_filetypes_blacklist = { "dashboard" }
end, end,
}, },
"junegunn/fzf.vim",
"AndrewRadev/tagalong.vim",
"tversteeg/registers.nvim",
"jremmen/vim-ripgrep",
"viniciusgerevini/clyde.vim",
{ "andymass/vim-matchup", event = "VimEnter" },
-- Undo tree
{ {
"mbbill/undotree", "mbbill/undotree",
cmd = "UndotreeToggle", cmd = "UndotreeToggle",
@ -78,19 +67,14 @@ return {
{ {
"stevearc/aerial.nvim", "stevearc/aerial.nvim",
opts = {}, opts = {},
-- Optional dependencies
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
cmd = { "AerialToggle", "AerialOn" }, cmd = { "AerialToggle", "AerialOn" },
keys = { keys = { { "<leader>so", ":AerialToggle<CR>", desc = "[S]symbols [O]utline" } },
{ "<leader>so", ":AerialToggle<CR>", desc = "[S]symbols [O]utline" },
},
}, },
{ {
"rmagatti/auto-session", "olimorris/persisted.nvim",
config = function() config = function()
require("auto-session").setup({ log_level = "error" }) require("persisted").setup({})
require("telescope").load_extension("persisted")
end, end,
}, },
{ {
@ -101,42 +85,4 @@ return {
end, end,
ft = { "markdown" }, ft = { "markdown" },
}, },
{
"glacambre/firenvim",
-- Lazy load firenvim
-- Explanation: https://github.com/folke/lazy.nvim/discussions/463#discussioncomment-4819297
config = function()
vim.g.firenvim_config = {
localSettings = {
[ [[.*]] ] = {
cmdline = "firenvim",
priority = 0,
selector = 'textarea:not([readonly]):not([class="handsontableInput"]), div[role="textbox"]',
takeover = "always",
},
[ [[.*notion\.so.*]] ] = {
priority = 9,
takeover = "never",
},
[ [[.*docs\.google\.com.*]] ] = {
priority = 9,
takeover = "never",
},
[ [[google\.com.*]] ] = {
priority = 9,
takeover = "never",
},
[ [[twitch\.tv.*]] ] = {
priority = 9,
takeover = "never",
},
},
}
end,
lazy = not vim.g.started_by_firenvim,
build = function()
vim.fn["firenvim#install"](0)
end,
},
} }

View File

@ -10,6 +10,12 @@ return {
}, },
shortcut = { shortcut = {
{ desc = "󰊳 Update", group = "@property", action = "Lazy update", key = "u" }, { desc = "󰊳 Update", group = "@property", action = "Lazy update", key = "u" },
{
desc = "󰦛 cwd session",
group = "Number",
action = "SessionLoad",
key = ".",
},
{ {
icon = "", icon = "",
icon_hl = "@variable", icon_hl = "@variable",
@ -19,17 +25,17 @@ return {
key = "f", key = "f",
}, },
{ {
desc = " Apps", desc = " dotfiles",
group = "DiagnosticHint",
action = "Telescope app",
key = "a",
},
{
desc = " dotfiles",
group = "Number", group = "Number",
action = "lua find_dotfiles()", action = "lua find_dotfiles()",
key = "d", key = "d",
}, },
{
desc = " sessions",
group = "Number",
action = "Telescope persisted",
key = "s",
},
}, },
}, },
}) })

View File

@ -0,0 +1,38 @@
return {
"glacambre/firenvim",
-- Lazy load firenvim
-- Explanation: https://github.com/folke/lazy.nvim/discussions/463#discussioncomment-4819297
config = function()
vim.g.firenvim_config = {
localSettings = {
[ [[.*]] ] = {
cmdline = "firenvim",
priority = 0,
selector = 'textarea:not([readonly]):not([class="handsontableInput"]), div[role="textbox"]',
takeover = "always",
},
[ [[.*notion\.so.*]] ] = {
priority = 9,
takeover = "never",
},
[ [[.*docs\.google\.com.*]] ] = {
priority = 9,
takeover = "never",
},
[ [[google\.com.*]] ] = {
priority = 9,
takeover = "never",
},
[ [[twitch\.tv.*]] ] = {
priority = 9,
takeover = "never",
},
},
}
end,
lazy = not vim.g.started_by_firenvim,
build = function()
vim.fn["firenvim#install"](0)
end,
}

View File

@ -26,6 +26,7 @@ return {
filetypes = { filetypes = {
ignore = { -- filetypes to ignore; empty by default ignore = { -- filetypes to ignore; empty by default
"gdscript", "gdscript",
"rust",
}, -- for these filetypes }, -- for these filetypes
}, },
} }

View File

@ -1,4 +1,9 @@
return { return {
{
"vxpm/ferris.nvim",
ft = "rust",
},
{ {
"mrcjkb/rustaceanvim", "mrcjkb/rustaceanvim",
version = "^3", -- Recommended version = "^3", -- Recommended

View File

@ -65,58 +65,86 @@ if use_google() then
end end
return { return {
"nvim-telescope/telescope.nvim", {
dependencies = {}, "johmsalas/text-case.nvim",
config = function() dependencies = { "nvim-telescope/telescope.nvim" },
require("telescope").setup({ config = function()
defaults = { require("textcase").setup({})
-- The vertical layout strategy is good to handle long paths like those in require("telescope").load_extension("textcase")
-- google3 repos because you have nearly the full screen to display a file path. end,
-- The caveat is that the preview area is smaller. keys = {
layout_strategy = "vertical", { "<leader>t", "<cmd>TextCaseOpenTelescope<CR>", mode = { "n", "v" }, desc = "Telescope" },
-- Common paths in google3 repos are collapsed following the example of Cider },
-- It is nice to keep this as a user config rather than part of },
-- telescope-codesearch because it can be reused by other telescope pickers. {
path_display = function(opts, path) "piersolenski/telescope-import.nvim",
-- Do common substitutions dependencies = "nvim-telescope/telescope.nvim",
path = path:gsub("^/google/src/cloud/[^/]+/[^/]+/google3/", "google3/", 1) config = function()
path = path:gsub("^google3/java/com/google/", "//j/c/g/", 1) require("telescope").load_extension("import")
path = path:gsub("^google3/javatests/com/google/", "//jt/c/g/", 1) end,
path = path:gsub("^google3/third_party/", "//3p/", 1) keys = {
path = path:gsub("^google3/", "//", 1) { "<leader>i", ":Telescope import<CR>" },
},
},
{
"nvim-telescope/telescope.nvim",
dependencies = {},
config = function()
require("telescope").setup({
defaults = {
-- The vertical layout strategy is good to handle long paths like those in
-- google3 repos because you have nearly the full screen to display a file path.
-- The caveat is that the preview area is smaller.
layout_strategy = "vertical",
-- Common paths in google3 repos are collapsed following the example of Cider
-- It is nice to keep this as a user config rather than part of
-- telescope-codesearch because it can be reused by other telescope pickers.
path_display = function(opts, path)
-- Do common substitutions
path = path:gsub("^/google/src/cloud/[^/]+/[^/]+/google3/", "google3/", 1)
path = path:gsub("^google3/java/com/google/", "//j/c/g/", 1)
path = path:gsub("^google3/javatests/com/google/", "//jt/c/g/", 1)
path = path:gsub("^google3/third_party/", "//3p/", 1)
path = path:gsub("^google3/", "//", 1)
-- Do truncation. This allows us to combine our custom display formatter -- Do truncation. This allows us to combine our custom display formatter
-- with the built-in truncation. -- with the built-in truncation.
-- `truncate` handler in transform_path memoizes computed truncation length in opts.__length. -- `truncate` handler in transform_path memoizes computed truncation length in opts.__length.
-- Here we are manually propagating this value between new_opts and opts. -- Here we are manually propagating this value between new_opts and opts.
-- We can make this cleaner and more complicated using metatables :) -- We can make this cleaner and more complicated using metatables :)
local new_opts = { local new_opts = {
path_display = { path_display = {
truncate = true, truncate = true,
},
__length = opts.__length,
}
path = require("telescope.utils").transform_path(new_opts, path)
opts.__length = new_opts.__length
return path
end,
mappings = {
i = {
["<S-Down>"] = function()
require("telescope.actions").cycle_history_next()
end,
["<S-Up>"] = function()
require("telescope.actions").cycle_history_prev()
end,
}, },
__length = opts.__length,
}
path = require("telescope.utils").transform_path(new_opts, path)
opts.__length = new_opts.__length
return path
end,
mappings = {
i = {
["<S-Down>"] = function()
require("telescope.actions").cycle_history_next()
end,
["<S-Up>"] = function()
require("telescope.actions").cycle_history_prev()
end,
}, },
}, },
}, extensions = {
extensions = { codesearch = {
codesearch = { experimental = true, -- enable results from google3/experimental
experimental = true, -- enable results from google3/experimental },
persisted = {},
import = {
-- Add imports to the top of the file keeping the cursor in place
insert_at_top = true,
},
}, },
}, })
}) end,
end, keys = keys,
keys = keys, },
} }

View File

@ -2,7 +2,7 @@ return {
"folke/zen-mode.nvim", "folke/zen-mode.nvim",
opts = { opts = {
window = { window = {
width = 0.4, width = 140,
}, },
plugins = { plugins = {
tmux = { enabled = false }, tmux = { enabled = false },