Giter Site home page Giter Site logo

paysancorrezien / ltex_extra.nvim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from barreiroleo/ltex_extra.nvim

0.0 0.0 0.0 2.47 MB

Provides external LTeX file handling (off-spec lsp) and other functions.

License: GNU General Public License v3.0

Lua 96.13% TeX 3.87%

ltex_extra.nvim's Introduction

LTeX_extra.nvim

Provides external LTeX file handling (off-spec lsp) and other functions.
๐Ÿšง This plugin is on development, expect some changes
Developed on Nvim v0.9, tested on v0.10

Lua Work In Progress Neovim

LTeX_extra is a plugin for Neovim that provide the functions that are called on LSP code actions by ltex-ls: addToDictionary, disableRule, hideFalsePositive. Also, LTeX_extra provide extra features.

Table of Contents

Features

Cover your eyes. In the next demos there are many orthographic horrors. Screencast recorded using my macros tool.

Code Actions

Provide functions for add to dictionary, disable rules and hidde false positives.
Maybe you want mapping the LPS Code Action method. Check the docs: neovim suggested configuration

01-CodeAction.mp4

Custom export path

Config you path, give you compatibility with official vscode extension.

02-CustomPath.mp4

Autoload exported data

Autoload exported data for required languages.

03-Autoload.mp4

Update on demand

Reload exported data on demand: require("ltex_extra").reload()

04-Update.mp4

Installation

This plugin requires an instance of ltex_ls language server available to attach. ltex-ls is available at mason.nvim.

Install the plugin with your favorite plugin manager using {"barreiroleo/ltex-extra.nvim"}. Then add require("ltex_extra").setup() to your config in a proper place.

We suggest to you two ways:

  • Call the setup from on_attach function of your server. Example with lspconfig, minor changes are required for mason handler:

    require("lspconfig").ltex.setup {
        capabilities = your_capabilities,
        on_attach = function(client, bufnr)
            -- rest of your on_attach process.
            require("ltex_extra").setup { your_opts }
        end,
        settings = {
            ltex = { your settings }
        }
    }
  • Use the handler which ltex_extra provide to call the server. Example of use with lazy.nvim:

    return {
        "barreiroleo/ltex_extra.nvim",
        ft = { "markdown", "tex" },
        dependencies = { "neovim/nvim-lspconfig" },
        -- yes, you can use the opts field, just I'm showing the setup explicitly
        config = function()
            require("ltex_extra").setup {
                your_ltex_extra_opts,
                server_opts = {
                    capabilities = your_capabilities,
                    on_attach = function(client, bufnr)
                        -- your on_attach process
                    end,
                    settings = {
                        ltex = { your settings }
                    }
                },
            }
        end
    }

Configuration

Here are the settings available on ltex_extra. You don't need explicit define each one, just modify what you need.

Notes: You can pass to set up only the arguments that you are interested in. At the moment, if you define stuff in dictionary, disabledRules and hiddenFalsePositives in your ltex settings, they haven't backup.

require("ltex_extra").setup {
    -- table <string> : languages for witch dictionaries will be loaded, e.g. { "es-AR", "en-US" }
    -- https://valentjn.github.io/ltex/supported-languages.html#natural-languages
    load_langs = {}, -- en-US as default
    -- boolean : whether to load dictionaries on startup
    init_check = true,
    -- string : relative or absolute path to store dictionaries
    -- e.g. subfolder in the project root or the current working directory: ".ltex"
    -- e.g. shared files for all projects:  vim.fn.expand("~") .. "/.local/share/ltex"
    path = "", -- project root or current working directory
    -- string : "none", "trace", "debug", "info", "warn", "error", "fatal"
    log_level = "none",
    -- table : configurations of the ltex language server.
    -- Only if you are calling the server from ltex_extra
    server_opts = nil
}

Contributors

Thanks to these people for your time, effort and ideas.

Issues

  • Lspsaga:

    Some users reported an issue with code actions when called from lspsaga. I'm not using lspsaga, so PR are very welcome.

    Screen.Recording.2022-11-13.at.12.49.54.mov

    Thanks to @felipejoribeiro for the screenrecording

ltex_extra.nvim's People

Contributors

barreiroleo avatar fhfuih avatar jmanch avatar fymyte avatar nawordar avatar dbucher97 avatar iljo avatar moreka avatar chomosuke avatar jkub6 avatar

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.