Skip to content

A plugin to search for and insert emojis/kaomojis right from Neovim πŸ˜€

License

Notifications You must be signed in to change notification settings

Allaman/emoji.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

87 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

emoji.nvim πŸ˜€

Neovim Lua

CI Update-emojis size issues last commit license release

❓ Why

This plugin allows you to easily search and insert emojis and kaomojis in your current buffer.

Though there are a couple of plugins (see Similar plugins and inspiration), I decided to make a 15th plugin. πŸ˜‰

Jokes aside, I could not find a plugin that fulfills my wish for both telescope and cmp integration, so why not write a plugin myself?

πŸ’« Features

  • Automatic updates of available emojis via GitHub actions (emojisource.app as source).
  • No dependencies (relies on vim.ui.select).
  • (Optional) telescope.nvim integration (emojis only).
  • (Optional) nvim-cmp integration (emojis only).

Screenshots

emojis via vim.uiui.png

Please note that I use dressing.nvim so your UI might look different!

kaomojis via vim.uikaomojis.png

Please note that I use dressing.nvim so your UI might look different!

telescope (emojis)telescope.png

cmp (emojis)cmp.png

πŸ”§ Installation

With Lazy.nvim:

{
  "allaman/emoji.nvim",
  version = "1.0.0", -- optionally pin to a tag
  ft = "markdown", -- adjust to your needs
  dependencies = {
    -- optional for nvim-cmp integration
    "hrsh7th/nvim-cmp",
    -- optional for telescope integration
    "nvim-telescope/telescope.nvim",
  },
  opts = {
    -- default is false
    enable_cmp_integration = true,
    -- optional if your plugin installation directory
    -- is not vim.fn.stdpath("data") .. "/lazy/
    plugin_path = vim.fn.expand("$HOME/plugins/"),
  },
  config = function(_, opts)
    require("emoji").setup(opts)
    -- optional for telescope integration
    require("telescope").load_extension("emoji")
  end,
}

For nvim-cmp integration add emoji to your list of sources:

local sources = {
  { name = "nvim_lsp" },
  { name = "buffer", keyword_length = 5 },
  { name = "luasnip" },
  { name = "emoji" },
}

For telescope integration load the extension via:

require("telescope").load_extension("emoji")

πŸ’» Use

Emojis

  1. :InsertEmoji respective lua require("emoji").insert() or :InsertEmojiByGroup respective lua require("emoji").insert_by_group() allows you to select an emoji that is inserted at your cursor's current position.
  2. :Telescope emoji does the same but invokes Telescope instead of vim.ui.select. (if telescope.nvim is installed).
  3. While in insert mode typing : triggers the auto-completion of nvim-cmp. (if nvim-cmp integration is enabled and configured).

Kaomojis

  1. :InsertKaomoji respective lua require("emoji").insert_kaomoji()
  2. :InsertKaomojiByGroup respective lua require("emoji").insert_kaomoji_by_group()

You can also create key bindings to your liking.

πŸ’‘ Similar plugins and inspiration

β™₯️ Credits

Thanks to emojisource.app for providing its emoji API that is used in GitHub Actions to automatically update emojis.

Thanks to hines-r for providing kaomojis.json