Skip to content

Commit

Permalink
feat!: Rename user commands and replace emoji.vim with emoji.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
Allaman committed Nov 1, 2024
1 parent 6b19e83 commit 7064ae1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 21 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ require("telescope").load_extension("emoji")

### 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.
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. `:InsertKaomoji` respective `lua require("emoji").insert_kaomoji()`
2. `:InsertKaomojiByGroup` respective `lua require("emoji").insert_kaomoji_by_group()`
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.

Expand Down
27 changes: 27 additions & 0 deletions plugin/emoji.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
vim.api.nvim_create_user_command("EmojiInsert", function()
require("emoji").insert()
end, {
desc = "Insert an Emoji at the cursor's current position",
nargs = 0,
})

vim.api.nvim_create_user_command("EmojiInsertByGroup", function()
require("emoji").insert_by_group()
end, {
desc = "Insert an Emoji, filtered by group, at the cursor's current position",
nargs = 0,
})

vim.api.nvim_create_user_command("KaomojiInsert", function()
require("emoji").insert_kaomoji()
end, {
desc = "Insert a Kaomoji at the cursor's current position",
nargs = 0,
})

vim.api.nvim_create_user_command("KaomojiInsertByGroup", function()
require("emoji").insert_kaomoji_by_group()
end, {
desc = "Insert an Kaomoji, filtered by group, at the cursor's current position",
nargs = 0,
})
18 changes: 0 additions & 18 deletions plugin/emoji.vim

This file was deleted.

0 comments on commit 7064ae1

Please sign in to comment.