Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions home/neovim/lsp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,6 @@
ultisnips
];

autoGroups = {
format_on_save = {
clear = true;
};
};
autoCmd = [
{
event = [ "BufWritePre" ];
buffer = 0;
command = "lua vim.lsp.buf.format()";
desc = "Auto-format on save";
group = "format_on_save";
}
];

# Required for the `lsp-lines` plugin
diagnostic = {
settings = {
Expand Down Expand Up @@ -74,7 +59,9 @@
# see https://github.com/lukas-reineke/lsp-format.nvim/
lsp-format = {
enable = true;
lspServersToEnable = "all";
lspServersToEnable = [
"null-ls"
];
};

# see https://github.com/nvimtools/none-ls.nvim/
Expand Down
13 changes: 13 additions & 0 deletions home/neovim/lsp/java.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,18 @@
};
};
};

plugins.none-ls = {
sources.formatting = {
google_java_format = {
enable = true;
package = pkgs.google-java-format;
settings = {
filetypes = [ "java" ];
extra_args = [ "--aosp" ];
};
};
};
};
};
}
6 changes: 6 additions & 0 deletions home/neovim/lsp/nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@
enable = true;
};
};

plugins.none-ls.sources = {
formatting = {
nixfmt.enable = true;
};
};
};
}
Loading