diff --git a/README.md b/README.md index ab7e50f..c69d011 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/plugin/emoji.lua b/plugin/emoji.lua new file mode 100644 index 0000000..1dce29f --- /dev/null +++ b/plugin/emoji.lua @@ -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, +}) diff --git a/plugin/emoji.vim b/plugin/emoji.vim deleted file mode 100644 index 3704cd8..0000000 --- a/plugin/emoji.vim +++ /dev/null @@ -1,18 +0,0 @@ -" Title: emoji.nvim -" Description: A plugin that gives you emojis -" Last Change: 23 February 2024 -" Maintainer: Michael - -" Prevents the plugin from being loaded multiple times. If the loaded -" variable exists, do nothing more. Otherwise, assign the loaded -" variable and continue running this instance of the plugin. -if exists("g:loaded_emoji") - finish -endif -let g:loaded_emoji = 1 - -" Exposes the plugin's functions for use as commands in Neovim. -command! -nargs=0 InsertEmoji lua require("emoji").insert() -command! -nargs=0 InsertEmojiByGroup lua require("emoji").insert_by_group() -command! -nargs=0 InsertKaomoji lua require("emoji").insert_kaomoji() -command! -nargs=0 InsertKaomojiByGroup lua require("emoji").insert_kaomoji_by_group()