update
This commit is contained in:
35 files changed
+1155
-1236
No files matched your search
@@ -165,4 +165,3 @@ return {
|
||||
Windows = ' ',
|
||||
},
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
local prompts = {
|
||||
docs = 'Generate comprehensive documentation for this code including parameters, return values, and usage examples.',
|
||||
explain = 'Explain this code in detail, including its purpose, logic flow, and any algorithms used.',
|
||||
fix = 'Identify and fix any bugs, errors, or code smells in this code.',
|
||||
commit = 'Create a descriptive commit message following conventional commits format for these changes.',
|
||||
optimize = 'Optimize this code for better performance, readability, and maintainability.',
|
||||
review = 'Review this code for best practices, potential issues, and suggest improvements.',
|
||||
tests = 'Write comprehensive unit tests covering all edge cases for this code.',
|
||||
}
|
||||
|
||||
---Returns a function that inserts the named prompt at cursor position
|
||||
---@param prompt_name string Name of the prompt to insert
|
||||
---@return function Function to execute in a keybinding
|
||||
prompts.add_prompt = function(prompt_name)
|
||||
local prompt_text = prompts[prompt_name]
|
||||
return function()
|
||||
vim.cmd("put ='" .. prompt_text:gsub("'", "''") .. "'")
|
||||
end
|
||||
end
|
||||
|
||||
return prompts
|
||||
@@ -62,20 +62,4 @@ util.is_present = function(bin)
|
||||
return vim.fn.executable(bin) == 1
|
||||
end
|
||||
|
||||
util.telescope_select = function(options, options_desc, select_prompt)
|
||||
require('telescope.pickers')
|
||||
.new({}, {
|
||||
prompt_title = select_prompt,
|
||||
results_title = options_desc,
|
||||
finder = require('telescope.finders').new_table({
|
||||
results = options,
|
||||
entry_maker = require('telescope.make_entry').gen_from_file(),
|
||||
}),
|
||||
sorter = require('telescope.sorters').get_fzy_sorter(),
|
||||
previewer = require('telescope.previewers').vim_buffer_cat.new({}),
|
||||
})
|
||||
:find()
|
||||
end
|
||||
|
||||
return util
|
||||
|
||||
Reference in new issue
Block a user