Skip to content

Commit

Permalink
find notepad++ in a better way
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebman committed Oct 27, 2024
1 parent 4dc30de commit 8a9e506
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions plugins/available/wsl-fast.plugin.bash
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,14 @@ wsl2unix() {
# TODO: these programs might live in Program Files (x86) instead
alias chrome="'/mnt/c/Program Files/Google/Chrome/Application/chrome.exe'"

# TODO: Not sure I like this pattern, but it's an interesting first pass:
NOTEPAD="/mnt/c/Program Files/Notepad++/notepad++.exe"
NOTEPAD_LEGACY="/mnt/c/Program Files (x86)/Notepad++/notepad++.exe"
if [[ -f "$NOTEPAD_LEGACY" ]] && [[ ! -f "$NOTEPAD" ]]; then
NOTEPAD="$NOTEPAD_LEGACY"
# Find notepad in several places:
if NOTEPAD=$(PATH="/mnt/c/Program Files/Notepad++:/mnt/c/Program Files (x86)/Notepad++" /bin/which notepad++.exe); then
# NB: the single-quotes on ++ aren't necessary. They merely make vim's highlighting happier (and not notepad+ +=)
alias 'notepad++'="'$NOTEPAD'"
alias notepad="'$NOTEPAD'"
alias npp="'$NOTEPAD'"
fi
# NB: the single-quotes on ++ aren't necessary. They merely make vim's highlighting happier (and not notepad+ +=)
alias 'notepad++'="'$NOTEPAD'"
alias notepad="'$NOTEPAD'"
alias npp="'$NOTEPAD'"
unset NOTEPAD
unset NOTEPAD_LEGACY

alias explorer=explorer.exe
alias wsl=wsl.exe
Expand Down

0 comments on commit 8a9e506

Please sign in to comment.