diff options
Diffstat (limited to '.config')
-rw-r--r-- | .config/nvim/after/ftplugin/c.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/.config/nvim/after/ftplugin/c.lua b/.config/nvim/after/ftplugin/c.lua index 6058e31..2c378f4 100644 --- a/.config/nvim/after/ftplugin/c.lua +++ b/.config/nvim/after/ftplugin/c.lua @@ -5,6 +5,15 @@ vim.keymap.set('v', '<localleader>=', ":'<'>!clang-format -style=file -<CR>", { }) vim.keymap.set('n', 'K', function() + local w = vim.fn.expand('<cword>') + local proc = vim.system({'man', w}):wait() + if proc.code == 16 then + print('No manual for ‘' .. w .. '’ found') + return + elseif proc.code ~= 0 then + print('An error occured') + return + end vim.cmd [[ execute "silent !man -Tpdf '" . expand('<cword>') . "' | zathura - &" ]] |