From 3b209dc0f967e469207beea7d6478ebe1e075c76 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 18 Aug 2024 15:23:47 +0200 Subject: nvim: Prefer *.vim to *.lua --- .config/nvim/after/ftplugin/c.vim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .config/nvim/after/ftplugin/c.vim (limited to '.config/nvim/after/ftplugin/c.vim') diff --git a/.config/nvim/after/ftplugin/c.vim b/.config/nvim/after/ftplugin/c.vim new file mode 100644 index 0000000..40ecaf8 --- /dev/null +++ b/.config/nvim/after/ftplugin/c.vim @@ -0,0 +1,16 @@ +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 + +xnoremap q !clang-format -style=file +nnoremap K :call ManpageAtPoint() -- cgit v1.2.3