From 8d8e5a626bcaf634fc56f6b7b28388f607f3b6c7 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Sat, 8 Jun 2024 18:22:03 +0800 Subject: Update --- vim/init/basic.vim | 32 -------------------------------- vim/init/special_highlight.vim | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 32 deletions(-) create mode 100644 vim/init/special_highlight.vim (limited to 'vim/init') 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 @@ " EDIT " JUMP " SEARCH -" SYNTAX_HIGHLIGHT " BUFFERS " ENCODING_PREFERENCE " FOLDING @@ -89,37 +88,6 @@ set smartcase set hlsearch " Hilight all matched texts set incsearch " Show matched strings when typing - -"---------------------------------------------------------------------- -" 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 h :call matchadd('MultiLineHighlight', '\%'.line('.').'l') -" clear all the highlighted lines -nnoremap H :call clearmatches() - - "---------------------------------------------------------------------- " BUFFERS "---------------------------------------------------------------------- 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 @@ +"---------------------------------------------------------------------- +" 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 h :call matchadd('MultiLineHighlight', '\%'.line('.').'l') +" clear all the highlighted lines +nnoremap H :call clearmatches() -- cgit v1.2.3-70-g09d2