0

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 1

3

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-'.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.