My nano-win
configuration on Powershell
Please replace <name>
with your username.
-
Download an archive and extract it
-
Add below code to
$profile
:
function LaunchNano {
"Microsoft.PowerShell.Core\FileSystem::C:\Users\${env:USERNAME}\nano\nano.exe ${args}" | invoke-expression
}
Set-Alias -Name nano -Value LaunchNano
-
Move
nano-win\bin\nano.exe
intoC:\Users\<name>\nano\
-
Move
nano-win\share\nano\*.nanorc
intoC:\Users\<name>\nanorc\
-
Add below code to
C:\Users\<name>\.nanorc
:
include "C:/Users/<name>/nanorc/*.nanorc"
set autoindent
set constantshow
set linenumbers
set tabsize 4
# Color
set titlecolor white,red
set numbercolor white,blue
set selectedcolor white,green
set statuscolor white,green
- To highlight more language codes, copy
*.nanorc
fromscopatz/nanorcserialhex/nano-highlight toC:\Users\<name>\nanorc\
cd
mkdir -Path nano-win,nano,nanorc
cd nano-win
$targetHost = "https://files.lhmouse.com/nano-win/"
$content = (Invoke-WebRequest $targetHost).Content.Split([Environment]::NewLine) | Select-String 'nano-win' -List -SimpleMatch | Select-Object -First 1
$targetUrl = $content.ToString() | ForEach-Object { $targetHost + $_.split('"')[3] }
Invoke-WebRequest $targetUrl -OutFile nano-win.7z
tar.exe -xf .\nano-win.7z -v
mv .\pkg_x86_64-w64-mingw32\bin\nano.exe ~\nano
mv .\pkg_x86_64-w64-mingw32\share\nano\*.nanorc ~\nanorc
@'
include "~/nanorc/*.nanorc"
set autoindent
set constantshow
set linenumbers
set tabsize 4
# Color
set titlecolor white,red
set numbercolor white,blue
set selectedcolor white,green
set statuscolor white,green
'@ | Out-File -FilePath ~\.nanorc