lucc / nvimpager

Use nvim as a pager to view manpages, diffs, etc with nvim's syntax highlighting
Other
365 stars 19 forks source link

Optional mappings #56

Closed mrdgo closed 2 years ago

mrdgo commented 2 years ago

I request the following default mappings:

local opts = { noremap=true }

vim.api.nvim_set_keymap('n', 'j', 'Lj', opts)
vim.api.nvim_set_keymap('n', 'k', 'Hk', opts)

I would also understand to make them optional with nvimpager -l (for --less-like-motion).

lucc commented 2 years ago

Which version of nvimpager are you running? In the current dev version these keys should be mapped to and . Is there any important difference between your suggestion and this?

mrdgo commented 2 years ago

I installed nvimpager from the AUR, version nvimpager v0.10.2-8-g499f43c.

In my install, none of these mappings seems to be active - not even q, I have to manually type :q. That is a whole different problem, right?

lucc commented 2 years ago

The mappings are here: https://github.com/lucc/nvimpager/blob/63709c4afa714c39bad0a0697c15f45e23c16c6f/lua/nvimpager.lua#L661-L675 So the question are:

  1. Are these enough for you (if they would be loaded)?
  2. Do you want some more and does it make sense to put them in your config or should they go into the default mappings?

And then there is the issue with neovim 0.5.1 / Arch Linux. It seems some things broke with neovim 0.5.1 (https://app.travis-ci.com/github/lucc/nvimpager/jobs/540988644), I am still investigating that. Help is obviously welcome! I suspect changes to rtp handling because that test failed.

Can you report the full output of :messages when the mappings are not loaded? And also :scriptnames please.

lucc commented 2 years ago

BTW are you using neovim 0.5.1 from the repos or some unstable version from the AUR?

mrdgo commented 2 years ago

Thanks for your response!

  1. These mappings seem absolutely sufficient to me.
  2. I don't think, there is anything missing.

For some reason, the mappings are not loaded in my setup. I think, you pinpointed the problem.

:messages are empty.

:scriptnames outputs:

  1: /usr/share/nvim/runtime/filetype.vim
  2: /usr/share/nvim/runtime/ftplugin.vim
  3: /usr/share/nvim/runtime/indent.vim
  4: /usr/share/nvim/runtime/syntax/syntax.vim
  5: /usr/share/nvim/runtime/syntax/synload.vim
  6: /usr/share/nvim/runtime/plugin/gzip.vim
  7: /usr/share/nvim/runtime/plugin/health.vim
  8: /usr/share/nvim/runtime/plugin/man.vim
  9: /usr/share/nvim/runtime/plugin/matchit.vim
 10: /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim
 11: /usr/share/nvim/runtime/plugin/matchparen.vim
 12: /usr/share/nvim/runtime/plugin/netrwPlugin.vim
 13: /usr/share/nvim/runtime/plugin/rplugin.vim
 14: /usr/share/nvim/runtime/plugin/shada.vim
 15: /usr/share/nvim/runtime/plugin/spellfile.vim
 16: /usr/share/nvim/runtime/plugin/tarPlugin.vim
 17: /usr/share/nvim/runtime/plugin/tohtml.vim
 18: /usr/share/nvim/runtime/plugin/tutor.vim
 19: /usr/share/nvim/runtime/plugin/zipPlugin.vim
 20: /usr/share/nvim/runtime/scripts.vim
 21: /usr/share/nvim/runtime/autoload/man.vim
 22: /usr/share/nvim/runtime/ftplugin/man.vim
 23: /usr/share/nvim/runtime/syntax/man.vim

I use nvim v0.6.0-dev+445-ga36c6e5df - that is neovim-nightly-bin from the AUR.

mrdgo commented 2 years ago

BTW - should we close this issue and open a new one? Or rename this one? Because this issue is certainly not about mappings anymore.

lucc commented 2 years ago

Thanks for the info. I can reproduce the test failure from travis with nvim 0.6-dev locally. nvim 0.5.1 seems to work fine (travis on mac and locally).

You can open a new issue if you want to document it but I am working on it already.

lucc commented 2 years ago

@mrdgo I was busy with other stuff but I found out that you can let g:no_man_maps = v:true in ~/.config/nvimpager/init.vim to suppress the mappings from the man plugin. I am still working on a better solution.