3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

プロキシを通さないと外に出れないネットワーク上にあるWindowsに、DOOM Emacsをインストールした

Last updated at Posted at 2019-09-17

諸注意

DOOM EmacsはMacやLinux向けに設計されています。

つまり自己責任で導入お願いいたします。

事の発端 tl;dr

Visal Studio2015は地味に画面分割が思い通りにならないなとか思って、本腰入れてDOOM Emacsを職場のWindowsにインストールしてしまった。

ということで、誰かの役に立つかもしれないのでメモ。

用意するもの

Emacsの為のWindowsの環境変数設定については省く。

手順

まずGitの設定

Gitへのプロキシ設定

Gitにプロキシ設定を行う。

$ git config --global http.proxy "http://your.proxy.jp:1234"
$ git config --global https.proxy "https://your.proxy.jp:1234"

後でLAN内Gitリポジトリにプロキシを介さずにフェッチなどを行いたいときに、以下の様なシェルスクリプトを組んで保存しておいてもいいかもしれない。

toggle-proxy.sh
proxy="http://your.proxy.jp:1234"

git config --global --list | grep -sq "http.proxy" 
if [ $? -eq 0 ] ; then
    git config --global --unset http.proxy
    git config --global --unset https.proxy
else
    git config --global http.proxy $proxy
    git config --global https.proxy $proxy
fi

straight.el用の設定もGitに追加。

更にこのDOOM Emacsで使用しているパッケージマネージャー(straight.el)のissue 347の情報も参考に下記設定をGitに追加。

$ git config --global url."https://".insteadOf "git://"

すわ、DOOMをインストール。

あとは通常通りのDOOM Emacsのインストール方法である。

$ git clone --depth 1 --branch develop https://github.com/hlissner/doom-emacs ~/.emacs.d
$ ~/.emacs.d/bin doom install

Yay! Evil!

あとはお好みで ~/.doom.dinit.el を編集。

あ、アイコン関係のフォントはWindowsにしっかりインストールしておきましょう。

おまけ mastodon-modeでQiitadon

Qiitaで運営しているmastodonサーバー(インスタンスとも言う)QiitadonにEmacsから投稿できるようにしてしまったので、それもメモ。

.doom.d/ 配下のファイル編集。

.doom.d/packages.el
(package! mastodon)
.doom.d/config.el
(setq mastodon-instance-url "https://qiitadon.com")

それぞれのファイルにそれぞれ上記追記。

正直ドキドキの doom update

$ ~/.emacs.d/bin/doom update
$ ~/.emacs.d/bin/doom refresh

もしくはDOOM Emacsで、M-x doom update
した後で M-x doom refresh

念のためQiitadonのアカウントにパスワード設定

「おまっ、パスワードの無いアカウントなんて許されるわけないだろ!」

mastodon.elから怒られそうなので。

M-x mastodon

あとは大体わかるはずだ。

Emacs自体のプロキシ

ふとQiitadonへの投稿に成功してしまったのは、Emacsのプロキシ設定もチャッカリしていたからではと思ったので加筆。

.doom.d/config.el
(setq url-proxy-services '(("http" . "your.proxy.jp:1234")
                           ("https" . "your.proxy.jp:1234")))

これで皆さんもErgoDashとかで両腕を広げて、
DOOM Emacsを全画面表示にしてどやりながらコーディングできますよ。

P.S.

gitのプロキシ設定がわかると、上手く行けばVimのプラグインの導入や、Spacemacsの導入も行けるかと。

おまけ記事ができました。
で、DOOM Emacsでソースコードリーディングってどうやるんだ?

3
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?