diff --git a/lua/nvimpager/pager.lua b/lua/nvimpager/pager.lua index 5e96e07..d3a6c3f 100644 --- a/lua/nvimpager/pager.lua +++ b/lua/nvimpager/pager.lua @@ -10,7 +10,7 @@ local util = require("nvimpager/util") local ansi2highlight = require("nvimpager/ansi2highlight") local follow_timer = nil -local function toggle_follow() +function nvimpager.toggle_follow() if follow_timer ~= nil then vim.fn.timer_pause(follow_timer, nvimpager.follow) nvimpager.follow = not nvimpager.follow @@ -42,7 +42,7 @@ local function set_maps() map('', '') map('k', '') map('j', '') - map('F', toggle_follow) + map('F', nvimpager.toggle_follow) end --- Setup function for the VimEnter autocmd. @@ -69,7 +69,7 @@ local function pager_mode() if nvimpager.follow then -- turn follow mode of so that we can use the init logic in toggle_follow nvimpager.follow = false - toggle_follow() + nvimpager.toggle_follow() end end diff --git a/nvimpager.md b/nvimpager.md index 825a69b..5252a79 100644 --- a/nvimpager.md +++ b/nvimpager.md @@ -136,6 +136,8 @@ The following mappings are defined by default: files. It is modeled after the *F* command in *less*(1) or the *-f* option of *tail*(1) +You can remap the lua function `nvimpager.toggle_follow` if you disabled the +default keymappings # EXAMPLES