hstr
hstr copied to clipboard
template?
On the basis of favorites
, build a model of templates
- almost the same as favorites
, but adapted to quickly insert values?
That is, one value can be inserted at once in several places of template
.
See https://github.com/knqyf263/pet
@zvezdochiot it sounds like really nice idea! Can you please elaborate it more?
- Can you please give an example for
templates
entry? - How would user add new template entry? From HSTR or by editing a file like
~/.hstr-templates
? - How exactly would use of templates look like?
- I change view to
templates
. - I choose a template (row).
- HSTR asks me to fill in a value.
- Given value is substitued in template and command is executed?
- I change view to
Please correct me if I didn't get it.
Can you please an example for templates entry?
%%mkdir dskw; for tpng in *.png; do convert -verbose -deskew 50% "$tpng" "dskw/$tpng"; done %%dskw %%png
The first character (and the number of repetitions) defines the delimiter of the pattern and parameters. Use:
%%mkdir dskw; for tpng in *.png; do convert -verbose -deskew 50% "$tpng" "dskw/$tpng"; done %%dskw %%png
dk jpg
=>
mkdir dk; for tjpg in *.jpg; do convert -verbose -deskew 50% "$tjpg" "dk/$tjpg"; done
In this case, I use the usual replacement (the simplest). Works on the principle of sed
. It is possible in another way. But here it is necessary to experiment.
Got it :+1: Thanks @zvezdochiot!