Skip to content

Commit

Permalink
Improve clang config on nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
Sigmanificient committed Jan 23, 2025
1 parent a16dcb1 commit 7254a2e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions home/nvim/.clang-tidy
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Checks: "-*,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-multi-level-implicit-pointer-conversion,
misc-*,
-misc-no-recursion,
performance-*,
Expand Down
9 changes: 9 additions & 0 deletions home/nvim/.clangd
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@ CompileFlags:
Add: -Wno-unknown-warning-option
Add: -Wno-compare-distinct-pointer-types
Remove: [-m*, -f*]
FileExtensions:
- Pattern: "*.c"
Language: C
- Pattern: "*.h"
Language: C
- Pattern: "*.cpp"
Language: C++
- Pattern: "*.hpp"
Language: C++
9 changes: 6 additions & 3 deletions home/nvim/lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ lspconfig.clangd.setup({
"--offset-encoding=utf-16",
"--header-insertion=never",
"--clang-tidy",
"--cross-file-rename",
}
},
init_options = {
fallbackFlags = {'--std=gnu99'}
},
})
lspconfig.pyright.setup({})

Expand Down Expand Up @@ -64,6 +66,8 @@ if not configs.ehcsls then
}
end
lspconfig.ehcsls.setup({})

lspconfig.ts_ls.setup({})
--

lsp.on_attach(function(_, bufnr)
Expand All @@ -79,4 +83,3 @@ lsp.on_attach(function(_, bufnr)
end)

lsp.setup()

0 comments on commit 7254a2e

Please sign in to comment.