Skip to content

Instantly share code, notes, and snippets.

@BtbN
Created April 14, 2019 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BtbN/29b52b2ddd8353e8e3d42d1159eff26a to your computer and use it in GitHub Desktop.
Save BtbN/29b52b2ddd8353e8e3d42d1159eff26a to your computer and use it in GitHub Desktop.
Invoke Notepad++ from within WSL
function npp() {
args=()
for v in "$@"; do
if [[ "$v" == /mnt/?/* ]]; then
args+=( "${v:5:1}:${v:6}" )
else
args+=( "$v" )
fi
done
test -z "${args[*]}" && return
powershell.exe -Command '& {Start-Process -FilePath "C:/Program Files/Notepad++/notepad++.exe" -ArgumentList $args}' "${args[@]}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment