How to make vim syntax work along with hiding?

I use HaskellConcealPlus to hide some elements of the Haskell code, and haskell.vim from here to get the best syntax highlighting for Haskell. The following shows how it looks:

enter image description here

The problem is that the div loses the orange color after hiding, which leads to inconsistency when the โ€œ/โ€ is highlighted in orange, but โ€œรทโ€ is white, although both are infix operations. Is there a way to get syntax highlighting and hiding for both?

+6
source share
1 answer

As soon as part of the text is hidden, they are colored, as determined by the Conceal selection Conceal . :help hl-Conceal will tell you more about the group. :highlight will show you all highlighted groups and their color ads. For instance. my hiding group looks like below:

 Conceal xxx ctermfg=4 ctermbg=0 guifg=#8fa1b3 guibg=#2b303b 

To get more decent colors, you can, of course, set your own color and the properties of your hidden group inside .vimrc . The following is an example that will use bold, underlined text, using ANSI 9 as the foreground color and ANSI 0 as the background color for all files with the hs extension:

 augroup AdjustConceal autocmd! autocmd ColorScheme *.hs highlight Conceal cterm=bold,underline ctermfg=9 ctermbg=0 augroup END 

Alternatively, you can simply reference an existing allocation group. In the example below, the link will be from Conceal to Search :

 augroup AdjustConceal autocmd! autocmd ColorScheme *.hs highlight link Conceal Search augroup END 
+2
source

Source: https://habr.com/ru/post/980053/


All Articles