• Pl chevron_right

      Thibault Martin: TIL that Git can locally ignore files

      news.movim.eu / PlanetGnome • 15 hours ago • 1 minute

    When editing markdown, I love using Helix (best editor in the world). I rely on three language servers to help me do it:

    • rumdl to check markdown syntax and enforce the rules decided by a project
    • marksman to get assistance when creating links
    • harper-ls to check for spelling or grammar mistakes

    All of these are configured in my ~/.config/helix/languages.toml configuration file, so it applies globally to all the markdown I edit. But when I edit This Week In Matrix at work, things are different.

    To edit those posts, we let our community report their progress in a Matrix room, we collect them into a markdown file that we then editorialized. This is a perfect fit for Helix (best editor in the world) and its language servers.

    Helix has two features that make it a particularly good fit for the job

    1. The diagnostics view
    2. Jumping to next error with ]d

    It is possible to filter out pickers , but it becomes tedious to do so. For this project specifically, I want to disable harper-ls entirely. Helix supports per-project configuration by creating a .helix/languages.toml file at the project's root.

    It's a good solution to override my default config, but now I have an extra .helix directory that git wants to track. I could add it to the .gitignore , but that would also add it to everyone else's .gitignore , even if they don't use Helix (best editor in the world) yet.

    It turns out that there is a local-only equivalent to .gitignore , and it's .git/info/exclude . The syntax is the same as .gitignore but it's not committed.

    I can't believe I didn't need this earlier in my life.