Files
notes/default/journal/2025/07/24.norg
Archie Fox 26f95df705 Init commit
2025-07-26 08:06:19 +03:00

112 lines
3.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@document.meta
title: 24
description:
authors: fox
categories: [
linux
neovim
plugins
]
created: 2025-07-24T02:02:24+0400
updated: 2025-07-24T02:50:21+0400
version: 1.1.1
@end
* Проблема
В Neovim на больших файлах перестают работать биндинги gg и G. Курсор прыгает на строчку или две вверх и вниз - соответственно.
* Решение
Отлично! Проблема в `snacks.nvim` с включенным модулем `scroll`. Этот модуль перехватывает стандартные биндинги для навигации.
* Решение 1
- Отключить scroll модуль:
@code lua
{
"folke/snacks.nvim",
priority = 1000,
lazy = false,
---@type snacks.Config
opts = {
bigfile = { enabled = true },
dashboard = { enabled = true },
explorer = { enabled = true },
indent = { enabled = true },
input = { enabled = true },
notifier = {
enabled = true,
timeout = 3000,
},
picker = { enabled = true, debug = { scores = true } },
quickfile = { enabled = true },
scope = { enabled = true },
scroll = { enabled = false }, -- Отключаем scroll модуль
statuscolumn = { enabled = true },
words = { enabled = true },
styles = {
notification = {
-- wo = { wrap = true }
},
},
},
-- остальные keys остаются без изменений
}
@end
* Решение 2
- Настроить scroll модуль, чтобы он не перехватывал gg и G:
@code lua
{
"folke/snacks.nvim",
priority = 1000,
lazy = false,
---@type snacks.Config
opts = {
-- ... остальные настройки
scroll = {
enabled = true,
-- Отключаем перехват стандартных биндингов
animate = {
duration = { step = 15, total = 250 },
easing = "linear",
},
-- Не перехватываем gg и G
spamming = 10, -- reduce scroll spam
-- Можно также попробовать добавить:
-- filter = function(buf, win) return true end,
},
-- ... остальные настройки
},
-- keys остаются такими же
}
@end
* Решение 3
- Восстановить биндинги после загрузки snacks:
Добавьте в конец конфигурации snacks или в отдельный файл:
@code lua
{
"folke/snacks.nvim",
-- ... ваша текущая конфигурация
config = function(_, opts)
require("snacks").setup(opts)
-- Восстанавливаем стандартные биндинги после инициализации
vim.defer_fn(function()
vim.keymap.set("n", "gg", function()
vim.api.nvim_win_set_cursor(0, {1, 0})
end, { desc = "Go to first line", silent = true })
vim.keymap.set("n", "G", function()
local line_count = vim.api.nvim_buf_line_count(0)
vim.api.nvim_win_set_cursor(0, {line_count, 0})
end, { desc = "Go to last line", silent = true })
end, 100)
end,
}
@end
** Рекомендую попробовать {* Решение 1} - просто отключить scroll модуль, если вам не критичен smooth scrolling. Если хотите сохранить плавную прокрутку, используйте {* Решение 3}.
После изменения конфигурации перезапустите Neovim, и gg/G должны работать как положено.