5
5
# otherwise I source this from .profile or .zshrc/.kshrc
6
6
# (but only for interactive shells -- this should not be run for noninteractive shells)
7
7
8
-
9
8
# set for debugging:
10
9
# set -v
11
10
# set -x
@@ -200,47 +199,39 @@ setpath_simplex_msys_emacs() {
200
199
PATH=/FOR_MSYS:/bin:/usr/bin:/sbin:/mingw/bin:/c/Users/garyo/bin
201
200
}
202
201
203
- setpath_tower1_msys () {
204
- path_prepend " /bin"
205
- path_prepend " /c/Program Files/git/bin"
206
- path_prepend " /c/Program Files/git LFS"
207
- path_prepend /msys64
208
- path_prepend /c/Windows/System32/OpenSSH # for ssh-add etc.
209
- path_prepend " /c/Program Files/nodejs"
210
- # path_prepend /mingw64/bin # git lfs is here, but I copied it to c:/bin
211
- # path_prepend /c/emacs/emacs/bin # emacsclient
212
- path_prepend /c/ProgramData/chocolatey/bin # runemacs/emacs, putty etc.
213
- path_prepend " /c/Program Files/GnuGlobal/bin"
214
- path_prepend /c/bin always # ffmpeg etc.
215
- # path_prepend "/c/Users/garyo/Anaconda3" # Anaconda python
216
- path_prepend " /c/Python37" # Standard python, but see pyenv below
217
- path_prepend " /c/Python37/Scripts" # pip
218
- path_append " /c/Program Files/Cppcheck" # cppcheck, useful utility
219
- # dumpbin.exe:
220
- path_append " /c/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.12.25827/bin/Hostx64/x64"
221
- }
222
-
223
202
setpath_windows () {
224
- path_prepend " /c/Python36"
225
- path_prepend " /c/Python36/Scripts"
226
- path_prepend " /Python37"
227
- path_prepend " /Python37/Scripts"
228
203
# path_prepend /bin
229
204
path_prepend /msys64
230
205
path_prepend /usr/bin # for msys2 bash/zsh
231
206
path_prepend /mingw64/bin # mingw compiler etc., from msys shell
232
207
case $OSTYPE in
233
- cygwin* ) # msys2 comes with git
208
+ cygwin* ) # msys2 comes with git
234
209
path_append " /Program files (x86)/Git/cmd" ;;
235
210
esac
211
+ path_prepend " /c/Program Files/git LFS"
212
+ path_prepend " /c/Program Files/git/bin"
213
+ path_prepend " /c/Program Files/git/cmd"
236
214
# # Tex/LaTeX (http://tug.org/texlive/)
237
215
path_append /texlive/2010/bin/win32
216
+ path_prepend /c/Windows/System32/OpenSSH # for ssh-add etc.
217
+ path_prepend /c/bin always # ffmpeg etc.
238
218
path_append /c/Windows
239
219
path_append /c/Windows/system32
220
+ path_prepend " /c/Program Files/GnuGlobal/bin"
221
+ path_append " /c/Program Files/Cppcheck" # cppcheck, useful utility
222
+ # dumpbin.exe:
223
+ path_append " /c/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.12.25827/bin/Hostx64/x64"
240
224
path_append " /c/Program Files (x86)/PuTTY" # for plink (ssh)
241
225
path_prepend " /c/bin" always # local programs e.g. git-lfs
242
226
path_append " /c/Program Files/GnuGlobal/bin"
243
227
path_append " /swig"
228
+ # Common locations for Emacs:
229
+ path_prepend " /c/emacs/emacs/bin"
230
+ path_prepend " /c/emacs/bin"
231
+ path_prepend " /d/emacs/emacs/bin"
232
+ path_prepend " /d/emacs/bin"
233
+ path_append " $HOME /bin/_Dependencies" # list dll dependencies, exe is "Dependencies"
234
+ path_append /c/ProgramData/chocolatey/bin # runemacs/emacs, putty etc.
244
235
}
245
236
246
237
setpath_mac () {
@@ -314,10 +305,7 @@ setpath_bun() {
314
305
315
306
setpath_rust () {
316
307
if [[ -d $HOME /.cargo ]]; then
317
- # this prepends cargo bin to $PATH
318
- # It might do something more some day, so best to
319
- # use it rather than our path_prepend.
320
- . " $HOME /.cargo/env"
308
+ path_prepend " $HOME /.cargo/bin"
321
309
fi
322
310
}
323
311
719
707
720
708
function mcd {
721
709
mkdir -p " $1 "
722
- cd " $1 "
710
+ cd " $1 " || return
723
711
}
724
712
725
713
if [[ $_OS = windows ]]; then
@@ -732,13 +720,17 @@ if [[ $_OS = windows ]]; then
732
720
fi
733
721
# start on Windows opens a file with its default application.
734
722
# It's a builtin in cmd.exe.
735
- function start() {
736
- cmd ///c " start /B $( cygpath -w $@ ) "
723
+ function start() {
724
+ local args=()
725
+ for arg in " $@ " ; do
726
+ args+=(" $( cygpath -m " $arg " ) " )
727
+ done
728
+ c:/Windows/System32/cmd ////s ////c " start /B ${args[*]} "
737
729
}
730
+
738
731
# "open" is the Mac command to do this, might as well emulate on Windows
739
732
function open() {
740
- cmd ///c " start /B $( cygpath -w $@ ) "
741
-
733
+ start " $@ "
742
734
}
743
735
fi
744
736
@@ -748,12 +740,13 @@ function whatshell {
748
740
749
741
function gcproject {
750
742
if [[ -e ~ /.config/gcloud/active_config ]]; then
751
- local configfile=~ /.config/gcloud/configurations/config_$( cat ~ /.config/gcloud/active_config)
743
+ local configfile
744
+ configfile=~ /.config/gcloud/configurations/config_$( cat ~ /.config/gcloud/active_config)
752
745
if [[ $1 == " short" ]]; then
753
746
# horizon-dev-123abc => dev
754
- awk ' /^project/ {gsub(/-[0-9a-z]+$/, "", $3); print $3}' $configfile
747
+ awk ' /^project/ {gsub(/-[0-9a-z]+$/, "", $3); print $3}' " $configfile "
755
748
else
756
- awk ' /^project/ {print $3}' $configfile
749
+ awk ' /^project/ {print $3}' " $configfile "
757
750
fi
758
751
fi
759
752
}
0 commit comments