nvim: disable some keymaps in man and help pages
This commit is contained in:
parent
c130a13418
commit
80358cd31b
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue