この文書の現在のバージョンと選択したバージョンの差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
emacs [2014/03/06 17:20] saito |
emacs [2017/10/03 12:55] (現在) |
||
---|---|---|---|
ライン 1: | ライン 1: | ||
====== emacs ====== | ====== emacs ====== | ||
+ | * emacsの設定は.emacs.d/init.el に書くのが主流らしい. | ||
* reference.pdf があるとショートカットを覚えるのに便利 | * reference.pdf があるとショートカットを覚えるのに便利 | ||
* [[http://clip.dia.fi.upm.es/~albegarcia/emacs-reference.pdf]] | * [[http://clip.dia.fi.upm.es/~albegarcia/emacs-reference.pdf]] | ||
ライン 8: | ライン 9: | ||
| C-M-\| カレントリージョンをまとめてインデント| | | C-M-\| カレントリージョンをまとめてインデント| | ||
| C-c Enter | (.f90モード) &(改行)&を出力| | | C-c Enter | (.f90モード) &(改行)&を出力| | ||
+ | |||
+ | ===== Frotran90でopenmpに色付け ===== | ||
+ | |||
+ | |||
+ | <code lisp> | ||
+ | ;;; highlight fortran openmp code | ||
+ | ;;; original version is ... | ||
+ | ;;; https://www.pgroup.com/userforum/viewtopic.php?t=5214&sid=51dc5164d4b5962373b0adda3fa62705 | ||
+ | (when (require 'font-lock nil 'noerror ) | ||
+ | |||
+ | (defface openmp-face | ||
+ | '((t | ||
+ | :foreground "#666666" | ||
+ | ;; :background "yellow" | ||
+ | ;; :bold t | ||
+ | )) | ||
+ | "Face for !$ [a-zA-Z] comments" | ||
+ | ) | ||
+ | (defvar openmp-face 'openmp-face) | ||
+ | |||
+ | (defface openmp2-face | ||
+ | '((t | ||
+ | :foreground "#999999" | ||
+ | ;; :background "yellow" | ||
+ | ;; :bold t | ||
+ | )) | ||
+ | "Face for !$OMP comments" | ||
+ | ) | ||
+ | (defvar openmp2-face 'openmp2-face) | ||
+ | |||
+ | |||
+ | (defvar omp-regex "$[\t ][a-zA-Z].*") | ||
+ | (defvar omp-regex2 "$omp[\t ].*") | ||
+ | (defvar omp-regex-f90 (concat "^[ \t]*\\(!" omp-regex "\\)" ) ) | ||
+ | (defvar omp-regex2-f90 (concat "^[ \t]*\\(!" omp-regex2 "\\)" ) ) | ||
+ | |||
+ | (font-lock-add-keywords 'f90-mode | ||
+ | ( list | ||
+ | ( list omp-regex-f90 1 'openmp-face t) | ||
+ | ( list omp-regex2-f90 1 'openmp2-face t) | ||
+ | )) | ||
+ | |||
+ | ) | ||
+ | </code> | ||
===== Changelog memo ===== | ===== Changelog memo ===== | ||
ライン 29: | ライン 74: | ||
</code> | </code> | ||
- | ==== Headline ==== | + | ===== Headline ===== |
起動時にウィンドウが2つに割れないようにする. | 起動時にウィンドウが2つに割れないようにする. | ||
<code> | <code> | ||
ライン 35: | ライン 80: | ||
</code> | </code> | ||
===== テキストの印刷 ===== | ===== テキストの印刷 ===== | ||
+ | emacsで<code> | ||
C-u M-x ps-print-buffer-with-faces | C-u M-x ps-print-buffer-with-faces | ||
- | でpsファイルにカラーのまま出力. | + | </code>でpsファイルにカラーのまま出力. |
白黒でよければ, | 白黒でよければ, | ||
- | C-u M-x ps-print-buffer | + | <code>C-u M-x ps-print-buffer</code> |
+ | |||
+ | psファイルをpdfにしておけば,タブレットでも見れる. | ||
+ | 以下は端末でのコマンド. | ||
+ | <code bash> ps2pdf file.ps</code> | ||
+ | |||
+ | |||
+ | 細かい字でも平気な人は以下の設定でOK. http://www.emacswiki.org/emacs/PsPrint | ||
+ | <code> | ||
+ | (setq ps-paper-type 'a4 | ||
+ | ps-font-size 7.0 | ||
+ | ps-print-header nil | ||
+ | ps-landscape-mode t | ||
+ | ps-number-of-columns 2) | ||
+ | </code> | ||
===== エラーメッセージ ===== | ===== エラーメッセージ ===== | ||
<code> | <code> | ||
ライン 85: | ライン 145: | ||
http://www.bookshelf.jp/soft/meadow_42.html#SEC634 | http://www.bookshelf.jp/soft/meadow_42.html#SEC634 | ||
http://www.emacswiki.org/emacs/?action=browse;oldid=TagFile;id=TagsFile | http://www.emacswiki.org/emacs/?action=browse;oldid=TagFile;id=TagsFile | ||
+ | |||
+ | ====コンパイラオプションを付けてもエラーの行数が出ない==== | ||
+ | |||
+ | <code bash> | ||
+ | sudo apt-get install gdb | ||
+ | gfortran ◯◯◯◯.f90 -g -fbounds-check | ||
+ | gdb ./a.out | ||
+ | </code> | ||
+ | 実行するには | ||
+ | <code bash> | ||
+ | run | ||
+ | </code> | ||
+ | 抜け出すには | ||
+ | <code bash> | ||
+ | quit | ||
+ | </code> | ||
+ | =====起動時の下の画面を消す===== | ||
+ | 端末で下のようにファイルを作る. | ||
+ | <code bash> | ||
+ | emacs .emacs.d/init.el& | ||
+ | </code> | ||
+ | できたファイルに下記のものを貼る. | ||
+ | <code bash> | ||
+ | (setq inhibit-startup-message t) | ||
+ | (put 'upcase-region 'disabled nil) | ||
+ | </code> | ||
+ | その他の便利な機能はgoogleで,「emacs init.el」で検索すると出るはず. | ||
===== 背景を黒く ===== | ===== 背景を黒く ===== | ||
背景が黒の方が目にやさしいらしい。 | 背景が黒の方が目にやさしいらしい。 | ||
- | .zshrcか何かに、 | + | .zshrcか.bashrcか何かに、 |
<code bash> | <code bash> | ||
alias emacs='emacs -r' | alias emacs='emacs -r' | ||
ライン 197: | ライン 284: | ||
</code> | </code> | ||
+ | |||