Comments (5)
Thanks a lot bro
from telescope-cc.nvim.
for have commits like that : docs: :memo: update readme
from telescope-cc.nvim.
Hi, gitmoji is unfortunately not part of the conventional commits spec.
I'm inviting you to test other plugins which could be ok for your use case:
- https://github.com/folke/devmoji : conventional commits with emojis
- https://github.com/olacin/telescope-gitmoji.nvim : gitmoji integration with telescope (but not conventional commits)
from telescope-cc.nvim.
Thx you a lot, but gitmojis have to be in conventionnal commit but optionnaly. Thanks you for these links. Have a nice day !
from telescope-cc.nvim.
@zuygui If you still need gitmojis with conventional commits I created this keymap using both extensions: gitmoji and cc.
- Select the commit type
- Select the emoji
- Type scope (optional)
- Type commit message
local function create_conventional_commit(opts)
opts = opts or {}
local pickers = require('telescope.pickers')
local actions_state = require('telescope.actions.state')
local finders = require('telescope.finders')
local conf = require('telescope.config').values
local cc_actions = require('telescope._extensions.conventional_commits.actions')
local cc_types = require('telescope._extensions.conventional_commits.types')
local frecency = require('telescope._extensions.gitmoji.frecency')
pickers
.new(opts, {
prompt_title = 'Conventional Commits',
finder = finders.new_table({
results = cc_types,
entry_maker = function(cc_entry)
return {
value = cc_entry.value,
display = string.format('%-10s %s', cc_entry.value, cc_entry.description),
ordinal = cc_entry.value,
}
end,
}),
sorter = conf.generic_sorter(opts),
attach_mappings = function(cc_prompt_bufnr, cc_map)
actions.select_default:replace(function()
local cc_type = actions_state.get_selected_entry()
actions.close(cc_prompt_bufnr)
pickers
.new(opts, {
prompt_title = 'Gitmojis',
finder = finders.new_dynamic({
fn = function()
return frecency:get_sorted_emojis()
end,
entry_maker = function(gm_entry)
return {
value = gm_entry,
display = gm_entry.value .. ' ' .. gm_entry.description,
ordinal = gm_entry.description,
}
end,
}),
sorter = conf.generic_sorter(opts),
attach_mappings = function(gm_prompt_bufnr, gm_map)
actions.select_default:replace(function()
local gm = actions_state.get_selected_entry()
local emoji = gm.value.value
actions.close(gm_prompt_bufnr)
-- Execute gm action
frecency:record(emoji)
-- Execute cc action
local inputs = {}
vim.ui.input({ prompt = 'Is there a scope ? (optional) ' }, function(scope)
inputs['scope'] = scope
vim.ui.input({ prompt = 'Enter commit message: ' }, function(msg)
if not msg then
return
end
inputs['msg'] = emoji .. ' ' .. msg
cc_actions.commit(cc_type.value, inputs)
end)
end)
end)
return true
end,
})
:find()
end)
return true
end,
})
:find()
end
vim.keymap.set('n', 'cc', create_conventional_commit, { desc = 'Create conventional commit' })
from telescope-cc.nvim.
Related Issues (5)
- Example Screencast? HOT 1
- Fails when used with `dressing.nvim` HOT 3
- theme option not working HOT 1
- Dropdown theme! HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from telescope-cc.nvim.