feat: new 'tasks' utils
This commit is contained in:
1 parent
164b13f9f0
commit
2160370d41
5 files changed
+99
-1
No files matched your search
@@ -80,6 +80,55 @@ map("n", "<leader>gs", function()
|
||||
Snacks.lazygit({ args = { "status" } })
|
||||
end, { desc = "Lazygit Log (cwd)" })
|
||||
|
||||
-- developer custom utils
|
||||
|
||||
map("n", "<leader>cu", function()
|
||||
local pickers = require("telescope.pickers")
|
||||
local finders = require("telescope.finders")
|
||||
local conf = require("telescope.config").values
|
||||
|
||||
local actions = require("telescope.actions")
|
||||
local action_state = require("telescope.actions.state")
|
||||
|
||||
local opts = {
|
||||
layout_config = {
|
||||
width = 0.3,
|
||||
height = 0.3,
|
||||
}
|
||||
}
|
||||
|
||||
local utils = { "Conventional commit", "Colorizer", "Code templates" }
|
||||
local commands = { "bash ~/.config/nvim/tasks/commit-builder.sh", "~/.config/utils/colorizer",
|
||||
"~/.config/utils/code_templates" }
|
||||
|
||||
pickers
|
||||
.new(opts, {
|
||||
prompt_title = "External Utils",
|
||||
finder = finders.new_table({
|
||||
results = utils,
|
||||
}),
|
||||
sorter = conf.generic_sorter(opts),
|
||||
attach_mappings = function(prompt_bufnr)
|
||||
actions.select_default:replace(function()
|
||||
actions.close(prompt_bufnr)
|
||||
local selection = action_state.get_selected_entry()
|
||||
|
||||
local index = {}
|
||||
for k, v in pairs(utils) do
|
||||
index[v] = k
|
||||
end
|
||||
local pos = index[selection[1]]
|
||||
|
||||
Snacks.terminal.toggle(
|
||||
string.format("clear && %s && echo 'Finished | Enter to exit' && read", commands[pos]),
|
||||
{ interactive = true, win = { height = 0.4, width = 0.4, position = "bottom" } })
|
||||
end)
|
||||
return true
|
||||
end,
|
||||
})
|
||||
:find()
|
||||
end, { desc = "Deploy developer tools selector" })
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- Neotree
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ local config = {
|
||||
notify = { enabled = true },
|
||||
quickfile = { enabled = false },
|
||||
scope = { enabled = true },
|
||||
terminal = { enabled = false },
|
||||
terminal = { enabled = true },
|
||||
scroll = { enabled = true },
|
||||
statuscolumn = { enabled = true },
|
||||
words = { enabled = true },
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
feat | New feature
|
||||
fix | A bug fix
|
||||
chore | Unavoidable task not related
|
||||
build | Changes to the build system or external dependencies
|
||||
ci | Changes to our CI configuration
|
||||
docs | Documentation only changes
|
||||
style | Changes to white-space, formatting, missing semi-colons, etc.
|
||||
refactor | A code change that neither fixes a bug nor adds a feature
|
||||
perf | A code change that improves performance
|
||||
test | Adding or correcting tests
|
||||
@@ -0,0 +1,27 @@
|
||||
:broom: │ 🧹 │ clean, cleanup, remove
|
||||
:recycle: │ ♻️ │ recycle, actor
|
||||
:wrench: │ 🔧 │ adjustment, rection, adapter
|
||||
:gear: │ ⚙️ │ adjustment
|
||||
:control_knobs: │ 🎛 │ config, adjustment
|
||||
:bug: │ 🐛 │ bug
|
||||
:zap: │ ⚡️ │ speeded
|
||||
:bar_chart: │ 📊 │ analytics, chart
|
||||
:chart_with_upwards_trend: │ 📈 │ analytics, chart, upwards
|
||||
:package: │ 📦 │ package, wrap, ture
|
||||
:fire: │ 🔥 │ fire, fix
|
||||
:sparkles: │ ✨ │ new, feature
|
||||
:nail_care: │ 💅 │ styles, prettify
|
||||
:art: │ 🎨 │ styles, colors
|
||||
:lipstick: │ 💄 │ styles, prettify
|
||||
:white_check_mark: │ ✅ │ check, done
|
||||
:test_tube: │ 🧪 │ test, testing
|
||||
:pencil: │ 📝 │ docs
|
||||
:warning: │ ⚠️ │ warning
|
||||
:no_entry_sign: │ 🚫 │ cancel
|
||||
:rotating_light: │ 🚨 │ alert, ect
|
||||
:mag_right: │ 🔎 │ search
|
||||
:old_key: │ 🗝 │ dentials
|
||||
:rocket: │ 🚀 │ shipping
|
||||
:stopwatch: │ ⏱ │ speed, performance
|
||||
:wheelchair: │ ♿️ │ accessibility, a11y
|
||||
:globe_with_meridians: │ 🌐 │ intl, i18n, i10n, tradus, lang
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
type="$(cat ~/.config/nvim/tasks/assets/conventional_commits_types.txt | fzf | awk -F' ' '{print $1 ": "}')"
|
||||
emoji="$(cat ~/.config/nvim/tasks/assets/emoji_list.txt | fzf | awk -F' ' '{print $3 " "}')"
|
||||
branch="$(git branch --show-current | awk -F'/' '{if ($2) print " [" $2 "] "}')"
|
||||
|
||||
message="$type$branch$emoji"
|
||||
|
||||
echo -n "$message"
|
||||
read body
|
||||
|
||||
git commit -m "$message$body"
|
||||
Reference in new issue
Block a user