Last active
January 6, 2019 03:01
-
-
Save u1and0/af4713cafb5e4e274fc235a29c8dbe12 to your computer and use it in GitHub Desktop.
vimを高機能なPDFリーダーにする設定 ref: https://qiita.com/u1and0/items/526d95d6991bc19003d2
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
| autocmd BufRead *.pdf :enew | 0read !pdftotext -layout -nopgbrk "#" - |
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
| set list " 不可視文字の表示 | |
| set listchars=tab:»-,trail:-,eol:↲,extends:»,precedes:«,nbsp:% |
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
| :nnoremap <buffer> j <C-E> | nnoremap <buffer> k <C-Y> |
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
| カレントバッファだけで使用できるマップを作成するには、マップコマンドの引数に"<buffer>" を指定します。例: | |
| :map <buffer> ,w /[.,;]<CR> | |
| この場合、他のバッファで、",w" に対して別の操作を割り当てることができます: | |
| :map <buffer> ,w /[#&!]<CR> |
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
| augroup MyAutoCmd | |
| if executable('pdftotext') | |
| " PDFファイルを開いた時、text形式に変換してから開く | |
| autocmd BufRead *.pdf :enew | 0read !pdftotext -layout -nopgbrk "#" - | |
| endif | |
| " 圧縮ファイルとPDFファイルを開いた時、readonlyモードで開き、j/kキーマップを変更 | |
| autocmd BufRead *.zip,*.gz,*.bz2,*.xz,*.pdf setlocal readonly nolist | |
| \| nn <buffer> j <C-E> | nn <buffer> k <C-Y> | |
| augroup END |
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
| :set nolist | |
| :set ro |
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
| autocmd BufRead *.zip,*.gz,*.bz2,*.xz,*.pdf setlocal readonly nolist | |
| \| nn <buffer> j <C-E> | nn <buffer> k <C-Y> |
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
| vim:nolist:ro: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment