Giter Club home page Giter Club logo

prosemd-lsp's Introduction

prosemd

prosemd is an experimental proofreading and linting language server for markdown files. It aims to provide helpful and smart diagnostics when writing prose for technical or non-technical documents alike.

Under the hood, it integrates with any editor supporting the Language Server Protocol, and uses nlprule, which is based on LanguageTool, to highlight possible errors and provides suggestions on how to address them.

Note: On the roadmap for more features are other useful linting rules, related to Markdown links, formatting, and other potentially helpful features, however for now prosemd is limited to just grammar & style correction with nlprule and only supports English.

Quick Start

Setup in VSCode

If you're using VSCode, all you have to do is install the prosemd extension.

Install the extension from the VSCode Marketplace.

Manual Installation

If you're setting the language server up with your editor of choice then you'll need to either download the executable or compile it from source:

  • Download the latest release executable for your OS (Either: prosemd-lsp-linux, prosemd-lsp-windows.exe, or prosemd-lsp-macos).
  • or; install Rust and then run cargo install prosemd-lsp to compile prosemd from source.

Configuring coc.nvim

First, make sure that you install the prosemd-lsp executable.

You may add prosemd to coc.nvim's config manually in coc-settings.json opened by the :CocConfig command, like so:

{
  "languageserver": {
    "prosemd": {
      "command": "/usr/local/bin/prosemd-lsp",
      "args": ["--stdio"],
      "filetypes": ["markdown"],
      "trace.server": "verbose",
      "settings": {
        "validate": true
      }
    }
  }
}

Don't forget to swap out the binary's path at command to where you've installed the prosemd-lsp executable.

Configuring nvim-lspconfig

First, make sure that you install the prosemd-lsp executable.

You may add prosemd to Neovim's built-in language server client by adding it to nvim-lspconfig's list of language servers:

local lsp_configs = require('lspconfig/configs')

lsp_configs.prosemd = {
  default_config = {
    -- Update the path to prosemd-lsp
    cmd = { "/usr/local/bin/prosemd-lsp", "--stdio" },
    filetypes = { "markdown" },
    root_dir = function(fname)
      return lsp_util.find_git_ancestor(fname) or vim.fn.getcwd()
    end,
    settings = {},
  }
}

-- Use your attach function here
local lsp = require('lspconfig')
lsp.prosemd.setup{ on_attach = on_attach }

Don't forget to swap out the binary's path at cmd to where you've installed the prosemd-lsp executable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.