Path To Gvim For Mac
Mac下使用Google官方的Go语言安装包: 安装的Go,会自动把 /usr/local/go/bin 目录加入PATH中。这样我们直接在控制台就可以执行go语言的一些命令。 下面使用 export 命令看到当前的系统环境变量设置 Go的二进制编译包假设你把Go安装在 /usr/local/go (或者Window是 c: Go)目录下。当然你也可以安装在其他目录下,不过这时候你就需要设置GOROOT环境变量了。 例如,你如果安装Go在你的Home目录下,你应该 $HOME/.profile 文件增加下面设置。 export GOROOT=$HOME/go export PATH=$PATH:$GOROOT/bin Window下则是: Under Windows, you may set environment variables through the 'Environment Variables' button on the 'Advanced' tab of the 'System' control panel. Some versions of Windows provide this control panel through the 'Advanced System Settings' option inside the 'System' control panel. 比如我的Mac本,其实我没有设置GOROOT,但是通过 go env 可以得到GOROOT的目录是:/usr/local/go 我猜测这应该是没有设置时的默认设置。如果有设置,会覆盖。 GOPATH GOPATH的作用是告诉Go 命令和其他相关工具,在那里去找到安装在你系统上的Go包。 GOPATH是一个路径的列表,一个典型的GOPATH设置如下,类似PATH的设置,Win下用分号分割: GOPATH=/home/user/ext:/home/user/mygo 每一个列表中的路径是一个工作区的位置。每个工作区都有源文件、相关包的对象、执行文件。 下面是一个建立工作区的步骤: 创建 $HOME/mygo 目录和作为源代码的 src 目录。 $ mkdir -p $HOME/mygo/src # create a place to put source code 下一步就是设置 GOPATH,另外你应该把 这个目录下的bin目录放在 PATH 环境变量,这样你就可以直接在命令行执行而不用给出完整目录。 Mac 下可以在 /. Bashprofile 文件去设置。.
If you are on 10.7 and not 10.8, the solution below works well: I had the same problem with eclipse, but now I've added e.g. The following to my.bashprofile and then it worked. Export PATH=somepath:anotherpath launchctl setenv PATH $PATH In case you want to leave the original path intact use p=$(launchctl getenv PATH) launchctl setenv PATH /my/new/path:$p instead (or just launchctl setenv PATH /my/new/path:$(launchctl getenv PATH)). Note: Changing the launchctl PATH will not take effect until the Dock is 'restarted'. A new Dock process will automatically start after the current one is killed with the command: killall Dock. To answer you question to your 'new' problem, I've decided to write another answer - because it is easier to explain with samples. One way to load the environment variables on startup of your tool (IDE) of choice is like it can be done with eclipse - I think there must be a similar structure in your tool (IDE) too.
How it can be done in eclipse - (slightly re-written about the environment variables) Create an empty text file called 'eclipse.sh' in the Eclipse application bundle directory /Applications/eclipse/Eclipse.app/Contents/MacOS Open the eclipse.sh in a text editor and enter the following contents: #!/bin/sh. /.bashprofile logger '`dirname '$0 '`/eclipse' exec '`dirname '$0 '`/eclipse' $@ In the Terminal set the executable flag of the shell script eclipse.sh, i.e.: chmod +x /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse.sh Open the Eclipse.app Info.plist and change the value for the key CFBundleExecutable from eclipse to eclipse.sh. MacOS X does not automatically detect that the Eclipse.app's Info.plist has changed. Therefore you need to force update the LaunchService database in the Terminal by using the lsregister command: /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -v -f /Applications/eclipse/Eclipse.app The next time you launch Eclipse.app from the Dock or from the Finder the environment variables should be set. On Mountain Lion all the /etc/paths and /etc/launchd.conf editing doesn't take any effect!
Apple's Developer Forums say: 'Change the Info.plist of the.app itself to contain an 'LSEnvironment' dictionary with the environment variables you want. /.MacOSX/environment.plist is no longer supported.' So I directly edited the app's Info.plist (right click on 'AppName.app' (in this case SourceTree) and then ' Show package contents') and added a new key/dict pair called: LSEnvironment PATH /Users/flori/.rvm/gems/ruby-1.9.3-p362/bin:/Users/flori/.rvm/gems/ruby-1.9.3-p362@global/bin:/Users/flori/.rvm/rubies/ruby-1.9.3-p326/bin:/Users/flori/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin: (see: ) now the App (in my case SourceTree) uses the given path and works with git 1.9.3:-) PS: Of course you have to adjust the Path entry to your specific path needs. Is this true?
I see lots of posts with contradictory information, some of which are clearly old, but some of which seems recent. I don't even have (on 10.8.2) a /etc/launchd.conf anyway. Presumably, even if the rules not state that apps should use their Info.plist files for paths, they could still be using other files - /etc/launchd.conf, /etc/paths/, or /etc/paths.d/., or `/.MacOSX/environment.plist. Is it safe to say then that, in practice, paths for GUI apps in Mountain Lion could be set in any of these files?
2013-11-22 You will get the current path. You got the current path, now you can use the previous command to set the path to easier one. In the previous guide on Customize iTerm2 with Color Schemes, Syntax Highlighting, basically we did a kind of ugly cheat, but in these situations, you’ll either need to know the location of.bash_profile.
– Feb 3 '13 at 17:47. This Info.plist was the only thing what worked for me, after trying lauchd.conf, etc/paths etc with my Maverics and eclipse. Actually this did not work immediately also, you need to remember two things: 1.
Run /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -v -f /Applications/eclipse/Eclipse.app as given in another answer, after changing plist and 2. Add full path there, you cannot use existing PATH as in your profile scripts. – May 5 '14 at 20:30. On Mountain Lion (10.8.4), $PATH is treated specially somehow.
- Jan 29, 2016 - I was hoping that, since Mac originated from parts of the Linux / X. To use MacVim as the gvim alternative, there seems to be no way out of it.
- 2018-11-24 When I'm using vim in a terminal, it uses the PATH I have set, and I can run programs and scripts located in my ~/bin folder using! For example:! Some_bash_script.sh When I try this in.
Vim On Mac
Launchctl setenv PATH /your/path:/here does not have any effect on the $PATH in Terminal.app or Emacs.app instances subsequently launched from the Dock or from the Finder (whereas launchctl setenv SPONG foo works fine). Also $HOME/.launchd.conf doesn't work. /etc/launchd.conf is the only way I have found to get PATH set correctly everywhere.
Safari Vim
Unfortunately, one cannot use envars such as $HOME there, so all the users on my laptop have /Users/nb/bin on their $PATH. That's only me, so I don't care.