Skip to content

Instantly share code, notes, and snippets.

@fmoralesc
Created January 16, 2012 13:39
Show Gist options
  • Save fmoralesc/1620920 to your computer and use it in GitHub Desktop.
Save fmoralesc/1620920 to your computer and use it in GitHub Desktop.
import nv notes to vim-pad
#/usr/bin/env python2
from sys import argv
from os import listdir
from os.path import getmtime
from shutil import copy, move
def import_nv(rename=False):
op = move if rename else copy
files_to_import = filter(lambda i: not i.isdigit(), listdir("."))
for f in files_to_import:
new_path = str(int(getmtime(f) * 1000000))
op(f, new_path)
if __name__ == "__main__":
import_nv(argv[1] == "--rename")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment