move vimrc
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user