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