diff options
Diffstat (limited to 'vim/init')
| -rw-r--r-- | vim/init/basic.vim | 32 | ||||
| -rw-r--r-- | vim/init/special_highlight.vim | 28 |
2 files changed, 28 insertions, 32 deletions
diff --git a/vim/init/basic.vim b/vim/init/basic.vim index 4c6cd45..d4cf3e2 100644 --- a/vim/init/basic.vim +++ b/vim/init/basic.vim | |||
| @@ -10,7 +10,6 @@ | |||
| 10 | " EDIT | 10 | " EDIT |
| 11 | " JUMP | 11 | " JUMP |
| 12 | " SEARCH | 12 | " SEARCH |
| 13 | " SYNTAX_HIGHLIGHT | ||
| 14 | " BUFFERS | 13 | " BUFFERS |
| 15 | " ENCODING_PREFERENCE | 14 | " ENCODING_PREFERENCE |
| 16 | " FOLDING | 15 | " FOLDING |
| @@ -89,37 +88,6 @@ set smartcase | |||
| 89 | set hlsearch " Hilight all matched texts | 88 | set hlsearch " Hilight all matched texts |
| 90 | set incsearch " Show matched strings when typing | 89 | set incsearch " Show matched strings when typing |
| 91 | 90 | ||
| 92 | |||
| 93 | "---------------------------------------------------------------------- | ||
| 94 | " SYNTAX_HIGHLIGHT | ||
| 95 | "---------------------------------------------------------------------- | ||
| 96 | |||
| 97 | syntax enable | ||
| 98 | |||
| 99 | function! GetHighlightGroupName() | ||
| 100 | let l:syntaxID = synID(line('.'), col('.'), 1) | ||
| 101 | let l:groupName = synIDattr(l:syntaxID, 'name') | ||
| 102 | echo "Highlight Group Name: " . l:groupName | ||
| 103 | endfunction | ||
| 104 | |||
| 105 | " Defualt highlight for matched parenthesis is so weird in many colorscheme | ||
| 106 | " Why the background color is lighter than my caret !? | ||
| 107 | highlight MatchParen ctermfg=NONE ctermbg=darkgrey cterm=NONE | ||
| 108 | highlight LuaParen ctermfg=NONE ctermbg=darkgrey cterm=NONE | ||
| 109 | |||
| 110 | " Show trailing spaces | ||
| 111 | highlight ExtraWhitespace ctermbg=red guibg=red | ||
| 112 | match ExtraWhitespace /\s\+$/ | ||
| 113 | |||
| 114 | " Persist visualized lines | ||
| 115 | " define line highlight color | ||
| 116 | highlight MultiLineHighlight ctermbg=LightYellow guibg=LightYellow ctermfg=Black guifg=Black | ||
| 117 | " highlight the current line | ||
| 118 | nnoremap <silent> <leader><leader>h :call matchadd('MultiLineHighlight', '\%'.line('.').'l')<CR> | ||
| 119 | " clear all the highlighted lines | ||
| 120 | nnoremap <silent> <leader><leader>H :call clearmatches()<CR> | ||
| 121 | |||
| 122 | |||
| 123 | "---------------------------------------------------------------------- | 91 | "---------------------------------------------------------------------- |
| 124 | " BUFFERS | 92 | " BUFFERS |
| 125 | "---------------------------------------------------------------------- | 93 | "---------------------------------------------------------------------- |
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> | ||