News for hackers. Stuff that matters.
Re:Ask HN: What Is Your Problem? by dr_kiszonka on Wednesday June 08, 2022 @01:34AM (#31663639)
I type the same things over and over again. I would like an offline app that would capture everything I type (emails, code, reports) and create a library of snippets -- or better yet templates -- that I could access via a shortcut or a key combo.

For example, it would automatically recognize the five different email signatures I type often and make them accessible by typing, say, ”xxsig” followed by pressing TAB to cycle through the five signatures. I would also want it to learn how I write docstrings and generate templates that I could access via another keyword.

Re:Ask HN: What Is Your Problem? by jo_beef on Wednesday June 08, 2022 @11:04AM (#31668396)
There's a program for this, https://espanso.org/ You can add some trigger words in the YAML file.

for example :

    - trigger: ":date"
      replace: "{{mydate}}"
      vars:
        - name: mydate
          type: date
          params:
            format: "%m/%d/%Y"
If I type : date (without the space) it would automatically convert it to 06/08/2022. It's pretty cool.

I also found this one https://www.autohotkey.com/ but I haven't tried it yet.

Re:Ask HN: What Is Your Problem? by rishikeshs on Wednesday June 08, 2022 @10:38AM (#31668026)
This is gold actually. I have an obsidian note where I store all my templates to serve this purpose!