atomの設定 リンクを取得 Facebook × Pinterest メール 他のアプリ - 12月 02, 2018 # Atomのパッケージと設定 ## パッケージ ### インストール用スクリプト デスクトップPC向け(読み込みに少し時間がかかるパッケージを含む)パッケージインストールコマンド. ```bash apm install atom-ide-ui ide-python uber-juno language-matlab markdown-preview-enhanced latex latextools document-outline atom-panda-syntax gruvbox-plus-syntax file-icons sort-lines atom-beautify pigments git-plus minimap color-picker ``` ノートPCでは以下のパッケージをインストールしている. ```bash apm install language-julia language-matlab markdown-preview-enhanced latex latextools atom-panda-syntax gruvbox-plus-syntax file-icons sort-lines git-plus minimap color-picker ``` ### Python - ※ [ide-python](https://atom.io/packages/ide-python) - Pythonの構文強調・デバッグ・実行 ### Julia - ※ [uber-juno](https://atom.io/packages/uber-juno) - Juliaの構文強調・デバッグ・実行 ### Octave/Matlab - [language-matlab](https://atom.io/packages/language-matlab) - Octave・Matlabの構文強調 ### Markdown - [markdown-preview-enhanced](https://atom.io/packages/markdown-preview-enhanced) - Markdownの構文強調・プレビュー・PDFへの変換 ### LaTeX - [language-latex](https://atom.io/packages/language-latex) - Latexの構文強調 - [latex](https://atom.io/packages/latex) - Latexのコンパイル - [latextools](https://atom.io/packages/latextools) - Latexの補完 - しばらく開発が泊まっているため処置が必要. - [document-outline](https://atom.io/packages/document-outline) - 文章構造の表示 ### 見た目 - [atom-panda-syntax](https://atom.io/themes/atom-panda-syntax) - グレーにパステルカラー.くっきり見やすい - [gruvbox-plus-syntax](https://atom.io/themes/gruvbox-plus-syntax) - 暖色.秋っぽい配色.目に優しい.大好き. - [file-icons](https://atom.io/packages/file-icons) - アイコンが見やすくなって良い. ### その他 - ※ [atom-ide-ui](https://atom.io/packages/atom-ide-ui) - ide-pythonの利用に必須 - [sort-lines](https://atom.io/packages/sort-lines) - 行のソート.メモ書きなんかにめっちゃ便利 - [script](https://atom.io/packages/script) - atom-ideに対応していない言語を動かす.octaveとか - ※ [atom-beautify](https://atom.io/packages/atom-beautify) - コードフォーマットする. - PythonとかMatlabで使う - ※ [pigments](https://atom.io/packages/pigments) - `#aaffaa`とかに反応して,色を表示してくれる.結構重いのでデスクトップ向け - [git-plus](https://atom.io/packages/git-plus) - gitの管理 - [minimap](https://atom.io/packages/minimap) - 見やすい - [color-picker](https://atom.io/packages/color-picker) - 色の選択 - [autoupdate-packages](https://atom.io/packages/autoupdate-packages) - パッケージの自動アップデート ## 設定 ### keymap.cson ```cson 'body:not([class~=\'platform-darwin\']) atom-text-editor[data-grammar~=\'latex\']': 'ctrl-alt-b': 'latex:build' 'atom-workspace': 'ctrl-shift-T': 'pane:reopen-closed-item' ``` ### snipet.cson ```cson '.text.tex.latex': # Beamer用 'frame environment': 'prefix': 'frame' 'body': '\\\\begin{frame}{$1}\n\t$2\n\\\\end{frame}' 'block environment': 'prefix': 'block' 'body': '\\\\begin{block}{$1}\n\t$2\n\\\\end{block}' 'alertblock environment': 'prefix': 'alert' 'body': '\\\\begin{alertblock}{$1}\n\t$2\n\\\\end{alertblock}' 'exampleblock environment': 'prefix': 'example' 'body': '\\\\begin{exampleblock}{$1}\n\t$2\n\\\\end{alertblock}' 'two column environment': 'prefix': 'twocol' 'body': """ \\\\begin{columns}[T]\\\\centering \\\\begin{column}{0.49\\\\linewidth} $1 \\\\end{column} \\\\begin{column}{0.49\\\\linewidth} $2 \\\\end{column} \\\\end{columns} """ 'hspace': 'prefix': 'hspace' 'body': '\\\\hspace{$1em}' 'vspace': 'prefix': 'vspace' 'body': '\\\\vspace{$1ex}' 'cite': 'prefix': ' cite' 'body': '\\\\cite$1' 'color': 'prefix': 'color' 'body': '\\\\color{$1}' '.source.python': 'pkgs used often': 'prefix': 'init' 'body':""" import numpy as np import numpy.linalg as nl import scipy as sp import matplotlib.pyplot as plt """ '.source.julia': 'Array{Float64}': 'prefix': 'arrf1' 'body': 'Array{Float64}' 'Array{Float64,2}': 'prefix': 'arrf2' 'body': 'Array{Float64, 2}' 'pkgs used often': 'prefix': 'init' 'body':""" Using LinearAlgebra Using MatrixDepot using PyPlot """ ``` ### style.less ```less @import "syntax-variables"; atom-text-editor { font-weight: bolder; .syntax--comment, .syntax--keyword, .syntax--meta, .syntax--section, .syntax--selection, .syntax--storage, .syntax--subsection, .syntax--variable { font-style: normal !important; } .cursor { background-color: fade(@syntax-text-color,30%); } } .tab, .tab-bar, .title, .tree-view { font-family: "Open Sans", "Meiryo"; font-weight: 600; font-size: 10pt; } .tab-bar .tab::before { background: #a2bf14 !important; } atom-text-editor .gutter .line-number.cursor-line { color: @syntax-background-color; background-color: @syntax-text-color; } ``` #### latextoolsのバグの修正 詳しい内容については[ここ](https://github.com/msiniscalchi/atom-latextools/issues/176)を参照 - Ctrl+,で設定画面を開く - Packagesでlatextoolsを探す - View Codeを押すと新しいウィンドウでlatextoolsのソースが開く - `latextools/lib/views/snippet-manager.coffee`を開く - 153行目あたりの ```coffee if text = te.getSelectedText() text = text.replace(/\\/g, "\\\\") range = te.getSelectedBufferRange() te.setSelectedBufferRange(range, '') @snippetService.insertSnippet("\$#{text}\$") return ``` と,190行目あたりの ```coffee if text = te.getSelectedText() text = text.replace(/\\/g, "\\\\") range = te.getSelectedBufferRange() te.setSelectedBufferRange(range, '') # Use snippet to leave selection on (same as ST) @snippetService.insertSnippet("#{left}${1:#{text}}#{right}") return ``` をコメントアウトして,それぞれ ```coffee range = te.getSelectedBufferRange() text = te.getTextInBufferRange(range) text = text.replace(/\\/g, "\\\\") if text @snippetService.insertSnippet("\$#{text}\$") return ``` と ```coffee range = te.getSelectedBufferRange() text = te.getTextInBufferRange(range) text = text.replace(/\\/g, "\\\\") if text @snippetService.insertSnippet("#{left}${1:#{text}}#{right}") return ``` に書き換える リンクを取得 Facebook × Pinterest メール 他のアプリ コメント
コメント
コメントを投稿