
Python学習のためにCotEditorをいれてみた~設定備忘録
下記のパネルのインデントをスペースに変える。インデント数は4スペース。

デフォルトのシンタックスをPythonに変える。

不可視文字にチェックを入れる。

パネルの一般の一番下に、コマンドツールの詳細情報に従って、terminalからCotEditor起動などができるようにしてみる。
mkdir /usr/local/bin/
ln -s /Applications/CotEditor.app/Contents/SharedSupport/bin/cot /usr/local/bin/cot
ln: /usr/local/bin/cot: Permission denied
上記のエラーがでたので、sudo をつけて実行してみる。
sudo ln -s /Applications/CotEditor.app/Contents/SharedSupport/bin/cot /usr/local/bin/cot
パスワード入力して、うまくできたようで、terminalで cot コマンドが使えるようになった。初回に、CotEditorに許可を与えるための選択パネルが出る。
usage: cot [-h] [-v] [-w] [-g] [-n] [-s SYNTAX] [-l LINE] [-c COLUMN]
[FILE ...]
command-line utility for CotEditor.
positional arguments:
FILE path to file to open
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-w, --wait wait for opened file to be closed
-g, --background do not bring the application to the foreground
-n, --new create a new blank document
-s SYNTAX, --syntax SYNTAX
set specific syntax to opened document
-l LINE, --line LINE jump to specific line in opened document
-c COLUMN, --column COLUMN
jump to specific column in opened document
cotコマンドは以下のオプションが使用できます。
オプション 説明
-w, --wait 開いたファイルが閉じるまでコマンドの終了を待ちます。
-n, --new 空の新規書類を開きます。
-s, --syntax 開いた書類に任意のシンタックスをセットします。
-l, --line <line> 開いた書類の指定した行に移動します。<line>は行を指定する整数型です。
-c, --column <column> 開いた書類の指定した列に移動します。<column>は列を指定する整数型です。
-b, --background CotEditorをバックグラウンドで開きます。
-h, --help ヘルプを表示します。
-v, --version バージョンを表示します。
これで、terminalから、新しいファイルをつくったり、修正したいファイルを開くことができるようになりました。
(ai-basic) cs101 % cot -n test.py
test.py というファイルが作られて、coteditorが開く。
ファイル内容を書いて、Command + S キーで保存したあと、terminalで実行する。
(ai-basic) cs101 % python test.py
who am I ?
macbookでは、window移動のショートカットは Command + Tabだということなので、それで行き来すればよさそうです。
📝 クイックアクションメニューの機能
CotEditor を立ち上げてる状態で、Command + K キーで、クイックアクションの窓が開かれる。cot とか数文字を入力することで、メニューのアクションが可能。Command + . キー(あるいはESC)で窓が閉じる。
とりあえず今回はここまで。
いいなと思ったら応援しよう!
