Skip to content

Commit d4535fe

Browse files
committed
feat: Add kaomoji support #6
1 parent 01a6db1 commit d4535fe

File tree

13 files changed

+2502
-118
lines changed

13 files changed

+2502
-118
lines changed

README.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
## ❓ Why
2222

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

2525
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/). 😉
2626

@@ -30,13 +30,13 @@ Jokes aside, I could not find a plugin that fulfills my wish for both telescope
3030

3131
- Automatic updates of available emojis via GitHub actions ([emojisource.app](https://emojisource.app/) as source).
3232
- No dependencies (relies on `vim.ui.select`).
33-
- (Optional) [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) integration.
34-
- (Optional) [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) integration.
33+
- (Optional) [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) integration (emojis only).
34+
- (Optional) [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) integration (emojis only).
3535

3636
## Screenshots
3737

3838
<details>
39-
<summary>vim.ui</summary
39+
<summary>emojis via vim.ui</summary
4040
4141
[![ui.png](https://s9.gifyu.com/images/SFndT.png)](https://gifyu.com/image/SFndT)
4242
@@ -45,14 +45,23 @@ Please note that I use [dressing.nvim](https://github.com/stevearc/dressing.nvim
4545
</details>
4646

4747
<details>
48-
<summary>telescope</summary
48+
<summary>kaomojis via vin.ui</summary
49+
50+
[![kaomojis.png](https://s9.gifyu.com/images/SUNSK.png)](https://gifyu.com/image/SUNSK)
51+
52+
Please note that I use [dressing.nvim](https://github.com/stevearc/dressing.nvim) so your UI might look different!
53+
54+
</details>
55+
56+
<details>
57+
<summary>telescope (emojis)</summary
4958
5059
[![telescope.png](https://s9.gifyu.com/images/SFndw.png)](https://gifyu.com/image/SFndw)
5160
5261
</details>
5362

5463
<details>
55-
<summary>cmp</summary
64+
<summary>cmp (emojis)</summary
5665
5766
[![cmp.png](https://s9.gifyu.com/images/SFnd3.png)](https://gifyu.com/image/SFnd3)
5867
@@ -102,10 +111,17 @@ require("telescope").load_extension("emoji")
102111

103112
## 💻 Use
104113

105-
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.
114+
### Emojis
115+
116+
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.
106117
2. `:Telescope emoji` does the same but invokes Telescope instead of `vim.ui.select`. (if telescope.nvim is installed).
107118
3. While in insert mode typing `:` triggers the auto-completion of nvim-cmp. (if nvim-cmp integration is enabled and configured).
108119

120+
### Kaomojis
121+
122+
1. `:InsertKaomoji` respective `lua require("emoji").insert_kaomoji()`
123+
2. `:InsertKaomojiByGroup` respective `lua require("emoji").insert_kaomoji_by_group()`
124+
109125
You can also create key bindings to your liking.
110126

111127
## 💡 Similar plugins and inspiration
@@ -120,3 +136,5 @@ You can also create key bindings to your liking.
120136
## ♥️ Credits
121137

122138
Thanks to [emojisource.app](https://emojisource.app/) for providing its emoji API that is used in GitHub Actions to automatically update emojis.
139+
140+
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)

lua/cmp_emoji/init.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
local utils = require("emoji.utils")
12
local plugin_path = require("emoji.config").options.plugin_path
3+
local emoji_path = require("emoji.config").paths.emoji
24

3-
local emojis = require("emoji.emoji").load_emojis_from_json(plugin_path .. "emoji.nvim/lua/emoji/emojis.json")
5+
-- TODO: use plenary.path
6+
local emojis = utils.load_from_json(plugin_path .. emoji_path)
47
local source = {}
58

69
source.new = function()
File renamed without changes.

0 commit comments

Comments
 (0)