Last active
January 12, 2022 23:11
-
-
Save rkitover/b0831d048755c7d034b0a936b2a50604 to your computer and use it in GitHub Desktop.
PowerShell installer script for nano with syntax highlighting on Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$erroractionpreference = 'stop' | |
$releases = 'https://files.lhmouse.com/nano-win/' | |
ri -r -fo ~/Downloads/nano-installer -ea ignore | |
mkdir ~/Downloads/nano-installer | out-null | |
pushd ~/Downloads/nano-installer | |
curl -sLO ($releases + ( | |
iwr -usebasicparsing $releases | % links | | |
? href -match '\.7z$' | select -last 1 | % href | |
)) | |
7z x nano*.7z | out-null | |
mkdir ~/.local/bin -ea ignore | out-null | |
cpi -fo pkg_x86_64*/bin/nano.exe ~/.local/bin | |
mkdir ~/.nano -ea ignore | out-null | |
git clone https://github.com/scopatz/nanorc *> $null | |
gci -r nanorc -i *.nanorc | cpi -dest ~/.nano | |
popd | |
("include `"" + (($env:USERPROFILE -replace '\\','/') ` | |
-replace '^[^/]+','').tolower() + ` | |
"/.nano/*.nanorc`"") >> ~/.nanorc | |
gi ~/.nanorc,~/.nano,~/.local/bin/nano.exe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment