lsp: show function signature, use conform.nvim for formatting code.
This commit is contained in:
parent
8199081348
commit
aca9dd3078
4 changed files with 80 additions and 10 deletions
37
config/lsp/conform.nix
Normal file
37
config/lsp/conform.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{ helpers, pkgs, ... }: {
|
||||
plugins.conform-nvim = {
|
||||
enable = true;
|
||||
formatAfterSave = ''
|
||||
{
|
||||
format_after_save = {
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
}
|
||||
'';
|
||||
formattersByFt = {
|
||||
python = [ "black" ];
|
||||
c = [ "clang-format" ];
|
||||
cpp = [ "clang-format" ];
|
||||
cmake = [ "cmake_format" ];
|
||||
nix = [ "nixfmt" ];
|
||||
# Standalone scalafmt is too slow, so we use it as a fallback
|
||||
scala = helpers.mkRaw ''
|
||||
{ scalafmt, lsp_format = "prefer" }
|
||||
'';
|
||||
toml = [ "taplo" ];
|
||||
yaml = [ "yq" ];
|
||||
json = [ "jq" ];
|
||||
};
|
||||
};
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
black
|
||||
clang-tools
|
||||
cmake-format
|
||||
jq
|
||||
nixfmt-rfc-style
|
||||
scalafmt
|
||||
taplo
|
||||
yq
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue