From 74d3ae5b1905dd8f5909bfd5afb09869a37d811a Mon Sep 17 00:00:00 2001 From: steven-na Date: Mon, 1 Jun 2026 20:31:27 -0700 Subject: Changed nvim --- arch/nvim/.config/nvim/lazy-lock.json | 2 +- arch/nvim/.config/nvim/lua/plugins/extras.lua | 138 +++++++++++++------------- 2 files changed, 70 insertions(+), 70 deletions(-) diff --git a/arch/nvim/.config/nvim/lazy-lock.json b/arch/nvim/.config/nvim/lazy-lock.json index 30ba221..fdd24c3 100644 --- a/arch/nvim/.config/nvim/lazy-lock.json +++ b/arch/nvim/.config/nvim/lazy-lock.json @@ -7,12 +7,12 @@ "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, "fzf-lua": { "branch": "main", "commit": "b437bafc981a180d609bb4092c56ce8999f7a2c4" }, "gitsigns.nvim": { "branch": "main", "commit": "6d808f99bd63303646794406e270bd553ad7792e" }, - "go-up.nvim": { "branch": "main", "commit": "0151656d66cdad1a696ac10169b2400628c7b451" }, "hardtime.nvim": { "branch": "main", "commit": "b4e431934af1fe224a3a801f632c008278cb7628" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" }, "leap.nvim": { "branch": "main", "commit": "156c71aabb68d520c6269db4103c8e5580e3ea67" }, "lualine.nvim": { "branch": "master", "commit": "131a558e13f9f28b15cd235557150ccb23f89286" }, + "mini.animate": { "branch": "main", "commit": "0365de8b69331c25d0d0d7573407a7dc7719e578" }, "mini.base16": { "branch": "main", "commit": "800f107b27a00978b0dadd672d6da21a5b12fa9a" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, diff --git a/arch/nvim/.config/nvim/lua/plugins/extras.lua b/arch/nvim/.config/nvim/lua/plugins/extras.lua index 3eb0eaf..21ef0f8 100644 --- a/arch/nvim/.config/nvim/lua/plugins/extras.lua +++ b/arch/nvim/.config/nvim/lua/plugins/extras.lua @@ -35,73 +35,73 @@ return { constrain_cursor = false, }, }, - { - "nullromo/go-up.nvim", - opts = { - respectScrolloff = true, - goUpLimit = "center", - ignoredFiletypes = { - "oil", - "snacks_dashboard", - "lazy", - }, - }, -- specify options here - config = function(_, opts) - local goUp = require("go-up") - goUp.setup(opts) - - -- Use to center - vim.keymap.set({ "n", "v" }, "", function() - require("go-up").centerScreen() - end, { desc = "center the screen" }) - - vim.o.scrolloff = 0 -- disable native, we handle it entirely - vim.opt.fillchars:append({ eob = " " }) - - local SCROLLOFF = 20 -- your desired value - - vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI", "BufEnter" }, { - group = vim.api.nvim_create_augroup("ScrollOffEOF", { clear = true }), - callback = function() - if vim.bo.filetype == "oil" then - return - end - - local win_h = vim.api.nvim_win_get_height(0) - local off = math.min(SCROLLOFF, math.floor(win_h / 2)) - local line = vim.fn.line(".") - local last = vim.fn.line("$") - local winline = vim.fn.winline() - - -- Near top: scroll into go-up virtual lines (Ctrl-Y) - if line <= off then - local needed = off - winline + 1 - if needed > 0 then - vim.cmd('execute "normal! ' .. needed .. '\025"') - return - end - end - - -- Near bottom / EOF: scroll past last line (winrestview) - local dist_bot = last - line - local rem = vim.fn.line("w$") - vim.fn.line("w0") + 1 - if dist_bot < off and win_h - rem + dist_bot < off then - local view = vim.fn.winsaveview() - view.topline = view.topline + off - (win_h - rem + dist_bot) - vim.fn.winrestview(view) - return - end - - -- Middle: replicate normal scrolloff behavior - if winline > win_h - off then - -- too close to bottom of window, scroll down (Ctrl-E) - vim.cmd('execute "normal! ' .. (winline - (win_h - off)) .. '\005"') - elseif winline < off + 1 then - -- too close to top of window, scroll up (Ctrl-Y) - vim.cmd('execute "normal! ' .. (off + 1 - winline) .. '\025"') - end - end, - }) - end, - }, + -- { + -- "nullromo/go-up.nvim", + -- opts = { + -- respectScrolloff = true, + -- goUpLimit = "center", + -- ignoredFiletypes = { + -- "oil", + -- "snacks_dashboard", + -- "lazy", + -- }, + -- }, -- specify options here + -- config = function(_, opts) + -- local goUp = require("go-up") + -- goUp.setup(opts) + -- + -- -- Use to center + -- vim.keymap.set({ "n", "v" }, "", function() + -- require("go-up").centerScreen() + -- end, { desc = "center the screen" }) + -- + -- -- vim.o.scrolloff = 0 -- disable native, we handle it entirely + -- -- vim.opt.fillchars:append({ eob = " " }) + -- -- + -- -- local SCROLLOFF = 20 -- your desired value + -- -- + -- -- vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI", "BufEnter" }, { + -- -- group = vim.api.nvim_create_augroup("ScrollOffEOF", { clear = true }), + -- -- callback = function() + -- -- if vim.bo.filetype == "oil" then + -- -- return + -- -- end + -- -- + -- -- local win_h = vim.api.nvim_win_get_height(0) + -- -- local off = math.min(SCROLLOFF, math.floor(win_h / 2)) + -- -- local line = vim.fn.line(".") + -- -- local last = vim.fn.line("$") + -- -- local winline = vim.fn.winline() + -- -- + -- -- -- Near top: scroll into go-up virtual lines (Ctrl-Y) + -- -- if line <= off then + -- -- local needed = off - winline + 1 + -- -- if needed > 0 then + -- -- vim.cmd('execute "normal! ' .. needed .. '\025"') + -- -- return + -- -- end + -- -- end + -- -- + -- -- -- Near bottom / EOF: scroll past last line (winrestview) + -- -- local dist_bot = last - line + -- -- local rem = vim.fn.line("w$") - vim.fn.line("w0") + 1 + -- -- if dist_bot < off and win_h - rem + dist_bot < off then + -- -- local view = vim.fn.winsaveview() + -- -- view.topline = view.topline + off - (win_h - rem + dist_bot) + -- -- vim.fn.winrestview(view) + -- -- return + -- -- end + -- -- + -- -- -- Middle: replicate normal scrolloff behavior + -- -- if winline > win_h - off then + -- -- -- too close to bottom of window, scroll down (Ctrl-E) + -- -- vim.cmd('execute "normal! ' .. (winline - (win_h - off)) .. '\005"') + -- -- elseif winline < off + 1 then + -- -- -- too close to top of window, scroll up (Ctrl-Y) + -- -- vim.cmd('execute "normal! ' .. (off + 1 - winline) .. '\025"') + -- -- end + -- -- end, + -- -- }) + -- end, + -- }, } -- cgit v1.2.3