// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run `zed: open default settings` from the
// command palette (cmd-shift-p / ctrl-shift-p)
{
    "vim": {
        "use_system_clipboard": "on_yank"
    },
    "relative_line_numbers": true,
    "features": {
        "inline_completion_provider": "none"
    },
    "assistant": {
        "default_model": {
            "provider": "zed.dev",
            "model": "claude-3-5-sonnet-latest"
        },
        "dock": "right",
        "version": "2"
    },
    "buffer_font_size": 17,
    "format_on_save": "prettier",
    "formatter": "prettier",
    "buffer_font_family": "FiraCode Nerd Font",
    "tab_size": 4,
    "vim_mode": true,
    "ui_font_size": 16,
    "theme": {
        "mode": "system",
        "light": "One Light",
        "dark": "Tokyo Night"
    },
    "lsp": {
        "rust-analyzer": {
            "initialization_options": {
                "check": {
                    "command": "clippy" // rust-analyzer.checkOnSave.command
                },
                "checkOnSave": {
                    "command": "clippy" // rust-analyzer.checkOnSave.command
                },
                "inlayHints": {
                    "maxLength": null,
                    "lifetimeElisionHints": {
                        "enable": "skip_trivial",
                        "useParameterNames": true
                    },
                    "closureReturnTypeHints": {
                        "enable": "always"
                    }
                },
                "diagnostics": {
                    "experimental": {
                        "enable": true
                    }
                },
                "cargo": {
                    "features": "all",
                    "allTargets": true
                }
            }
        },
        "ruff": {
            "initialization_options": {
                "settings": {
                    // Ruff server settings goes here
                    "lineLength": 80,
                    "lint": {
                        "extendSelect": ["I"]
                    }
                }
            }
        }
    },
    "soft_wrap": "editor_width",
    "show_wrap_guides": true,
    "wrap_guides": [80],
    "languages": {
        "Jinja2": {
            "formatter": [
                {
                    "external": {
                        "command": "djlint",
                        "arguments": [
                            "--reformat",
                            "--format-css",
                            "--format-js",
                            "-"
                            // "{buffer_path}"
                        ]
                    }
                }
            ],
            "format_on_save": "on"
        },
        "Python": {
            "format_on_save": "language_server",
            "formatter": [
                {
                    "language_server": {
                        "name": "ruff"
                    }
                }
            ],
            "language_servers": ["pyright", "ruff"]
        },
        "Rust": {
            "format_on_save": "language_server",
            "formatter": "language_server"
        }
    }
}
