Vim conceal passwords

Submitted by cjdmax on Sun, 03/15/2015 - 15:52

A short howto to get Vim to conceal passwords, while still having them selectable and copy-paste-able. You can get the passwords visible by visual-selecting them in Vim.

YMMV how well this works for you and your terminal. Please (auto)encrypt and (auto)versioncontrol your passwordfiles, to prevent mistakes. Please note your passwords may stick in clipboard managers like Klipper.

This solution uses vim modelines, syntax overrides and the conceal function in Vim.

About me

I am a linux server administrator, muckin' around with a lot of miscellanous tech since 1998. I work at a linux devops company, mostly doing linux system admin and help desk work.

Check out my 'interactive business card and CV'-site at macgillavry.name. I also do LinkedIn. This is a quasi-personal website, with general inanity and rants. My quasi-professional website can be found at tremata.nl.

Subscribe to