Skip to content
Karl Yngve Lervåg edited this page Feb 9, 2022 · 2 revisions

Quickly adding cards

@lervag (author of apy): This is my own workflow for quickly adding cards with apy + Vim.

I use a set of personalized "snippets" or mappings that I use to easily convert lists of questions and answers into proper markdown.

Example workflow

One example of the workflow is something like this:

  1. vim notes.md

  2. Write a list of new questions/answers, e.g.

    topic
    Q: question1
    continued lines (no blank lines)
    A: answer1
    Q: question2
    A: answer2
    long answer (no blank lines)
    Q: ...
    A: ...
    
  3. With Vim cursor inside the above block of text, I type <space>aa to convert the notes. This executes the CreateNotes() function (see link above), with the result:

    # Note
    model: Basic
    tags: topic
    
    ## Front
    **topic**
    
    question1
    continued lines (no blank lines)
    
    ## Back
    answer1
    
    # Note
    model: Basic
    tags: topic
    
    ## Front
    **topic**
    
    question2
    
    ## Back
    answer2
    long answer (no blank lines)
    
    # Note
    model: Basic
    tags: topic
    
    ## Front
    **topic**
    
    ...
    
    ## Back
    ...
  4. Now I save the file and do apy add-from-file notes.md. Done.

In practise, I use Vim also to take notes in general. I have my Vim based notes available with a simple shortcut, and so it is always easy to add a note whenever I work on something or read something. I tend to add questions and answers in a similar format as specified above to my Vim based notes, and then with regular intervals I convert them and add them to Anki.

Clone this wiki locally