A Telescope integration of gitmoji.
-- lazy { "olacin/telescope-gitmoji.nvim", config = function() require("telescope").load_extension("gitmoji") end, dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" } } -- vim-plug Plug 'olacin/telescope-gitmoji.nvim' -- packer use 'olacin/telescope-gitmoji.nvim'
# As a command
:Telescope gitmoji
# As a lua function
require('telescope').extensions.gitmoji.gitmoji()
You can customize action on selection within Telescope setup()
function.
telescope.setup({ ... extensions = { gitmoji = { action = function(entry) -- entry = { -- display = "🐛 Fix a bug.", -- index = 4, -- ordinal = "Fix a bug.", -- value = { -- description = "Fix a bug.", -- text = ":bug:", -- value = "🐛" -- } -- } local emoji = entry.value.value vim.ui.input({ prompt = "Enter commit message: " .. emoji .. " "}, function(msg) if not msg then return end -- Insert text instead of emoji in message local emoji_text = entry.value.text vim.cmd(':G commit -m "' .. emoji_text .. ' ' .. msg .. '"') end) end, }, }, }) telescope.load_extension("gitmoji")
-- Default action (here with tpope vim-fugitive) gm_actions.commit = function(entry) local emoji = entry.value.value vim.ui.input({ prompt = "Enter commit message: " .. emoji .. " " }, function(msg) if not msg then return end local git_tool = ":!git" if vim.g.loaded_fugitive then git_tool = ":G" end vim.cmd(string.format('%s commit -m "%s %s"', git_tool, emoji, msg)) end) end
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4