Skip to content

Feature request: dependency inject *_ltex.json path function (ltex_filename()) #10

@mawkler

Description

@mawkler

First of all, thanks for this awesome plugin!

I would like to extend it to put all *_ltex.json files in the same directory, like how :help 'undodir' works by putting all your undo files in $XDG_STATE_HOME/nvim/undo// with the file path separators replaced with %. That way I don't litter my working directories with a bunch of json files whenever I edit a Markdown file.

I think I could achieve this if I could override ltex_filename() from my user configuration, which currently isn't possible. We could therefore add a configuration option like file_settings.path or something similar which is a function:

opts = {
  file_settings = {
    path = function(current_file)
      -- returns path to settings file associated with `current_file`
    end
  }
}

This function would get set to ltex_filename() by default.

What do you say? I could try to create a PR if you agree with this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions