apm list -p -e --no-dev -i -j \
List (apm list
) packages (-p
) that are enabled (-e
), excluding dev packages (--no-dev
), that are installed (-i
) in JSON format (-j
)
| jq -cM '.user[] | { name: .name, url: .homepage, desc: .description}' \
Grab from output with JQ only the package name
, homepage
and description
| while read line; do
Loop through returned lines and
name="$(echo $line | jq -cr '.name')"
desc="$(echo $line | jq -cr '.desc')"
url="$(echo $line | jq -cr '.url' | sed 's/^\(.*\)#.*$/\1/')"
Extract name
, description
and url
into shell variables
if [ "${#desc}" -gt "95" ]; then desc="$(echo $desc | cut -c 1-100) [...]"; fi
Truncates the description (desc
variable) if its longer than 95 characters
printf 'apm install %s***# %s (%s)\n' "$name" "$desc" "$url"
Prints the install command, plus a comment with the description and URL, e.g.:
apm install advanced-open-file # Open and create files and directories easily. Type in a path (with autocomplete) and view directory [...] (https://github.com/Osmose/advanced-open-file)
| column -t -s "***"
Parses the printed output from the while loop and indents the commands and comments in columns, like so:
$ ./atom_plugin_install.sh
apm install Sublime-Style-Column-Selection # Enable Sublime style 'Column Selection'. Just hold 'alt' while you select, or select using your midd [...] (https://github.com/bigfive/atom-sublime-select)
apm install advanced-open-file # Open and create files and directories easily. Type in a path (with autocomplete) and view directory [...] (https://github.com/Osmose/advanced-open-file)
apm install atom-alignment # A simple key-binding for aligning multi-line and multiple selections in Atom (Based on the sublime t [...] (https://github.com/Freyskeyd/atom-alignment)
apm install compare-files # Compares two files and show the diff (https://github.com/atom-compare-files/atom-compare-files)
apm install file-icons # Assign file extension icons and colours for improved visual grepping (https://github.com/file-icons/atom)
apm install git-blame # Toggle git-blame annotations in the gutter of atom editor. (https://github.com/alexcorre/git-blame)
apm install git-diff-details # View git diffs directly in atom. (https://github.com/samu/git-diff-details)
apm install git-line # Displays a tooltip with git-blame information about the currently selected line. (https://github.com/joelgardner/git-line)