Created
August 31, 2025 14:27
-
-
Save BtbN/6b6f624f41383714863e1ee9368c58c4 to your computer and use it in GitHub Desktop.
Notepad++ WSL shell function
This file contains hidden or 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
function npp() { | |
local args=() | |
for v in "$@"; do | |
local arg="$(wslpath -a -m "$v")" | |
args+=( "'\"${arg//\'/''}\"'" ) | |
done | |
[[ ${#args[@]} -gt 0 ]] || return | |
powershell.exe -Command "& {Start-Process -FilePath 'C:/Program Files/Notepad++/notepad++.exe' -ArgumentList @($(IFS=, ; printf "%s" "${args[*]}"))}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment