Skip to content

Instantly share code, notes, and snippets.

@mslinn
Last active January 16, 2022 16:52
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 mslinn/47c568e8360e6046e933821d1af030dc to your computer and use it in GitHub Desktop.
Save mslinn/47c568e8360e6046e933821d1af030dc to your computer and use it in GitHub Desktop.
Run Notepad++ From WSL
#!/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