この文書の現在のバージョンと選択したバージョンの差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
|
emacs [2014/09/29 18:06] tsuji |
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 ===== | ||
| ライン 100: | ライン 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' | ||
| ライン 213: | ライン 285: | ||
| </code> | </code> | ||
| - | =====起動時の下の画面を消す===== | ||
| - | 端末で下のようにファイルを作る. | ||
| - | <code bash> | ||
| - | emacs .emacs.d/init.el& | ||
| - | </code> | ||
| - | できたファイルに下記のものを貼る. | ||
| - | <code bash> | ||
| - | (setq inhibit-startup-message t) | ||
| - | (put 'upcase-region 'disabled nil) | ||
| - | </code> | ||