Skip to content

Instantly share code, notes, and snippets.

@Nejat
Last active October 4, 2025 11:07
Show Gist options
  • Save Nejat/67e7629245ecb7f484ab3b929fc3dac8 to your computer and use it in GitHub Desktop.
Save Nejat/67e7629245ecb7f484ab3b929fc3dac8 to your computer and use it in GitHub Desktop.
Helix Languages Configuration
# =============================================================================
# HELIX EDITOR LANGUAGES CONFIGURATION
# =============================================================================
# This file configures language support for Helix Editor
# Template showing all available configuration options (commented out)
# =============================================================================
# [[language]]
# name = "language-name" # Language identifier (required)
# scope = "source.language-name" # Tree-sitter scope (required)
# auto-format = true # Enable auto-formatting (default: true)
# comment-token = "#" # Comment character
# config = { lsp = { settings = {} } } # Language server configuration
# dap = { adapters = [] } # Debug Adapter Protocol configuration
# debugger = { command = "debugger", args = [] } # Debugger configuration
# diagnostic-severity = "Error" # Minimum diagnostic severity to show
# file-types = ["ext1", "ext2"] # File extensions (required)
# formatter = { command = "formatter", args = ["--stdin"] } # Custom formatter
# indent = { tab-width = 4, unit = " " } # Indentation settings
# injection-regex = "^(language-name|lang)$" # Regex for language injection
# language-servers = ["lsp-server-name"] # Language servers to use
# roots = ["Cargo.toml", "package.json"] # Project root indicators
# shebangs = ["#!/usr/bin/env language"] # Shebang patterns
# soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" } # Soft wrap settings
# text-width = 80 # Line length for formatting
# =============================================================================
# LANGUAGE CONFIGURATIONS
# =============================================================================
# Bash
[[language]]
name = "bash"
scope = "source.bash"
auto-format = true
file-types = ["sh", "bash"]
formatter = { command = "shfmt", args = ["-i", "2", "-ci", "-sr"] }
indent = { tab-width = 2, unit = " " }
language-servers = ["bash-language-server"]
roots = [".bashrc", ".bash_profile", ".profile"]
shebangs = ["#!/usr/bin/env bash"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# CSS
[[language]]
name = "css"
scope = "source.css"
auto-format = true
file-types = ["css"]
formatter = { command = "prettier", args = ["--stdin-filepath", "file.css"] }
indent = { tab-width = 2, unit = " " }
language-servers = ["vscode-css-language-server"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# Dockerfile
[[language]]
name = "dockerfile"
scope = "source.dockerfile"
auto-format = true
file-types = ["dockerfile", "Dockerfile", "Containerfile"]
formatter = { command = "dockfmt", args = ["fmt"] }
indent = { tab-width = 2, unit = " " }
# language-servers = ["docker-langserver"]
# language-servers = ["docker-langserver", "hadolint"]
roots = ["Dockerfile", "Containerfile"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# [language-server.hadolint]
# command = "hadolint"
# args = ["--no-color", "-"]
[language-server.docker-langserver]
command = "docker-langserver"
args = ["--stdio"]
[language-server.docker-langserver.config]
docker.languageserver.diagnostics.enabled = true
docker.languageserver.formatter.ignoreMultilineInstructions = true
# CMake
[[language]]
name = "cmake"
scope = "source.cmake"
auto-format = true
file-types = ["cmake", "cmake.in", "CMakeLists.txt"]
formatter = { command = "cmake-format", args = ["-"] }
indent = { tab-width = 2, unit = " " }
language-servers = ["cmake-language-server"]
roots = ["CMakeLists.txt", "cmake"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# CSV
[[language]]
name = "csv"
scope = "source.csv"
auto-format = false
file-types = ["csv", "tsv"]
indent = { tab-width = 2, unit = " " }
language-servers = ["rainbow_csv"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# Fish Shell
[[language]]
name = "fish"
scope = "source.fish"
auto-format = true
file-types = ["fish"]
indent = { tab-width = 2, unit = " " }
language-servers = ["fish-lsp"]
roots = ["config.fish"]
shebangs = ["#!/usr/bin/env fish"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# Go
[[language]]
name = "go"
scope = "source.go"
auto-format = true
file-types = ["go"]
formatter = { command = "gofmt" }
indent = { tab-width = 4, unit = " " }
language-servers = ["gopls"]
roots = ["go.mod", "go.sum", "go.work"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 100
# HTML
[[language]]
name = "html"
scope = "text.html.basic"
auto-format = true
file-types = ["html", "htm", "xhtml"]
formatter = { command = "prettier", args = ["--stdin-filepath", "file.html"] }
indent = { tab-width = 2, unit = " " }
language-servers = ["vscode-html-language-server"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# INI
[[language]]
name = "ini"
scope = "source.ini"
auto-format = true
file-types = ["ini", "cfg", "conf", "config", "properties"]
# formatter = { command = "prettier", args = ["--stdin-filepath", "file.ini"] }
indent = { tab-width = 2, unit = " " }
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# JavaScript/TypeScript (Node.js)
# [[language]]
# name = "typescript"
# scope = "source.ts"
# auto-format = true
# file-types = ["ts", "tsx", "js", "jsx", "mjs", "cjs"]
# formatter = { command = "prettier", args = ["--stdin-filepath", "file.ts"] }
# indent = { tab-width = 4, unit = " " }
# language-servers = ["typescript-language-server"]
# roots = ["package.json", "tsconfig.json", "jsconfig.json"]
# soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
# text-width = 80
[[language]]
name = "javascript"
scope = "source.js"
auto-format = true
file-types = ["js", "jsx", "mjs", "cjs"]
formatter = { command = "prettier", args = ["--stdin-filepath", "file.js"] }
indent = { tab-width = 4, unit = " " }
language-servers = ["typescript-language-server"]
roots = ["package.json", "jsconfig.json"]
text-width = 80
[[language]]
name = "typescript"
scope = "source.ts"
auto-format = true
file-types = ["ts", "tsx"]
formatter = { command = "prettier", args = ["--stdin-filepath", "file.ts"] }
indent = { tab-width = 4, unit = " " }
language-servers = ["typescript-language-server"]
roots = ["package.json", "tsconfig.json"]
text-width = 80
# JSON
[[language]]
name = "json"
scope = "source.json"
auto-format = true
file-types = ["json", "jsonc", "arb", "ipynb", "geojson", "gltf", "webmanifest"]
formatter = { command = "prettier", args = ["--stdin-filepath", "file.json"] }
indent = { tab-width = 2, unit = " " }
language-servers = ["vscode-json-language-server"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# YAML
[[language]]
name = "yaml"
scope = "source.yaml"
auto-format = true
file-types = ["yml", "yaml"]
formatter = { command = "prettier", args = ["--stdin-filepath", "file.yml"] }
indent = { tab-width = 2, unit = " " }
language-servers = ["yaml-language-server"]
roots = ["Chart.yaml", "helmfile.yaml", "docker-compose.yml", "kustomization.yaml"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# Lua
[[language]]
name = "lua"
scope = "source.lua"
auto-format = true
file-types = ["lua"]
formatter = { command = "stylua", args = ["--stdin-filepath", "file.lua", "--stdin"] }
indent = { tab-width = 2, unit = " " }
language-servers = ["lua-language-server"]
roots = ["init.lua", ".luarc.json"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# Makefile
[[language]]
name = "make"
scope = "source.makefile"
auto-format = true
file-types = ["makefile", "Makefile", "make", "mk", "GNUmakefile"]
indent = { tab-width = 4, unit = " " }
roots = ["Makefile", "makefile", "GNUmakefile"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# Markdown
[[language]]
name = "markdown"
scope = "text.markdown"
auto-format = true
file-types = ["md", "markdown", "mdown", "mkd", "mkdn", "mdwn", "mdtxt", "mdtext", "rmd"]
formatter = { command = "prettier", args = ["--stdin-filepath", "file.md"] }
indent = { tab-width = 2, unit = " " }
language-servers = ["marksman"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# Mermaid
[[language]]
name = "mermaid"
scope = "source.mermaid"
auto-format = true
file-types = ["mmd", "mermaid"]
indent = { tab-width = 2, unit = " " }
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# Nushell
[[language]]
name = "nu"
scope = "source.nu"
auto-format = true
file-types = ["nu"]
indent = { tab-width = 2, unit = " " }
roots = ["config.nu"]
shebangs = ["#!/usr/bin/env nu"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# Nix
[[language]]
name = "nix"
scope = "source.nix"
auto-format = true
file-types = ["nix"]
formatter = { command = "nixfmt", args = ["--stdin"] }
indent = { tab-width = 2, unit = "" }
language-servers = ["nixd"]
roots = ["flake.nix", "shell.nix", "default.nix", "nixpkgs"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# Python
[[language]]
name = "python"
scope = "source.python"
auto-format = true
file-types = ["py", "pyi", "pyc", "pyd", "pyo", "pyw", "pyz", "ipynb"]
formatter = { command = "ruff", args = ["format", "--stdin-filename", "file.py", "-"] }
indent = { tab-width = 4, unit = " " }
language-servers = ["ruff", "pyright"]
roots = ["pyproject.toml", "setup.py", "requirements.txt", "Pipfile", "poetry.lock", "uv.lock"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 88
# Protocol Buffers
[[language]]
name = "proto"
scope = "source.proto"
auto-format = true
file-types = ["proto", "protobuf"]
formatter = { command = "clang-format", args = ["--style=file"] }
indent = { tab-width = 2, unit = "" }
language-servers = ["buf-language-server"]
roots = ["buf.yaml", "buf.work.yaml", "buf.gen.yaml"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# Rust
[[language]]
name = "rust"
scope = "source.rust"
auto-format = true
file-types = ["rs"]
formatter = { command = "rustfmt", args = ["--edition", "2021"] }
indent = { tab-width = 4, unit = " " }
language-servers = ["rust-analyzer"]
roots = ["Cargo.toml", "Cargo.lock"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 100
[language-server.rust-analyzer.config]
check.command = "clippy"
# Sass/SCSS
[[language]]
name = "scss"
scope = "source.scss"
auto-format = true
file-types = ["scss", "sass"]
formatter = { command = "prettier", args = ["--stdin-filepath", "file.scss"] }
indent = { tab-width = 2, unit = " " }
language-servers = ["vscode-css-language-server"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# SQL
[[language]]
name = "sql"
scope = "source.sql"
auto-format = true
file-types = ["sql", "pgsql", "mysql"]
# formatter = { command = "sql-formatter", args = ["--language", "sql"] }
formatter = { command = "sqlfluff", args = ["format", "-"] }
indent = { tab-width = 2, unit = " " }
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# Typst
[[language]]
name = "typst"
scope = "source.typst"
auto-format = true
file-types = ["typ", "typst"]
indent = { tab-width = 4, unit = " " }
language-servers = ["tinymist"]
roots = ["typst.toml"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# TOML
[[language]]
name = "toml"
scope = "source.toml"
auto-format = true
file-types = ["toml"]
formatter = { command = "taplo", args = ["fmt", "-"] }
indent = { tab-width = 2, unit = " " }
language-servers = ["taplo"]
roots = ["Cargo.toml", "pyproject.toml", "poetry.lock"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# VHDL
[[language]]
name = "vhdl"
scope = "source.vhdl"
auto-format = true
file-types = ["vhdl", "vhd"]
formatter = { command = "vhdl-formatter", args = ["--stdin"] }
indent = { tab-width = 2, unit = " " }
language-servers = ["vhdl-ls"]
roots = ["Makefile", "Makefile.ghdl"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# Verilog
[[language]]
name = "verilog"
scope = "source.verilog"
auto-format = true
file-types = ["v", "sv", "verilog", "systemverilog"]
formatter = { command = "verilog-formatter", args = ["--stdin"] }
indent = { tab-width = 2, unit = " " }
language-servers = ["verible-ls"]
roots = ["Makefile", "Makefile.verilator"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# XML
[[language]]
name = "xml"
scope = "text.xml"
auto-format = true
file-types = ["xml", "xsd", "xsl", "xslt", "rss", "svg", "plist", "pom", "resx", "tld", "wsdl", "xul", "xaml", "axml", "csproj", "vbproj", "vcxproj", "proj", "targets", "props"]
formatter = { command = "prettier", args = ["--stdin-filepath", "file.xml"] }
indent = { tab-width = 2, unit = " " }
language-servers = ["lemminx"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
# Zig
[[language]]
name = "zig"
scope = "source.zig"
auto-format = true
file-types = ["zig", "zon"]
formatter = { command = "zig", args = ["fmt", "--stdin"] }
indent = { tab-width = 4, unit = " " }
language-servers = ["zls"]
roots = ["build.zig", "build.zig.zon"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 100
# Zsh
[[language]]
name = "zsh"
scope = "source.shell"
auto-format = true
file-types = ["zsh"]
formatter = { command = "shfmt", args = ["-i", "2", "-ci", "-sr"] }
indent = { tab-width = 2, unit = " " }
language-servers = ["bash-language-server"]
roots = [".zshrc", ".zprofile", ".zshenv"]
shebangs = ["#!/usr/bin/env zsh"]
soft-wrap = { enable = true, max-wrap = 20, max-indent-retain = 10, wrap-indicator = "" }
text-width = 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment