-
-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pack): add cpp base pack (#295)
Co-authored-by: Micah Halter <[email protected]>
- Loading branch information
1 parent
901fc36
commit 8ac4492
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# C/C++ Language Pack | ||
|
||
This plugin pack does the following: | ||
|
||
- Adds `cpp` `c` `objc` `cuda` `proto` Treesitter parsers | ||
- Adds `clangd` language server | ||
- Adds `clang-format` formatter | ||
- Adds [clangd_extensions.nvim](https://github.com/p00f/clangd_extensions.nvim) for language specific tooling | ||
- Adds [cmake-tools.nvim](https://github.com/Civitasv/cmake-tools.nvim) for building and debugging | ||
|
||
tips: the offset_encondings of clangd will confilicts whit null-ls, so add the following file in your user_config. | ||
|
||
```lua | ||
-- <user_config_path>/lsp/config/clangd.lua | ||
return { | ||
capabilities = { | ||
offsetEncoding = "utf-8", | ||
}, | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
local utils = require "astronvim.utils" | ||
return { | ||
{ | ||
"nvim-treesitter/nvim-treesitter", | ||
opts = function(_, opts) | ||
if opts.ensure_installed ~= "all" then | ||
opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, { "cpp", "c", "objc", "cuda", "proto" }) | ||
end | ||
end, | ||
}, | ||
{ | ||
"williamboman/mason-lspconfig.nvim", | ||
opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "clangd") end, | ||
}, | ||
{ | ||
"jay-babu/mason-null-ls.nvim", | ||
opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "clang-format") end, | ||
}, | ||
{ | ||
"p00f/clangd_extensions.nvim", | ||
ft = { "c", "cpp", "objc", "objcpp", "cuda", "proto" }, | ||
init = function() utils.list_insert_unique(astronvim.lsp.skip_setup, "clangd") end, | ||
opts = function() return { server = require("astronvim.utils.lsp").config "clangd" } end, | ||
}, | ||
{ | ||
"Civitasv/cmake-tools.nvim", | ||
ft = { "c", "cpp", "objc", "objcpp", "cuda", "proto" }, | ||
dependencies = { | ||
{ | ||
"jay-babu/mason-nvim-dap.nvim", | ||
opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "codelldb") end, | ||
}, | ||
}, | ||
opts = {}, | ||
}, | ||
} |