Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/allaman/emoji.nvim

A plugin to search for and insert emojis/kaomojis right from Neovim 😀
https://github.com/allaman/emoji.nvim

emoji kaomoji lua neovim nvim-cmp plugin telescope

Last synced: 5 days ago
JSON representation

A plugin to search for and insert emojis/kaomojis right from Neovim 😀

Awesome Lists containing this project

README

        

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](#similar-plugins-and-inspiration)), I decided to make a [15th plugin](https://xkcd.com/927/). 😉

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 ([emojis-api.com](https://emoji-api.com/) as source).
- No dependencies (relies on `vim.ui.select`).
- (Optional) [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) integration (emojis only).
- (Optional) [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) integration (emojis only).

## 🖼️ Screenshots

emojis via vim.ui

kaomojis via vim.ui

telescope (emojis)

cmp (emojis)

## 🔧 Installation

With [Lazy.nvim](https://github.com/folke/lazy.nvim):

```lua
{
"allaman/emoji.nvim",
version = "1.0.0", -- optionally pin to a tag
ft = "markdown", -- adjust to your needs
dependencies = {
-- util for handling paths
"nvim-lua/plenary.nvim",
-- 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
local ts = require('telescope').load_extension 'emoji'
vim.keymap.set('n', 'se', ts.emoji, { desc = '[S]earch [E]moji' })
end,
}
```

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

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

For telescope integration load the extension via:

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

## 💻 Use

### Emojis

1. `:EmojiInsert` respective `lua require("emoji").insert()` or `:EmojiInsertByGroup` 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. `:KaomojiInsert` respective `lua require("emoji").insert_kaomoji()`
2. `:KaomojiInsertByGroup` respective `lua require("emoji").insert_kaomoji_by_group()`

You can also create key bindings to your liking.

## 💡 Similar plugins and inspiration

- [cmp-emoji](https://github.com/hrsh7th/cmp-emoji)
- [nerdy.nvim](https://github.com/2KAbhishek/nerdy.nvim)
- [nerdicons.nvim](https://github.com/nvimdev/nerdicons.nvim)
- [telescope-emoji](https://github.com/xiyaowong/telescope-emoji.nvim)
- [emoji_picker-nvim](https://github.com/WilsonOh/emoji_picker-nvim)
- [telescope-symbols](https://github.com/nvim-telescope/telescope-symbols.nvim)

## ♥️ Credits

Thanks to ([emojis-api.com](https://emoji-api.com/) for providing its emoji API that is used in GitHub Actions to automatically update emojis.

Thanks to [hines-r](https://github.com/hines-r) for providing [kaomojis.json](https://github.com/hines-r/kaomoji-api/blob/master/src/kaomoji.json)