1
0
Fork 0

Compare commits

..

2 commits

Author SHA1 Message Date
3bff0ca1d2
feat(nixvim): Add mdformat 2025-08-04 13:45:43 +02:00
2d9b40b809
fix(nixvim): Disable formatting for Typescript 2025-08-04 13:45:26 +02:00
2 changed files with 14 additions and 1 deletions

View file

@ -29,6 +29,8 @@
enable = true; enable = true;
extraOptions.on_init.__raw = '' extraOptions.on_init.__raw = ''
function(client) function(client)
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
client.handlers['tsserver/request'] = function(_, result, context) client.handlers['tsserver/request'] = function(_, result, context)
local clients = vim.lsp.get_clients({ bufnr = context.bufnr, name = 'vtsls' }) local clients = vim.lsp.get_clients({ bufnr = context.bufnr, name = 'vtsls' })
if #clients == 0 then if #clients == 0 then
@ -59,6 +61,12 @@
typescript-tools = { typescript-tools = {
enable = true; enable = true;
settings = { settings = {
on_attach.__raw = ''
function(client)
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
end
'';
filetypes = [ "javascript" "typescript" "vue" ]; filetypes = [ "javascript" "typescript" "vue" ];
settings = { settings = {
single_file_support = false; single_file_support = false;

View file

@ -1,10 +1,15 @@
{ ... }: { { pkgs, ... }: {
programs.nixvim.plugins.none-ls = { programs.nixvim.plugins.none-ls = {
enable = true; enable = true;
sources = { sources = {
formatting = { formatting = {
black.enable = true; black.enable = true;
dart_format.enable = true; dart_format.enable = true;
mdformat = {
enable = true;
package = pkgs.mdformat.withPlugins
(packages: with packages; [ mdformat-tables ]);
};
nixfmt.enable = true; nixfmt.enable = true;
xmllint.enable = true; xmllint.enable = true;
}; };