Skip to content

Commit

Permalink
feat: replace old plugins with snacks, set global fps
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Dec 13, 2024
1 parent 02868de commit d94ff7f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 42 deletions.
3 changes: 1 addition & 2 deletions lua/config/lazy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,10 @@ function M.load(opts)
"matchit",
"matchparen",
"netrwPlugin",
-- "rplugin",
"rplugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
Expand Down
3 changes: 1 addition & 2 deletions lua/config/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ vim.opt.listchars = "trail:·,nbsp:◇,tab:→ ,extends:▸,precedes:◂"
vim.opt.pumblend = 10

vim.g.os = vim.uv.os_uname().sysname
vim.g.fps = vim.g.os == "Darwin" and 120 or 160
vim.g.dotfiles = vim.env.DOTFILES or vim.fn.expand("~/.dotfiles")
vim.g.vim_dir = vim.g.dotfiles .. "/.config/nvim"

Expand Down Expand Up @@ -52,8 +53,6 @@ if vim.g.neovide then
vim.g.neovide_scale_factor = 0.3
end

-- vim.opt.mousescroll = "ver:8,hor:6"

vim.o.title = true
vim.o.titlestring = LazyVim.root.cwd():match("([^/]+)$")

Expand Down
55 changes: 38 additions & 17 deletions lua/plugins/snacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,29 @@ return {
{
"snacks.nvim",
opts = {
profiler = { runtime = "~/projects/neovim/runtime/" },
profiler = {
runtime = "~/projects/neovim/runtime/",
presets = {
on_stop = function()
Snacks.profiler.scratch()
end,
},
},
input = {},
indent = {
scope = {
treesitter = {
enabled = true,
},
},
},
scroll = {
animate = {
duration = { total = 100 },
easing = "inOutExpo",
fps = vim.g.fps,
},
},
dashboard = { example = "github" },
gitbrowse = {
config = function(opts, defaults)
Expand All @@ -14,37 +36,36 @@ return {
keys = {
{ "<leader>p", "", desc = "+profile" },
{
"<leader>pp",
desc = "Group traces and open a picker",
function()
if not Snacks.profiler.toggle() then
Snacks.profiler.pick({ min_time = 0.2 })
end
end,
},
{
"<leader>ph",
desc = "Toggle profiler highlights",
"<leader>ps",
function()
Snacks.profiler.highlight()
Snacks.profiler.scratch()
end,
},
{
"<leader>pd",
desc = "Toggle profiler debug",
function()
if not Snacks.profiler.enabled then
if not Snacks.profiler.running() then
Snacks.notify("Profiler debug started")
Snacks.profiler.start()
else
Snacks.profiler.debug()
Snacks.notify("Profiler debug stopped")
end
if not Snacks.profiler.enabled then
Snacks.profiler.pick({})
end
end,
},
},
},
{
"snacks.nvim",
opts = function()
LazyVim.on_load("which-key.nvim", function()
Snacks.toggle.profiler():map("<leader>pp")
Snacks.toggle.profiler_highlights():map("<leader>ph")
Snacks.toggle.indent():map("<leader>ug")
Snacks.toggle.dim():map("<leader>uD")
Snacks.toggle.zen():map("<leader>z")
end)
end,
},
}
25 changes: 4 additions & 21 deletions lua/plugins/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ return {
"rcarriga/nvim-notify",
opts = {
level = vim.log.levels.INFO,
fps = vim.g.os == "Darwin" and 120 or 160,
fps = vim.g.fps,
stages = "fade_in_slide_out",
background_colour = "#000000",
time_formats = {
Expand Down Expand Up @@ -484,29 +484,12 @@ return {
event = "BufReadPre",
},

"folke/twilight.nvim",
{
"folke/zen-mode.nvim",
cmd = "ZenMode",
"edgy.nvim",
opts = {
plugins = {
gitsigns = true,
tmux = true,
kitty = { enabled = false, font = "+2" },
animate = {
fps = vim.g.fps,
},
},
keys = { { "<leader>z", "<cmd>ZenMode<cr>", desc = "Zen Mode" } },
},

{
"echasnovski/mini.animate",
opts = function(_, opts)
local animate = require("mini.animate")
opts.open = { enable = false }
opts.close = { enable = false }
opts.cursor = { enable = false }
opts.scroll.timing = animate.gen_timing.exponential({ duration = 50, easing = "out", unit = "total" })
return opts
end,
},
}

0 comments on commit d94ff7f

Please sign in to comment.