[Atom] パッケージ環境同期する方法

3 min read
hiroweb developer

1.0 がリリースされたので、また Atom を使い始めたのだけれど、昔より随分と使いやすくなっていて、常用している。
自宅と仕事場でパッケージを色々と入れてみたのだが、良さそうなものを管理するのが面倒になってきた。

概要

Atomアカウントでパッケージを管理する(ような感じ)。

apmの導入

Atomをインストールしていれば入っている

Atomアカウントの作成

https://atom.io/ からSign inをするとGithubアカウントと連携する画面に遷移する。 Githubアカウントを持っていなければ作る必要があるが、既に持っている場合はそのまま承認してしまえばAtomで使用するアカウントは作成される。

Atomのアカウントページ

https://atom.io/account に以下のようなTokenがある(サンプル)
_-ZKHipZHopZdeZGo!nM_ReD
ここで確認したAPI Tokenは、あとで使う。ページを開いておくなりメモするなりしておく。

インストールしたパッケージに一括でスターを付ける

apmを確認する

とりあえず以下を実行してみる。
apm
以下のようなメッセージが表示されればOK
apm - Atom Package Manager powered by https://atom.io

Usage: apm <command>

where <command> is one of:
clean, config, dedupe, deinstall, delete, dev, develop, docs, erase,
featured, home, init, install, link, linked, links, list, ln, lns, login,
ls, open, outdated, publish, rebuild, rebuild-module-cache, remove, rm,
search, show, star, starred, stars, test, uninstall, unlink, unpublish,
unstar, update, upgrade, view.

Run apm help &lt;command&gt; to see the more details about a specific command.

Options:
--color Enable colored output [boolean][default: true]
-v, --version Print the apm version
-h, --help Print this usage message

Prefix an option with no- to set it to false such as --no-color to disable
colored output.

インストール済みのパッケージにスターを付ける

以下を実行する。
apm stars --installed
初回であれば前述のTokenを入力するようなメッセージが表示される。エンターキーを叩くとユーザページがブラウザで開くので、自分のTokenをコンソールで叩く。
Welcome to Atom!

Before you can publish packages, you'll need an API token.

Visit your account page on Atom.io https://atom.io/account,
copy the token and paste it below when prompted.

Press [Enter] to open your account page on Atom.io.
Token>

このままスター付けが始まらない場合は、もう一度以下を実行する。
apm stars --installed
Starring  japanese-menu
…
…
…
これでスター付けは完了する。 Atomのユーザページの下部にある[★Star]にインストール(スターをつけた)したパッケージが表示される。

スターの付いたパッケージを一括でインストールする

以下でスター付きのパッケージをインストールすることができる。
apm stars --install