Skip to content

Instantly share code, notes, and snippets.

@c6401
Last active July 25, 2026 16:36
Show Gist options
  • Select an option

  • Save c6401/710b49f85a7183bb7bdf4d927357dbbf to your computer and use it in GitHub Desktop.

Select an option

Save c6401/710b49f85a7183bb7bdf4d927357dbbf to your computer and use it in GitHub Desktop.
test_vim_transparent_gpg.vimrc
augroup encrypted
autocmd!
autocmd BufReadPre,BufWritePre *.gpg,*.asc
\ setlocal binary noswapfile noundofile nobackup nowritebackup | set viminfo=
autocmd BufReadPost *.gpg,*.asc
\ silent execute '%!gpg -qd 2>/dev/null' | setlocal nobinary | filetype detect
autocmd BufWritePre *.gpg,*.asc
\ silent execute '%!gpg -qc --cipher-algo AES256 2>/dev/null'
autocmd BufWritePost *.gpg,*.asc
\ silent undo | setlocal nobinary
augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment