From ef342527a5ff85adf9fbf99a9014011a606ed12d Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Fri, 22 Mar 2024 12:52:12 -0500 Subject: [PATCH] added clangd configuration --- nix/nvim/lsp/clang-format | 14 ++++++++++++ nix/nvim/lsp/clang-format-work | 13 +++++++++++ nix/nvim/lsp/clangd | 5 +++++ nix/nvim/lsp/lsp.nix | 40 ++++++++++++++++++++++++++++++++++ 4 files changed, 72 insertions(+) create mode 100644 nix/nvim/lsp/clang-format create mode 100644 nix/nvim/lsp/clang-format-work create mode 100644 nix/nvim/lsp/clangd diff --git a/nix/nvim/lsp/clang-format b/nix/nvim/lsp/clang-format new file mode 100644 index 0000000..2c61359 --- /dev/null +++ b/nix/nvim/lsp/clang-format @@ -0,0 +1,14 @@ +--- +#this syncronizes with settings used by neovims treesitters so that the lsp formatting and treesitter formatting do not fight eatch other. +PointerAlignment: Left +ColumnLimit: 80 +IndentWidth: 4 +TabWidth: 4 +UseCRLF: false +UseTab: Never +AlignAfterOpenBracket: BlockIndent +AlwaysBreakBeforeMultilineStrings: true +BreakBeforeBraces: Attach +AlignOperands: Align +BreakBeforeBinaryOperators: NonAssignment +... diff --git a/nix/nvim/lsp/clang-format-work b/nix/nvim/lsp/clang-format-work new file mode 100644 index 0000000..feaaf21 --- /dev/null +++ b/nix/nvim/lsp/clang-format-work @@ -0,0 +1,13 @@ +--- +#this syncronizes with settings used by neovims treesitters so that the lsp formatting and treesitter formatting do not fight eatch other. +PointerAlignment: Left +ColumnLimit: 80 +IndentWidth: 4 +TabWidth: 4 +UseCRLF: false +UseTab: Never +AlignAfterOpenBracket: BlockIndent +AlwaysBreakBeforeMultilineStrings: true +BreakBeforeBraces: Allman +BreakBeforeBinaryOperators: None +... diff --git a/nix/nvim/lsp/clangd b/nix/nvim/lsp/clangd new file mode 100644 index 0000000..1211c5c --- /dev/null +++ b/nix/nvim/lsp/clangd @@ -0,0 +1,5 @@ +# keeps clangd from choking when it sees a compiler flag for a different +# compiler. (sutch as when acting as an lsp for a project that uses GCC.) +CompileFlags: + Add: -Wno-unknown-warning-option + Remove: [-m*, -f*] diff --git a/nix/nvim/lsp/lsp.nix b/nix/nvim/lsp/lsp.nix index faeec65..8dcd00d 100644 --- a/nix/nvim/lsp/lsp.nix +++ b/nix/nvim/lsp/lsp.nix @@ -187,6 +187,46 @@ } ]; }; + home.file = { + ".clangd".text = '' + # keeps clangd from choking when it sees a compiler flag for a different + # compiler. (sutch as when acting as an lsp for a project that uses GCC.) + CompileFlags: + Add: -Wno-unknown-warning-option + Remove: [-m*, -f*] + ''; + ".clang-format".text = '' + --- + #this syncronizes with settings used by neovims treesitters so that the lsp formatting and treesitter formatting do not fight eatch other. + PointerAlignment: Left + ColumnLimit: 80 + IndentWidth: 4 + TabWidth: 4 + UseCRLF: false + UseTab: Never + AlignAfterOpenBracket: BlockIndent + AlwaysBreakBeforeMultilineStrings: true + BreakBeforeBraces: Attach + AlignOperands: Align + BreakBeforeBinaryOperators: NonAssignment + ... + ''; + "work/.clang-format".text = '' + --- + #this syncronizes with settings used by neovims treesitters so that the lsp formatting and treesitter formatting do not fight eatch other. + PointerAlignment: Left + ColumnLimit: 80 + IndentWidth: 4 + TabWidth: 4 + UseCRLF: false + UseTab: Never + AlignAfterOpenBracket: BlockIndent + AlwaysBreakBeforeMultilineStrings: true + BreakBeforeBraces: Allman + BreakBeforeBinaryOperators: None + ... + ''; + }; imports = [ # ./outline.nix ./rust-tools.nix