Skip to content

[FEATURE]: Add directive to disable Codebook LSP on a per-file basis #156

@Drew-Daniels

Description

@Drew-Daniels

Feature Description

Thanks for codebook! It's been a breeze to use and have really enjoyed using it so far.

Background

I came across #151 and while it similar to what I'm looking for, I am looking for a way to easily disable codebook entirely on a per-file basis without requiring updates to the codebook configuration file.

Use Case

Take my ~/.config/yazi/config.toml file - which has some words unrecognized by codebook.

Image

I can disable codebook on this file by using this configuration in my ~/.config/codebook/codebook.toml

ignore_paths = ["**/yazi/*.toml"]

However, this gets a bit tedious having to update my configuration for every file I don't want codebook to check spelling on, and I would like for an easy way to have it ignore files when it comes across some kind of disable directive.

Proposed Solution

Instead of requiring I update ~/.config/codebook/codebook.toml file to explicitly ignore every file I don't want it to run on - I would like for there to be an easy way to disable codebook on a per-file basis completely every time I open that file.

Ex.):

# codebook disable
# ... etc. ...

Alternative Solutions

No response

Examples

No response

Additional Context

I think the closest analog to this would be the shellcheck directive of disable=all

Ex.):

# shellcheck disable=all

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions