Last active
August 29, 2015 14:02
-
-
Save am4dr/326a0e805d181631e517 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " usage | |
| " 1. acrobat readerで全文選択コピー | |
| " 2. バッファに貼り付け | |
| " 3. :source sc.vim | |
| " TODO | |
| " - markを上手に使って全体的にもう少しきれいに書けそう? | |
| " - `^##`にマッチしない行で条件に合う行を全部結合したい処理をきれいに。 | |
| " Contentsをaとしてマーク | |
| g/^Contents$/normal ma | |
| " Chapter 1をbとしてマーク | |
| g/^Chapter 1$/normal mb | |
| " :'a,'bcomamnd によって目次範囲にcommandを適用できる | |
| " 図表の一覧を削除 | |
| g/List of Figures/normal d`b | |
| " ヘッダとフッタの処理 | |
| " 各ページに挿入されているバージョン情報を削除 | |
| %g/^OpenGL 4.4 (Core Profile) - March 19, 2014$/d | |
| " bug: いくつかが改行や前後の行との混合によって残留した | |
| " 各ページの上の節の見出しを削除 | |
| " 目次 | |
| 'a,'bg/^CONTENTS [ivx]\{1,\}$/d | |
| " 本文 | |
| %g/^\(\d\{1,\}\.\)\{1,\} .* \(\d\{1,\}\)\{1,\}$/d | |
| " 付録 | |
| " ページ番号を削除 | |
| " 目次 | |
| 'a,'bg/^[ivx]\{1,\}$/d | |
| "本文 | |
| %g/^\(\d\{1,\}\)$/d | |
| " 制御文字の削除 | |
| %s/[ | |
| ]//g | |
| " 空行の削除 | |
| %g/^$/d | |
| " 見出しの作成 | |
| %s/^Contents$/## \0/ | |
| %g/^\(Chapter \(\d\)\{1,\}\|Appendix [A-Z]\)/normal I## J | |
| 'b,$s/^\d\{1,\}\(\.\d\{1,\}\)\{1,\}/### \0/ | |
| " 行の連結 | |
| " 改行で分割された単語の復元 | |
| %s/-\n// | |
| " 章見出しを除く、特定の文字以外で終了している行は次と連結する。 | |
| %s/^\([^#].*[^:;.0-9?]\)\n/\1 / | |
| %s/^\([^#].*[^:;.0-9?]\)\n/\1 / | |
| %s/^\([^#].*[^:;.0-9?]\)\n/\1 / | |
| %s/^\([^#].*[^:;.0-9?]\)\n/\1 / | |
| %s/^\([^#].*[^:;.0-9?]\)\n/\1 / | |
| %s/^\([^#].*[^:;.0-9?]\)\n/\1 / | |
| %s/^\([^#].*[^:;.0-9?]\)\n/\1 / | |
| %s/^\([^#].*[^:;.0-9?]\)\n/\1 / | |
| " 文字定数のcode指定 | |
| %s/\(\<[A-Z0-9]\{1,\}_[A-Z0-9_]*\>\)/`\1`/g | |
| %s/\(\<_[A-Z0-9_]\{1,\}\>\)/`\1`/g | |
| " *のエスケープ | |
| %s/\*/\\*/g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment