Last active
January 16, 2022 16:52
-
-
Save mslinn/47c568e8360e6046e933821d1af030dc to your computer and use it in GitHub Desktop.
Run Notepad++ From WSL
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
#!/bin/bash | |
if [ $# != 1 ]; then | |
echo "Usage: $(basename $0) filename" | |
echo " If filename is not found in the current directory then subdirectories are searched" | |
echo " The file is then edited in Notepad++" | |
echo "Assumes 64-bit version of Notepad++ is installed in the default location." | |
exit -1 | |
fi | |
if [ -f "$1" ]; then | |
FN="$( wslpath -w $1 )" | |
else | |
FN="$(find . -wholename $1)" | |
fi | |
NOTEPAD="$( wslpath 'C:\Program Files\Notepad++\notepad++.exe' )" | |
"$NOTEPAD" "$FN" > /dev/null 2>&1 & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment