bew / dotfiles

All my dotfiles in one place!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ways to easily insert a dash-separated-text-argument

bew opened this issue · comments

Similar to:

# Give a prompt where I can paste or write some text, it will then be single
# quoted (with escapes if needed) and inserted as a single argument.
function zwidget::insert_one_arg

I want to have a prompt where I write Hello this is some text and have it inserted as Hello-this-is-some-text.
WHY: This is useful for git branch names :)

And a similar one for underscores Hello_this_is_some_text

And what about a way to switch between them?
Like: move cursor in an argument, then do something and be prompted to a before/after separator, so: <binding>-_ to switch from - (dash) separators to _ (underscore) separators. ❤️


The first part could be implemented in the insert_one_arg sub prompt, with a modified keymap! (I usually don't use all my bindings there, I only write some text)