From b5c16da8700bcc48b617fe0459c1c0402a9a9598 Mon Sep 17 00:00:00 2001 From: Nachuan Tang Date: Wed, 26 Oct 2022 00:51:14 -0400 Subject: [PATCH] . --- install.py | 16 +++++++++++++--- windows.tips | 4 ++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/install.py b/install.py index e1c5476..689f810 100644 --- a/install.py +++ b/install.py @@ -2,13 +2,13 @@ """ import subprocess import os -import urllib +import urllib.request from os.path import expanduser, join from shutil import which home = expanduser("~") -app_name = 'dotfile' +app_name = 'dotfiles' APP_PATH = join(home, '.' + app_name) REPO_URL = 'https://github.com/Donaldttt/' + app_name REPO_BRANCH = 'dev' @@ -48,7 +48,11 @@ def sync_repo(repo_path, repo_url, repo_branch, repo_name): execute(cmd, cwd=APP_PATH) def setup_vimplug(): - urllib.URLopener().retrieve("https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim", VIM_RTPATH + "\\autoload\\plug.vim") + + vimplug_path = VIM_RTPATH + "\\autoload\\plug.vim" + if not os.path.isdir(os.path.dirname(vimplug_path)): + os.makedirs(os.path.dirname(vimplug_path)) + urllib.request.urlretrieve("https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim", vimplug_path) print("Please execute :PlugInstall in vim") def setup_nvim(): @@ -68,7 +72,13 @@ def setup_vim(): fatal_error('Error: vim or nvim has to be installed.') program_must_exist('git') sync_repo(APP_PATH, REPO_URL, REPO_BRANCH, app_name) + path = join(home, '.vimrc') + if os.path.exists(path): + os.remove(path) os.symlink(join(APP_PATH, '.vimrc'), join(home, '.vimrc')) + path = join(home, '.vimrc.bundles') + if os.path.exists(path): + os.remove(path) os.symlink(join(APP_PATH, '.vimrc.bundles'), join(home, '.vimrc.bundles')) setup_nvim() setup_vimplug() diff --git a/windows.tips b/windows.tips index dedd8bb..159c827 100644 --- a/windows.tips +++ b/windows.tips @@ -1,6 +1,10 @@ # Windows Tips +## Install vim + +Probably need to install bulid tool through scoop(like gcc) + Config powershell as emac style put this line into powershell's config file(which is in $profile)