rktjmp/paperplanes.nvim

github github
utility plugin
star 14
stars
alert-circle 1
open issues
users 1
subscribers
git-branch 0
forks
CREATED

2021-08-05

UPDATED

13 days ago

packer

require('packer').startup(function()
  use 'rktjmp/paperplanes.nvim'
end)

paq

require "paq" { 
  'rktjmp/paperplanes.nvim'
}

paperplanes.nvim

paperplanes Logo

Post selections or buffers to online paste bins. Save the URL to a register, or dont.

Requirements

  • Neovim 0.5+
  • An curl executable in your $PATH

Install

Use your package manager.

Configuration & Use

Setup

-- options shown with default values
require("paperplanes").setup({
  register = "+",
  provider = "0x0.st"
})
  • register - any valid register name or false
  • provider - "0x0.st", "ix.io" or "dpaste.org"

Note: http://0x0.st seems to be the fastest responding provider.

Commands

Post selection or buffer to configured provider, sets configured register and print's the result.

  • :PP -> Post current buffer.

  • :[range]PP -> Post range.

    • Vim does not support column aware ranges when using commands. Use post_selection via a map for that behaviour.

Functions

See :h paperplanes.

Functions are provided in snake_case and kebab-case.

All functions accept a callback argument which is called with url, nil or nil, errors .

Functions to not automatically print the url or set any registers.

  • post_string(string, callback)
  • post_range(buffer, start_pos, end_pos, callback)
    • where positions can be line or [line, col]
  • post_selection(callback)
  • post_buffer(buffer, callback)

Providers

paperplanes supports the following providers, see sites for TOS and features.

To create a new provider, see :h paperplanes and fnl/paperplanes/providers/*.fnl.

paperplanes is not affiliated with any provider in any manner.