brymer-meneses / grammar-guard.nvim

Grammar Guard is a Neovim plugin that checks your grammar as you write your LaTeX, Markdown or plain text document.
Apache License 2.0
154 stars 6 forks source link
grammar-checker languagetool-server ltex lua neovim plugin
  _____                                _____                 __
 / ___/______ ___ _  __ _  ___ _____  / ___/_ _____ ________/ /
/ (_ / __/ _ `/  ' \/  ' \/ _ `/ __/ / (_ / // / _ `/ __/ _  / 
\___/_/  \_,_/_/_/_/_/_/_/\_,_/_/    \___/\_,_/\_,_/_/  \_,_/  

🚧 Status

This plugin is archived. It was created when there wasn't an easy way to install the ltex language server, prefer using mason.nvim instead.

ℹ️ Introduction

Grammar Guard is a Neovim plugin that uses ltex-ls to check your grammar.

It uses the built-in Neovim LSP to provide feedback while you're writing your LATEX or Markdown Documents.

Demo

🌟 Features

⚡️ Requirements

📦 Installation

Install via your favorite package manager:

To install grammar-guard.nvim you need to install it with your preferred neovim package manager.

packer.nvim

use {
    "brymer-meneses/grammar-guard.nvim",
    requires = {
        "neovim/nvim-lspconfig",
        "williamboman/nvim-lsp-installer"
    }
}

Run :GrammarInstall or with nvim-lsp-installer :LspInstall ltex

Run :LspInstallInfo for more information about installed servers.

⚙️ Setup

Integrate the following to your neovim configuration:

-- hook to nvim-lspconfig
require("grammar-guard").init()

After that, you should tune the LSP configuration to your liking.

Example Configuration:

-- setup LSP config
require("lspconfig").grammar_guard.setup({
  cmd = { '/path/to/ltex-ls' }, -- add this if you install ltex-ls yourself
    settings = {
        ltex = {
            enabled = { "latex", "tex", "bib", "markdown" },
            language = "en",
            diagnosticSeverity = "information",
            setenceCacheSize = 2000,
            additionalRules = {
                enablePickyRules = true,
                motherTongue = "en",
            },
            trace = { server = "verbose" },
            dictionary = {},
            disabledRules = {},
            hiddenFalsePositives = {},
        },
    },
})

Disclaimer:

This plugin is largely based on the following pull request.