aboutsummaryrefslogtreecommitdiffhomepage
path: root/vim/init/special_highlight.vim
blob: 9729183d282c36666f506f041219127e47a38f66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"----------------------------------------------------------------------
" SYNTAX_HIGHLIGHT
"----------------------------------------------------------------------

syntax enable

function! GetHighlightGroupName()
    let l:syntaxID = synID(line('.'), col('.'), 1)
    let l:groupName = synIDattr(l:syntaxID, 'name')
    echo "Highlight Group Name: " . l:groupName
endfunction

" Defualt highlight for matched parenthesis is so weird in many colorscheme
" Why the background color is lighter than my caret !?
" highlight MatchParen ctermfg=NONE ctermbg=darkgrey cterm=NONE
highlight LuaParen ctermfg=NONE ctermbg=darkgrey cterm=NONE

" Show trailing spaces
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/

" Persist visualized lines
" define line highlight color
highlight MultiLineHighlight ctermbg=LightYellow guibg=LightYellow ctermfg=Black guifg=Black
" highlight the current line
nnoremap <silent> <leader>gh :call matchadd('MultiLineHighlight', '\%'.line('.').'l')<CR>
" clear all the highlighted lines
nnoremap <silent> <leader>gH :call clearmatches()<CR>