Ejemplo n.º 1
0
def delete_pad():  # {{{1
    """ Deletes the currently selected note in the __pad__ buffer.
    """
    confirm = vim.eval('input("really delete? (y/n): ")')
    if confirm in ("y", "Y"):
        path = get_selected_path()
        remove(path)
        make_sure_dir_is_empty(path)
        vim.command("ListPads")
        vim.command("redraw!")
Ejemplo n.º 2
0
def delete_pad():  # {{{1
    """ Deletes the currently selected note in the __pad__ buffer.
    """
    confirm = vim.eval('input("really delete? (y/n): ")')
    if confirm in ("y", "Y"):
        path = get_selected_path()
        remove(path)
        make_sure_dir_is_empty(path)
        vim.command("ListPads")
        vim.command("redraw!")
Ejemplo n.º 3
0
def move_to_folder(path=None):  # {{{1
    """ Moves the selected pad to a subfolder of g:pad_dir
    """
    selected_path = get_selected_path()
    if path is None:
        path = vim.eval('input("move to: ")')
    if not exists(join(get_save_dir(), path)):
        mkdir(join(get_save_dir(), path))
    move(selected_path, join(get_save_dir(), path, basename(selected_path)))
    make_sure_dir_is_empty(path)
    vim.command("ListPads")
    if path is None:
        vim.command("redraw!")
Ejemplo n.º 4
0
def move_to_folder(path=None):  # {{{1
    """ Moves the selected pad to a subfolder of g:pad_dir
    """
    selected_path = get_selected_path()
    if path is None:
        path = vim.eval('input("move to: ")')
    if not exists(join(get_save_dir(), path)):
        mkdir(join(get_save_dir(), path))
    move(selected_path, join(get_save_dir(), path, basename(selected_path)))
    make_sure_dir_is_empty(path)
    vim.command("ListPads")
    if path is None:
        vim.command("redraw!")