From 125bc23a1b9a4d2568c800be5e1a7ba0452aafe5 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 6 Sep 2024 23:20:39 +0200 Subject: nvim: Add configuration for yacc/bison --- .config/nvim/after/ftplugin/yacc.vim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .config/nvim/after/ftplugin/yacc.vim (limited to '.config/nvim') diff --git a/.config/nvim/after/ftplugin/yacc.vim b/.config/nvim/after/ftplugin/yacc.vim new file mode 100644 index 0000000..151daa8 --- /dev/null +++ b/.config/nvim/after/ftplugin/yacc.vim @@ -0,0 +1,15 @@ +setlocal commentstring=//\ %s + +function! s:ManpageAtPoint() + let l:w = expand('') + call system(['env', 'MANSECT=3,2,3p', 'man', l:w]) + if v:shell_error == 0 + execute "silent !MANSECT=3,2,3p man -Tpdf '" . l:w . "' | zathura - &" + elseif v:shell_error == 16 + echomsg 'No manual for β€˜' . l:w . '’ found' + else + echomsg 'An error occured running β€˜man’' + endif +endfunction + +nnoremap K :call ManpageAtPoint() -- cgit v1.2.3