如何通过别名从 Cygwin 命令行启动 Notepad++?

如何通过别名从 Cygwin 命令行启动 Notepad++?

这就是我尝试过的。

$ alias n++='(cd `dirname $1`; "/cygdrive/c/Program Files (x86)/Notepad++/notepad++.exe" `basename $1`)'
alias n++='(cd `dirname $1`; "/cygdrive/c/Program Files (x86)/Notepad++/notepad++.exe" `basename $1`)'
history -a;

$ n++ /etc/httpd/conf/httpd.conf
n++ /etc/httpd/conf/httpd.conf
-bash: syntax error near unexpected token `/etc/httpd/conf/httpd.conf'
history -a;

答案1

notepadplusplus() {
    cd `dirname $1`
    "/cygdrive/c/Program Files (x86)/Notepad++/notepad++.exe" `basename $1`
    cd -
}
alias n++=notepadplusplus

相关内容