Add :PreProcIfWrap command and C/C++ mappings

Quickly wrap a line or range in `#if 0`/`#endif` to quickly disable
compilation of sections of code.
This commit is contained in:
2024-05-25 10:24:07 +01:00
parent 0602390a2d
commit 1996e631a3
3 changed files with 17 additions and 0 deletions

View File

@@ -1,2 +1,6 @@
vim.opt.commentstring = '//%s'
vim.opt.matchpairs:append('<:>')
local opts = { buffer = true, remap = false, silent = true }
vim.keymap.set('n', '0', ':PreProcIfWrap<CR>', opts)
vim.keymap.set('v', '0', ':PreProcIfWrap<CR>', opts)