add_to_bottom_of_starting_script.py (Source)

# Completer, available to be imported in starting script
def create_my_file_list(self, event):
    my_files_list = ["c:/aaa", "c:/bbb", "c:/ccc"]
    return my_files_list


ip = get_ipython()  # Here we get access to IPython
ip.set_hook('complete_command', create_my_file_list, re_key='.*mymagic')

from IPython.core.magic import register_line_magic
@register_line_magic
def mymagic_some_functionallity(file_name):
    print "they asked me to print", file_name