neovim/runtime/ftplugin/c.lua
Gregory Anders fcfe535e98
refactor(defaults): do not use C specific default values for options (#22500)
The options 'path', 'include', and 'define' all use C-specific default
values. This may have made sense a long time ago when Vim was mostly
used just for writing C, but this is no longer the case, and we have
ample support for filetype specific configuration. Make the default
values of these options empty and move the C-specific values into a
filetype plugin where they belong.

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-06-06 11:26:29 -05:00

15 lines
401 B
Lua

-- These are the default option values in Vim, but not in Nvim, so must be set explicitly.
vim.bo.commentstring = '/*%s*/'
vim.bo.define = '^\\s*#\\s*define'
vim.bo.include = '^\\s*#\\s*include'
if vim.fn.isdirectory('/usr/include') == 1 then
vim.cmd([[
setlocal path^=/usr/include
setlocal path-=.
setlocal path^=.
]])
end
vim.b.undo_ftplugin = vim.b.undo_ftplugin .. '|setl path<'