I've got highlighting of searches on and have the following set up to clear it in my vimrc
nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR>
I've also got the haskell plugin type information plugin hdevtools installed. This keeps a highlight/selection up once you've asked for the type of an expression in case you want to expand that expression using the type info command again.
I'd like to be able to clear both lots of highlighting with the same key press, previously I'd had it set up to have a different shortcut but it's fiddly.
However my plugin shortcuts are set up with autocmds like this:
autocmd FileType haskell nnoremap <buffer> <silent> <space> :HdevtoolsClear<CR>
I know I could just do copy and paste and a in between but that means if I change this stuff I have to change it in two places.
I'd like some way to do something like this:
clearSearchHighlight = :nohlsearch<Bar>:echo<CR>
nnoremap <silent> <Space> clearSearchHighlight
autocmd FileType haskell nnoremap <buffer> <silent> <space> :HdevtoolsClear<CR> <bar> clearSearchHighlight