Skip to content

Commit

Permalink
Merge pull request #1329 from vim-jp/hh-update-tips
Browse files Browse the repository at this point in the history
Update tips.{txt,jax}
  • Loading branch information
h-east authored Oct 15, 2023
2 parents a11b9b4 + c826bf0 commit fb23bd6
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 19 deletions.
32 changes: 22 additions & 10 deletions doc/tips.jax
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*tips.txt* For Vim バージョン 9.0. Last change: 2021 Nov 06
*tips.txt* For Vim バージョン 9.0. Last change: 2023 Aug 10


VIMリファレンスマニュアル by Bram Moolenaar
Expand Down Expand Up @@ -435,16 +435,28 @@ NOTE: これを利用するには 'cpoptions' から '<' フラグを外して
ともできます。"*.bin" をあなたの編集したいファイルの拡張子の、コンマで区切られ
たリストに変えてください: >
" vim -b : edit binary using xxd-format!
" vim -b : xxd 形式を使用してバイナリを編集する!
augroup Binary
au!
au BufReadPre *.bin let &bin=1
au BufReadPost *.bin if &bin | %!xxd
au BufReadPost *.bin set ft=xxd | endif
au BufWritePre *.bin if &bin | %!xxd -r
au BufWritePre *.bin endif
au BufWritePost *.bin if &bin | %!xxd
au BufWritePost *.bin set nomod | endif
autocmd!
autocmd BufReadPre *.bin set binary
autocmd BufReadPost *.bin
\ if &binary
\ | execute "silent %!xxd -c 32"
\ | set filetype=xxd
\ | redraw
\ | endif
autocmd BufWritePre *.bin
\ if &binary
\ | let s:view = winsaveview()
\ | execute "silent %!xxd -r -c 32"
\ | endif
autocmd BufWritePost *.bin
\ if &binary
\ | execute "silent %!xxd -c 32"
\ | set nomodified
\ | call winrestview(s:view)
\ | redraw
\ | endif
augroup END
==============================================================================
Expand Down
30 changes: 21 additions & 9 deletions en/tips.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*tips.txt* For Vim version 9.0. Last change: 2021 Nov 06
*tips.txt* For Vim version 9.0. Last change: 2023 Aug 10


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -431,14 +431,26 @@ comma-separated list of extension(s) you find yourself wanting to edit: >
" vim -b : edit binary using xxd-format!
augroup Binary
au!
au BufReadPre *.bin let &bin=1
au BufReadPost *.bin if &bin | %!xxd
au BufReadPost *.bin set ft=xxd | endif
au BufWritePre *.bin if &bin | %!xxd -r
au BufWritePre *.bin endif
au BufWritePost *.bin if &bin | %!xxd
au BufWritePost *.bin set nomod | endif
autocmd!
autocmd BufReadPre *.bin set binary
autocmd BufReadPost *.bin
\ if &binary
\ | execute "silent %!xxd -c 32"
\ | set filetype=xxd
\ | redraw
\ | endif
autocmd BufWritePre *.bin
\ if &binary
\ | let s:view = winsaveview()
\ | execute "silent %!xxd -r -c 32"
\ | endif
autocmd BufWritePost *.bin
\ if &binary
\ | execute "silent %!xxd -c 32"
\ | set nomodified
\ | call winrestview(s:view)
\ | redraw
\ | endif
augroup END
==============================================================================
Expand Down

0 comments on commit fb23bd6

Please sign in to comment.