move vimrc

This commit is contained in:
2015-12-04 10:34:12 +01:00
parent d6784fbc30
commit fa4b6f0870
2 changed files with 6 additions and 5 deletions

View File

@@ -10,17 +10,18 @@ def install_vim(pdotfiles, force=False):
phome = Path(os.path.expanduser("~")).resolve() phome = Path(os.path.expanduser("~")).resolve()
phome_vimrc = phome / Path(".vimrc") phome_vimrc = phome / Path(".vimrc")
prelvimrc = Path("vim/vimrc")
try: try:
pdotfiles_vimrc = pdotfiles.resolve().relative_to(phome.resolve()) / Path(".vimrc") pdotfiles_vimrc = pdotfiles.resolve().relative_to(phome.resolve()) / prelvimrc
except ValueError: except ValueError:
pdotfiles_vimrc = pdotfiles / Path(".vimrc") pdotfiles_vimrc = pdotfiles / prelvimrc
if force and phome_vimrc.exists(): if force and phome_vimrc.is_symlink():
phome_vimrc.unlink() phome_vimrc.unlink() # only kill symlinks
if phome_vimrc.exists(): if phome_vimrc.exists():
print('.vimrc already there') print('.vimrc already there!')
else: else:
print("Symlinking {} to {}".format(phome_vimrc, pdotfiles_vimrc)) print("Symlinking {} to {}".format(phome_vimrc, pdotfiles_vimrc))
phome_vimrc.symlink_to(pdotfiles_vimrc) phome_vimrc.symlink_to(pdotfiles_vimrc)

View File