add config
This commit is contained in:
19
lua/configs/cpp.lua
Normal file
19
lua/configs/cpp.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
local M = {}
|
||||
|
||||
M.setup = function()
|
||||
-- Any specific C++ settings can go here
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.expandtab = true
|
||||
|
||||
-- For C++ projects, you might want to set up a compile command
|
||||
vim.api.nvim_create_user_command("CppBuild", function()
|
||||
vim.cmd("!g++ -std=c++17 % -o %:r")
|
||||
end, {})
|
||||
|
||||
vim.api.nvim_create_user_command("CppRun", function()
|
||||
vim.cmd("!g++ -std=c++17 % -o %:r && ./%:r")
|
||||
end, {})
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user