diff options
Diffstat (limited to 'vim/init/special_highlight.vim')
-rw-r--r-- | vim/init/special_highlight.vim | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/vim/init/special_highlight.vim b/vim/init/special_highlight.vim new file mode 100644 index 0000000..50e4dc3 --- /dev/null +++ b/vim/init/special_highlight.vim | |||
@@ -0,0 +1,28 @@ | |||
1 | "---------------------------------------------------------------------- | ||
2 | " SYNTAX_HIGHLIGHT | ||
3 | "---------------------------------------------------------------------- | ||
4 | |||
5 | syntax enable | ||
6 | |||
7 | function! GetHighlightGroupName() | ||
8 | let l:syntaxID = synID(line('.'), col('.'), 1) | ||
9 | let l:groupName = synIDattr(l:syntaxID, 'name') | ||
10 | echo "Highlight Group Name: " . l:groupName | ||
11 | endfunction | ||
12 | |||
13 | " Defualt highlight for matched parenthesis is so weird in many colorscheme | ||
14 | " Why the background color is lighter than my caret !? | ||
15 | highlight MatchParen ctermfg=NONE ctermbg=darkgrey cterm=NONE | ||
16 | highlight LuaParen ctermfg=NONE ctermbg=darkgrey cterm=NONE | ||
17 | |||
18 | " Show trailing spaces | ||
19 | highlight ExtraWhitespace ctermbg=red guibg=red | ||
20 | match ExtraWhitespace /\s\+$/ | ||
21 | |||
22 | " Persist visualized lines | ||
23 | " define line highlight color | ||
24 | highlight MultiLineHighlight ctermbg=LightYellow guibg=LightYellow ctermfg=Black guifg=Black | ||
25 | " highlight the current line | ||
26 | nnoremap <silent> <leader><leader>h :call matchadd('MultiLineHighlight', '\%'.line('.').'l')<CR> | ||
27 | " clear all the highlighted lines | ||
28 | nnoremap <silent> <leader><leader>H :call clearmatches()<CR> | ||