From 26f95df705c5b5c5c18f0ecef5cf9546f9c696e4 Mon Sep 17 00:00:00 2001 From: Archie Fox Date: Sat, 26 Jul 2025 08:06:19 +0300 Subject: [PATCH] Init commit --- default/index.norg | 45 +++++++++++++ default/journal/2025/07/21.norg | 14 ++++ default/journal/2025/07/24.norg | 111 ++++++++++++++++++++++++++++++++ default/trouble_cursor.norg | 18 ++++++ index.norg | 13 ++++ 5 files changed, 201 insertions(+) create mode 100644 default/index.norg create mode 100644 default/journal/2025/07/21.norg create mode 100644 default/journal/2025/07/24.norg create mode 100644 default/trouble_cursor.norg create mode 100644 index.norg diff --git a/default/index.norg b/default/index.norg new file mode 100644 index 0000000..ed89f5f --- /dev/null +++ b/default/index.norg @@ -0,0 +1,45 @@ +.toc Оглавление + +* First line +** Second line +*** hello + +* one layer +** Two +*** Three +**** Four + Some text + +* Other content + +{:some-file:}[some file] + +{file:///home/fox/Pictures/arch.png}[arch] + +- ( ) first +-- ( ) Second +- (x) Third + +- ( ) Two +-- (-) aa +-- (=) bb +-- (!) cc +--- (_) dddd + +{https://github.com}[Github] + +@code norg + +This is *bold*. +This is /italic/. +This is _underline_. +This is -strikethrough-. +This is a spoiler: !org-mode is a bozo!, to see the content you either enter insert mode on this line (good luck) or toggle the concealer off. +This is a `verbatim object, you can't put *markup* in here!`. +@end + +------- +This is a spoiler !hello in neorg file! +/hello/ `another` *text* + + diff --git a/default/journal/2025/07/21.norg b/default/journal/2025/07/21.norg new file mode 100644 index 0000000..bdb5c0b --- /dev/null +++ b/default/journal/2025/07/21.norg @@ -0,0 +1,14 @@ +@document.meta +title: 21 +description: +authors: fox +categories: [ + test + other +] +created: 2025-07-24T03:04:53+0400 +updated: 2025-07-24T03:05:37+0400 +version: 1.1.1 +@end + +* Файл из прошлого diff --git a/default/journal/2025/07/24.norg b/default/journal/2025/07/24.norg new file mode 100644 index 0000000..ae9e7c3 --- /dev/null +++ b/default/journal/2025/07/24.norg @@ -0,0 +1,111 @@ +@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 должны работать как положено. diff --git a/default/trouble_cursor.norg b/default/trouble_cursor.norg new file mode 100644 index 0000000..011cca6 --- /dev/null +++ b/default/trouble_cursor.norg @@ -0,0 +1,18 @@ +@document.meta +title: trouble_cursor +description: +authors: fox +categories: [ + linux + neovim +] +created: 2025-07-25T14:35:02+0400 +updated: 2025-07-25T14:37:52+0400 +version: 1.1.1 +@end + +* Проблема на переходах к 1 и последней строке файла + +* Решение: + + Отключить scroll в настройках плагина Snacks diff --git a/index.norg b/index.norg new file mode 100644 index 0000000..3d876a7 --- /dev/null +++ b/index.norg @@ -0,0 +1,13 @@ +* Index +** Linux + - {:$/journal/2025/07/24:}[24] +** Neovim + - {:$/journal/2025/07/24:}[24] +** Other + - {:$/journal/2025/07/21:}[21] +** Plugins + - {:$/journal/2025/07/24:}[24] +** Test + - {:$/journal/2025/07/21:}[21] +** Uncategorised + - {:$/index:}[First Line]