Skip to content

vim-lsp-file-operations is a Neovim plugin that allows to compare currently selected text with contents of a clipboard

Notifications You must be signed in to change notification settings

antosha417/nvim-compare-with-clipboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

nvim-compare-with-clipboard

nvim-compare-with-clipboard is a Neovim plugin that allows to compare currently selected text with contents of a clipboard using null-ls as a convenient way to make it available as a code action. You can also use plain lua api.

Installation

Using packer.nvim

use 'antosha417/nvim-compare-with-clipboard',

Setup

With null-ls

local null_ls = require("null-ls")

null_ls.setup({
  sources = {
    -- your other sources
    require('compare-with-clipboard.null-ls').code_actions.compare_with_clipboard()
  },
})

This is equivalent to:

local null_ls = require("null-ls")

null_ls.setup({
  sources = {
    -- your other sources
    require('compare-with-clipboard.null-ls').code_actions.compare_with_clipboard({
      -- by default splits are horizontal
      vertical_split = false,
      -- by default compares with `+` register
      register = "+",
    })
  },
})

Plain

You can also setup this plugin without null-ls. You need to call setup function only if you want to change the defaults. Otherwise it is good to go.

require('compare-with-clipboard').setup({
  -- by default splits are horizontal
  vertical_split = false,
})

And then you can compare contents of any two registers

:lua require('compare-with-clipboard').compare_registers("a", "b")

Contributing

PRs are always welcome.

About

vim-lsp-file-operations is a Neovim plugin that allows to compare currently selected text with contents of a clipboard

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages