Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Rename user commands and replace emoji.vim with emoji.lua #26 #27

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .stylua.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
indent_type = "Spaces"
indent_width = 2
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.

2 changes: 1 addition & 1 deletion selene.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# https://github.com/Kampfkarren/selene/issues/284
std="lua52+vim"
std="lua54+vim"

[rules]
mixed_table = "allow"
53 changes: 53 additions & 0 deletions vim.toml
Original file line number Diff line number Diff line change
@@ -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"