diff --git a/.stylua.toml b/.stylua.toml new file mode 100644 index 0000000..0435f67 --- /dev/null +++ b/.stylua.toml @@ -0,0 +1,2 @@ +indent_type = "Spaces" +indent_width = 2 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() diff --git a/selene.toml b/selene.toml index 6a317df..6052029 100644 --- a/selene.toml +++ b/selene.toml @@ -1,5 +1,5 @@ # https://github.com/Kampfkarren/selene/issues/284 -std="lua52+vim" +std="lua54+vim" [rules] mixed_table = "allow" diff --git a/vim.toml b/vim.toml index 0fa5c4f..13b1c0f 100644 --- a/vim.toml +++ b/vim.toml @@ -1,2 +1,55 @@ +[selene] +base = "lua54" +name = "vim" + [vim] any = true + +[[describe.args]] +type = "string" +[[describe.args]] +type = "function" + +[[it.args]] +type = "string" +[[it.args]] +type = "function" + +[[before_each.args]] +type = "function" +[[after_each.args]] +type = "function" + +[assert.is_not] +any = true + +[assert.matches] +any = true + +[assert.has_error] +any = true + +[[assert.equals.args]] +type = "any" +[[assert.equals.args]] +type = "any" +[[assert.equals.args]] +type = "any" +required = false + +[[assert.same.args]] +type = "any" +[[assert.same.args]] +type = "any" + +[[assert.truthy.args]] +type = "any" + +[[assert.falsy.args]] +type = "any" + +[[assert.spy.args]] +type = "any" + +[[assert.stub.args]] +type = "any"