diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-09-06 23:20:39 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-09-06 23:20:39 +0200 |
commit | 125bc23a1b9a4d2568c800be5e1a7ba0452aafe5 (patch) | |
tree | d6d587c4b77bf6229e78024473494946df8c9686 /.config/nvim/after/ftplugin/yacc.vim | |
parent | 550630d8d3fb0d1c2b73dcd9690f0296eae01e30 (diff) |
nvim: Add configuration for yacc/bison
Diffstat (limited to '.config/nvim/after/ftplugin/yacc.vim')
-rw-r--r-- | .config/nvim/after/ftplugin/yacc.vim | 15 |
1 files changed, 15 insertions, 0 deletions
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('<cword>') + 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 <buffer> <silent> K :call <SID>ManpageAtPoint()<CR> |