nvim: disable some keymaps in man and help pages

This commit is contained in:
Hoang Nguyen 2022-01-11 16:18:22 +07:00
parent c130a13418
commit 80358cd31b
No known key found for this signature in database
GPG Key ID: 813CF484F4993419
4 changed files with 12 additions and 3 deletions

View File

@ -26,7 +26,7 @@ $ podman run --rm -it localhost/dotfiles /bin/ash
## 🖊️ TODO
- [ ] [wayout](https://git.sr.ht/~proycon/wayout)
- [ ] ~~[wayout](https://git.sr.ht/~proycon/wayout)~~
- [ ] Theme bootstraping
- [ ] Use Wireplumber lua API for 'volumncontrol' script instead of [pulsemixer](https://github.com/GeorgeFilipkin/pulsemixer)

View File

@ -47,8 +47,8 @@ set -gx PYENV_ROOT $XDG_DATA_HOME/pyenv
# common envs
set -gx VISUAL nvim
set -gx EDITOR $VISUAL
set -gx MANPAGER "nvim +Man!"
set -gx PAGER "less -R"
set -gx MANPAGER "nvim +Man!"
# make man work for fish's built-in functions
set -gx MANPATH :$__fish_data_dir/man:$XDG_DATA_HOME/man

View File

@ -54,7 +54,8 @@ local augroups = {
{'BufReadPre', '*', 'lua require("keymap").whichkeyLocal()'},
{'FileType', 'org', 'lua require("keymap").whichkeyOrg()'},
{'FileType', 'html,css', 'lua require("keymap").whichkeyHtml()'},
{'FileType', 'markdown', 'lua require("keymap").whichkeyMarkdown()'}
{'FileType', 'markdown', 'lua require("keymap").whichkeyMarkdown()'},
{'FileType', 'man,help', 'lua require("keymap").man_help_disable_keymaps()'}
},
plugins = {
-- Autohide tabline on dashboard

View File

@ -19,6 +19,14 @@ function M.whichkeyOrg()
wk.register(map.org_map, {buffer = vim.api.nvim_get_current_buf()})
end
function M.man_help_disable_keymaps()
vim.api.nvim_command('setlocal nomodifiable')
local keys = {'i', 'I', 'a', 'A', 'o', 'O', 's', 'J'}
for _, key in ipairs(keys) do
vim.api.nvim_buf_set_keymap(0, 'n', key, '<nop>', {noremap = true})
end
end
-- Other mappings --
function M.setup()
map.undefined_map()