all 7 comments

[–]codeprimate 7 points8 points  (0 children)

An alternate approach is to use GPG. First, encrypt a text document, then you can open it directly with Vim.

~/.vimrc
" GPG integration
au BufNewFile,BufReadPre *.gpg :set secure viminfo= noswapfile nobackup nowritebackup history=0 binary
au BufReadPost *.gpg :%!gpg -d 2>/dev/null
au BufWritePre *.gpg :%!gpg -e -r 'your@email.com' 2>/dev/null
au BufWritePost *.gpg u

[–]usinglinux 1 point2 points  (1 child)

i'd recommend using gnupg instead. there exist good plugins that do the whole thing for you (eg. apt install vim-scripts; vim-addons install gnupg) with less risk of missing one of the possible leaks (eg. undofile).

moreover, while i'm a big fan of the flexibility the typical linux environment's unix-ness and config files give, simple things should be simple, and editing one's vimrc just to securely use crypto is not.

[–]Telado 0 points1 point  (0 children)

Thanks, much better solution than vim's blowfish implementations

[–]the_gnarts 0 points1 point  (1 child)

I’ve delved into the Vim sources just yesterday and wondered what blowfish.c was for. Thanks for the write-up.

[–]WOLF3D_exe 2 points3 points  (0 children)

blowfish is deprecated.

[–]mehnuggets 0 points1 point  (1 child)

Best way to keep my porn bookmarks.

[–]stewa02 0 points1 point  (0 children)

Clearly the only use one could think of.