ChrisTitusTech / powershell-profile

Pretty PowerShell that looks good and functions almost as good as Linux terminal
551 stars 320 forks source link

issue with $Editor #37

Open BourbonCrow opened 8 months ago

BourbonCrow commented 8 months ago

notepad needs to be at bottom else if its in the middle since we all have notepad it will just get stuck there and set $EDITOR to notepad and it wont check the once below (i had that issue with original code when notepad was above sublime text.

# Aliases
#
# If your favorite editor is not here, add an elseif and ensure that the directory it is installed in exists in your $env:Path
#
if (Test-CommandExists nvim) {
    $EDITOR='nvim'
} elseif (Test-CommandExists pvim) {
    $EDITOR='pvim'
} elseif (Test-CommandExists vim) {
    $EDITOR='vim'
} elseif (Test-CommandExists vi) {
    $EDITOR='vi'
} elseif (Test-CommandExists code) {
    $EDITOR='code'
}  elseif (Test-CommandExists notepad++) {
    $EDITOR='notepad++'
} elseif (Test-CommandExists sublime_text) {
    $EDITOR='sublime_text'
} elseif (Test-CommandExists notepad) {
    $EDITOR='notepad'
}