diff options
Diffstat (limited to '.config/nvim/after/ftplugin')
22 files changed, 26 insertions, 35 deletions
diff --git a/.config/nvim/after/ftplugin/c.lua b/.config/nvim/after/ftplugin/c.lua deleted file mode 100644 index c65969c..0000000 --- a/.config/nvim/after/ftplugin/c.lua +++ /dev/null @@ -1,23 +0,0 @@ -vim.bo.commentstring = '// %s' - -vim.keymap.set('x', '<LocalLeader>=', ":'<'>!clang-format -style=file<CR>", { - desc = 'Format the current selection with Clang Format', -}) - -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 - &" - ]] -end, { - buffer = 0, - desc = 'View the manual page for the word under the cursor', -}) 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('<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 + +xnoremap <buffer> <silent> <LocalLeader>q <Cmd>!clang-format -style=file<CR> +nnoremap <buffer> <silent> K :call <SID>ManpageAtPoint()<CR> diff --git a/.config/nvim/after/ftplugin/ebnf.lua b/.config/nvim/after/ftplugin/ebnf.lua deleted file mode 100644 index 264b539..0000000 --- a/.config/nvim/after/ftplugin/ebnf.lua +++ /dev/null @@ -1 +0,0 @@ -vim.bo.commentstring = '(* %s *)' diff --git a/.config/nvim/after/ftplugin/ebnf.vim b/.config/nvim/after/ftplugin/ebnf.vim new file mode 100644 index 0000000..ac1a448 --- /dev/null +++ b/.config/nvim/after/ftplugin/ebnf.vim @@ -0,0 +1 @@ +setlocal commentstring=(*\ %s\ *) diff --git a/.config/nvim/after/ftplugin/gitcommit.lua b/.config/nvim/after/ftplugin/gitcommit.lua deleted file mode 100644 index 21934e4..0000000 --- a/.config/nvim/after/ftplugin/gitcommit.lua +++ /dev/null @@ -1 +0,0 @@ -vim.bo.expandtab = true diff --git a/.config/nvim/after/ftplugin/gitcommit.vim b/.config/nvim/after/ftplugin/gitcommit.vim new file mode 100644 index 0000000..5245bdc --- /dev/null +++ b/.config/nvim/after/ftplugin/gitcommit.vim @@ -0,0 +1 @@ +setlocal expandtab diff --git a/.config/nvim/after/ftplugin/json.lua b/.config/nvim/after/ftplugin/json.lua deleted file mode 100644 index 1e6245d..0000000 --- a/.config/nvim/after/ftplugin/json.lua +++ /dev/null @@ -1 +0,0 @@ -vim.bo.formatprg = 'jq --tab' diff --git a/.config/nvim/after/ftplugin/json.vim b/.config/nvim/after/ftplugin/json.vim new file mode 100644 index 0000000..09100bf --- /dev/null +++ b/.config/nvim/after/ftplugin/json.vim @@ -0,0 +1 @@ +setlocal formatprg=jq\ --tab diff --git a/.config/nvim/after/ftplugin/mail.lua b/.config/nvim/after/ftplugin/mail.lua deleted file mode 100644 index 72f99e9..0000000 --- a/.config/nvim/after/ftplugin/mail.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.bo.expandtab = true -vim.bo.textwidth = 73 diff --git a/.config/nvim/after/ftplugin/mail.vim b/.config/nvim/after/ftplugin/mail.vim new file mode 100644 index 0000000..5969086 --- /dev/null +++ b/.config/nvim/after/ftplugin/mail.vim @@ -0,0 +1 @@ +setlocal expandtab textwidth=73 diff --git a/.config/nvim/after/ftplugin/markdown.lua b/.config/nvim/after/ftplugin/markdown.lua deleted file mode 100644 index 72f99e9..0000000 --- a/.config/nvim/after/ftplugin/markdown.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.bo.expandtab = true -vim.bo.textwidth = 73 diff --git a/.config/nvim/after/ftplugin/markdown.vim b/.config/nvim/after/ftplugin/markdown.vim new file mode 100644 index 0000000..5969086 --- /dev/null +++ b/.config/nvim/after/ftplugin/markdown.vim @@ -0,0 +1 @@ +setlocal expandtab textwidth=73 diff --git a/.config/nvim/after/ftplugin/nroff.lua b/.config/nvim/after/ftplugin/nroff.lua deleted file mode 100644 index 1532c29..0000000 --- a/.config/nvim/after/ftplugin/nroff.lua +++ /dev/null @@ -1 +0,0 @@ -vim.bo.textwidth = 73 diff --git a/.config/nvim/after/ftplugin/nroff.vim b/.config/nvim/after/ftplugin/nroff.vim new file mode 100644 index 0000000..63c4b9b --- /dev/null +++ b/.config/nvim/after/ftplugin/nroff.vim @@ -0,0 +1 @@ +setlocal textwidth=73 diff --git a/.config/nvim/after/ftplugin/oryx.lua b/.config/nvim/after/ftplugin/oryx.lua deleted file mode 100644 index 984111a..0000000 --- a/.config/nvim/after/ftplugin/oryx.lua +++ /dev/null @@ -1 +0,0 @@ -vim.bo.commentstring = '/* %s */' diff --git a/.config/nvim/after/ftplugin/oryx.vim b/.config/nvim/after/ftplugin/oryx.vim new file mode 100644 index 0000000..f059cc8 --- /dev/null +++ b/.config/nvim/after/ftplugin/oryx.vim @@ -0,0 +1 @@ +setlocal commentstring=/*\ %s\ */ diff --git a/.config/nvim/after/ftplugin/python.lua b/.config/nvim/after/ftplugin/python.lua deleted file mode 100644 index c37615b..0000000 --- a/.config/nvim/after/ftplugin/python.lua +++ /dev/null @@ -1 +0,0 @@ -vim.bo.expandtab = false diff --git a/.config/nvim/after/ftplugin/python.vim b/.config/nvim/after/ftplugin/python.vim new file mode 100644 index 0000000..bbd8967 --- /dev/null +++ b/.config/nvim/after/ftplugin/python.vim @@ -0,0 +1 @@ +setlocal noexpandtab diff --git a/.config/nvim/after/ftplugin/query.lua b/.config/nvim/after/ftplugin/query.lua deleted file mode 100644 index 21934e4..0000000 --- a/.config/nvim/after/ftplugin/query.lua +++ /dev/null @@ -1 +0,0 @@ -vim.bo.expandtab = true diff --git a/.config/nvim/after/ftplugin/query.vim b/.config/nvim/after/ftplugin/query.vim new file mode 100644 index 0000000..8c3b996 --- /dev/null +++ b/.config/nvim/after/ftplugin/query.vim @@ -0,0 +1 @@ +setlocal autoindent expandtab lisp diff --git a/.config/nvim/after/ftplugin/yuck.lua b/.config/nvim/after/ftplugin/yuck.lua deleted file mode 100644 index ee8cd37..0000000 --- a/.config/nvim/after/ftplugin/yuck.lua +++ /dev/null @@ -1 +0,0 @@ -vim.bo.commentstring = '; %s' diff --git a/.config/nvim/after/ftplugin/yuck.vim b/.config/nvim/after/ftplugin/yuck.vim new file mode 100644 index 0000000..a13b726 --- /dev/null +++ b/.config/nvim/after/ftplugin/yuck.vim @@ -0,0 +1 @@ +setlocal commentstring=;\ %s |