def encrypt(plaintext, key, cipher):
    """
    Using Vignere cipher to encrypt plaintext.

    :param plaintext: plaintext to encrypt with given key and given cipher
    :param key: the key is appended until it has same length as plaintext;
                each character of the key decides which cipher to use to
                subtitute the plaintext character.
    :param cipher: from the cipher we create a map of shifted ciphers as
                   many characters the cipher contains.
    :returns: encrypted plaintext

    See: https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher

    >>> encrypt("ATTACKATDAWN", "LEMON", "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
    'LXFOPVEFRNHR'
    """
    mapping = {cipher[0]: cipher}

    counter = len(cipher)
    shifted_cipher = cipher
    while counter > 0:
        shifted_cipher = shifted_cipher[-1] + shifted_cipher[0:len(shifted_cipher) - 1]
        mapping[shifted_cipher[0]] = shifted_cipher
        counter -= 1

    plaintext_key = ""
    while len(plaintext_key) < len(plaintext):
        for character in key:
            plaintext_key += character
            if len(plaintext_key) == len(plaintext):
                break

    ciphertext = ""
    for pos, character in enumerate(plaintext):
        use_cipher = mapping[plaintext_key[pos]]
        ciphertext += use_cipher[cipher.index(character)]

    return ciphertext