LoginSignup
108

More than 5 years have passed since last update.

Atomの apm star が地味に便利

Last updated at Posted at 2014-07-24

Atomのパッケージ管理CLI apmstarが地味に便利なので、
簡単にまとめました。

apm star/stars/starred/unstarを使うと、atom.io上のスターを管理できる。
starredstarsへのエイリアスぽい。

Atom apm starの使い方

  • Star: スターをつける apm star <package>
$ apm star vim-mode

⭐  Starring vim-mode ✓

apm star vim-mode@0.12.0 こっちだとだめ。Starring package failed: Not found になるのでバージョン指定は外す。

  • Unstar: スターを外す apm unstar <package>
$ apm unstar vim-mode

? ⭐  Unstarring vim-mode
  • スターしたpackage一覧 apm stars --installed
$ apm stars --installed
Packages starred by you (82)
├── ⭐  Lucario The best colorful flat theme ever (1586 downloads, 10 stars)
├── ⭐  Stylus Adds syntax highlighting and snippets to Stylus files in Atom. (9071 downloads, 39 stars)
├── ⭐  Sublime-Style-Column-Selection Enable Sublime style 'Column Selection'. Just hold 'alt' while you select. Also similar to Texmate's 'Multiple Carets', or BBEdit's 'Block Select' (15331 downloads, 187 stars)
├── ⭐  Zen Distraction free writing. (55419 downloads, 151 stars)
├── ⭐  angularjs An AngularJS package for Atom (23122 downloads, 114 stars)

・・・

  • インストール済みのpackageに一括でstarをつける apm star --installed
$ apm star --installed

⭐  Starring Sublime-Style-Column-Selection ✓
⭐  Starring Zen ✓
⭐  Starring angularjs ✓

・・・

apm stars --themesでスターしたテーマのみの一覧。
apm stars --json でスターした一覧のJSONを表示。

  • 任意のユーザーのStar一覧 apm stars --user <username>
$ apm stars --user st44100

Packages starred by st44100 (46)
├── ⭐  Sublime-Style-Column-Selection Enable Sublime style 'Column Selection'. Just hold 'alt' while you select. Also similar to Texmate's 'Multiple Carets', or BBEdit's 'Block Select' (2850 downloads)
├── ⭐  Zen Distraction free writing. (27411 downloads)
├── ⭐  angularjs An AngularJS package for Atom

・・・

apm starsapm starredでも大丈夫。

  • Starしたパッケージの一括インストール apm stars --install

    地味にクソ便利機能。

$ apm stars --install

Installing Sublime-Style-Column-Selection to /Users/st44100/.atom/packages ✓
Installing Zen to /Users/st44100/.atom/packages ✓
Installing angularjs to /Users/st44100/.atom/packages ✓

・・・

atom.io上でスターしたpackageを一括でインストールできる。
この機能を使えば、複数のマシン上のAtomでPackageを同期できる。

atom.ioのStar意外に使われてないから、どんどん使っていこうよ。

[追記 7/25/2014]

インストール済みのパッケージを一気にStarつけるワンライナー、やっつけで作った。


apm list | awk 'BEGIN { users = 0 } { if (match($2, /\([1-9]+/) > 0) { next; } if (users > 0 ) { sub(/@.+$/,"",$2); print $2; } if (NF == 0) { users = 1; } }' | xargs -I {} apm star {}

[追記 3/24/2015]

apm star --installedがあった。上のawkスクリプト必要なかった。
@sagaraya さん、ありがとうございます。

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
108