Skip to content

Instantly share code, notes, and snippets.

@zonuexe
Last active October 11, 2015 02:58
Show Gist options
  • Select an option

  • Save zonuexe/3792841 to your computer and use it in GitHub Desktop.

Select an option

Save zonuexe/3792841 to your computer and use it in GitHub Desktop.
Emacsにzshの環境変数PATHを取り込む ref: http://qiita.com/tadsan/items/9ba5eb157e09463740f4

include does PATH of Zsh in Emacs

for Japanese: http://qiita.com/items/9ba5eb157e09463740f4

What is this?

I'm using Emacs on Ubuntu, but I amazed because that had not inherited environment variable when launch Emacs by Unity launcher. So that lisp snippet have include Zsh environment variable $PATH to Emacs.

How to install

Add this snippet to your .emacs ($HOME/.emacs.d/init.el).

Copylight

USAMI Kenta tadsan@zonu.me

This snippet in licensed under GPL Version 3 and NYSL Version 0.9982 (in English unofficial ) .

(let* ((zshpath (shell-command-to-string
"/usr/bin/env zsh -c 'printenv PATH'"))
(pathlst (split-string zshpath ":")))
(setq exec-path pathlst)
(setq eshell-path-env zshpath)
(setenv "PATH" zshpath))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment