-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.bat
More file actions
36 lines (30 loc) · 1.1 KB
/
Copy pathbootstrap.bat
File metadata and controls
36 lines (30 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
@echo off
:: ============================================================
:: bootstrap.bat — Windows dotfiles setup
:: Run as Administrator (required for mklink)
:: ============================================================
:: --- Admin check ---
net session >nul 2>&1
if %errorlevel% neq 0 (
echo ERROR: This script requires Administrator privileges (for mklink).
echo Right-click Command Prompt ^> Run as Administrator, then re-run.
exit /b 1
)
echo ==^> Dotfiles bootstrap
:: --- Vim plugin: sensible ---
echo vim-sensible plugin...
if not exist "%USERPROFILE%\.vim\pack\tpope\start" mkdir "%USERPROFILE%\.vim\pack\tpope\start"
pushd "%USERPROFILE%\.vim\pack\tpope\start"
if not exist sensible (
git clone --depth=1 https://tpope.io/vim/sensible.git
) else (
cd sensible
git pull
)
popd
:: --- Symlink .vimrc ---
:: Remove any existing .vimrc (file or symlink) so mklink can recreate it
dir /a "%USERPROFILE%\.vimrc" >nul 2>&1
if not errorlevel 1 del /f /q "%USERPROFILE%\.vimrc"
mklink "%USERPROFILE%\.vimrc" "%USERPROFILE%\dotfiles\.vimrc" >nul
echo ==^> Done: .vimrc, vim-sensible