SkillAgentSearch skills...

Incolla.nvim

Neovim Lua plugin to paste images from the MacOS clipboard.

Install / Use

/learn @mattdibi/Incolla.nvim
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<div align="center">

incolla.nvim

</br><a href="/LICENSE.md"> License </a>

Neovim Lua plugin to paste images from MacOS clipboard

</div>

This plugin allows for seamless clipboard image pasting inside Neovim.

It leverages AppleScript under the hood and thus require MacOS to work. Additionally this plugin requires Neovim 0.7 or higher. It makes use of Neovim only features so it will not work in Vim.

✨ Features

  • No dependencies
  • Multiple image format supported (JPG, PNG ...)
  • Easily extendible and configurable
  • Written entirely in Lua

📦 Installation

Using packer.nvim

use 'mattdibi/incolla.nvim'

🚀 Usage

Paste screenshot from clipboard

IncollaBasic

<details> <summary><b>Paste image from clipboard URL</b></summary></br>

IncollaURL

</details> <details> <summary><b>Paste image copied from the browser</b></summary></br>

IncollaBrowser

</details>

Note: the fist time you run the Incolla function you'll need to grant "System Events.app" access to the destination folder.

<div align="center">

immagine

</div>

⚙️ Configuration

Incolla.nvim doesn't require any configuration to work out-of-the box. The default configuration is the following:

defaults = {
    img_dir = "imgs",
    img_name = function()
        return os.date("IMG-%d-%m-%Y-%H-%M-%S")
    end,
    affix = "%s",
    prompt_filename = false,
}

Where:

  • img_dir: Directory where the image from clipboard will be copied to
  • img_name: Image's name on disk
  • affix: String that sandwiches the image's path and will be written in your open buffer
  • prompt_filename: If set to true, Incolla will ask the user for the image filename (i.e. overrides img_name if a filename is given).

If you want to customize the behaviour of the plugin you can look at the following section.

Example

In your Neovim configuration directory, create a new file inside the after/plugin directory with the following content:

require("incolla").setup {
    -- Default configuration for all filetype
    defaults = {
        img_dir = "imgs",
        img_name = function()
            return os.date('%Y-%m-%d-%H-%M-%S')
        end,
        affix = "%s",
        prompt_filename = false,
    },
    -- You can customize the behaviour for a filetype by creating a field named after the desired filetype
    -- If you're uncertain what to name your field to, you can run `lua print(vim.bo.filetype)`
    -- Missing options from `<filetype>` field will be replaced by the default configuration
    markdown = {
        affix = "![](%s)",
    }
}

Setting your keymap

-- This maps the paste command to <leader>xp
vim.api.nvim_set_keymap('n', '<leader>xp', '', {
    noremap = true,
    callback = function()
        require'incolla'.incolla()
    end,
})
<details> <summary><b>Vimscript</b></summary></br>
nnoremap <leader>xp :Incolla<CR>
</details>

🌟 Credits

Thanks to:

View on GitHub
GitHub Stars23
CategoryDevelopment
Updated4mo ago
Forks1

Languages

Lua

Security Score

92/100

Audited on Nov 9, 2025

No findings