I’m using taskpaper.vim to work with projects and tasks and would like to display the hyphen that starts a tasks as the □ (unicode white square). I don't want to actually replace the character in the text, but simply display it this way.
1 Answer
The conceal feature will let you do this. Following the example here, I came up with this solution.
:call matchadd('Conceal', '^-', 10, -1, {'conceal': '□'})
:set conceallevel=2 concealcursor=nv
Note that the pattern is a hyphen in column 1. If you want to allow whitespace before the hyphen, change the pattern to '^\s*\zs-'
.