Last active
August 29, 2015 14:25
-
-
Save koturn/3ec928f84651d5de669c 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
" Joke! | |
if has('cryptv') | |
function! s:destroy_file(has_bang) abort | |
if !filereadable(expand('%:p')) | |
echoerr 'Current buffer is not write out to file' | |
return | |
endif | |
if !a:has_bang | |
echoerr "Must to add '!' to destroy this file" | |
return | |
endif | |
let cursor = getpos('.') | |
normal! ggg?G | |
call setpos('.', cursor) | |
let &l:key = sha256(reltimestr(reltime())) | |
write | |
bwipeout | |
endfunction | |
command! -bar -bang DestroyFile call s:destroy_file(<bang>0) | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment