diff options
| -rw-r--r-- | .config/nvim/init.lua | 6 | ||||
| -rw-r--r-- | .config/vim/my/after/ftplugin/ruby.vim | 1 | ||||
| -rw-r--r-- | .config/vim/my/colors/ocean.vim | 388 | ||||
| -rw-r--r-- | .vimrc | 6 |
4 files changed, 234 insertions, 167 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index f2a65ab..b73bd4e 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -109,7 +109,7 @@ vim.o.breakindent = true vim.o.breakindentopt = vim.o.breakindentopt .. ',sbr' vim.o.showbreak = '> ' vim.o.sidescrolloff = 20 -vim.o.fillchars = 'stl: ,stlnc: ,vert: ,fold: ,diff: ' +vim.o.fillchars = 'vert: ,fold: ,diff: ' vim.o.cmdheight = 2 vim.o.list = true -- \u00ac \xc2\xac @@ -1137,7 +1137,7 @@ function vimrc.statusline.build() local fenc = vimrc.statusline.fenc_ff(bufnr) local ft = vimrc.statusline.filetype(bufnr) return string.format( - '%%#statusLineMode%s# %s %%#statusLineLeft# %s%s%s %%#StatusLine#%%=%%#statusLineRight# %s | %s | %s ', + '%%#statusLineMode%s# %s %%#statusLine# %s%s%s %%= %s | %s | %s ', mode_hl, mode, ro and ro .. ' ' or '', @@ -1154,7 +1154,7 @@ function vimrc.statusline.build() local fenc = vimrc.statusline.fenc_ff(bufnr) local ft = vimrc.statusline.filetype(bufnr) return string.format( - '%%#statusLineLeft# %s%s%s %%#StatusLine#%%=%%#statusLineRight# %s | %s | %s ', + ' %s%s%s %%= %s | %s | %s ', ro and ro .. ' ' or '', fname, mod and ' ' .. mod or '', diff --git a/.config/vim/my/after/ftplugin/ruby.vim b/.config/vim/my/after/ftplugin/ruby.vim index 4d246e8..0421a5a 100644 --- a/.config/vim/my/after/ftplugin/ruby.vim +++ b/.config/vim/my/after/ftplugin/ruby.vim @@ -11,7 +11,6 @@ FtpluginSetLocal expandtab FtpluginSetLocal shiftwidth=2 FtpluginSetLocal softtabstop=2 -let g:ruby_operators = v:true let g:ruby_space_errors = v:true diff --git a/.config/vim/my/colors/ocean.vim b/.config/vim/my/colors/ocean.vim index c7f2bda..09866fd 100644 --- a/.config/vim/my/colors/ocean.vim +++ b/.config/vim/my/colors/ocean.vim @@ -6,165 +6,233 @@ let g:colors_name = 'ocean' -let s:dark = { - \ 'NONE' : 'NONE', - \ 'bg' : '#101020', - \ 'fg' : '#b1b1c8', - \ 'gray1' : '#a7a7a7', - \ 'gray2' : '#353535', - \ 'gray3' : '#464646', - \ 'gray4' : '#252525', - \ 'red' : '#a65f49', - \ 'red2' : '#2e1f28', - \ 'orange' : '#deab52', - \ 'yellow' : '#a68f49', - \ 'yellow2' : '#a89562', - \ 'yellow3' : '#5c5241', - \ 'green' : '#c4e088', - \ 'blue' : '#6e6eff', - \ 'blue2' : '#70b0ff', - \ 'diff_add' : '#202050', - \ 'diff_change' : '#204020', - \ 'diff_delete' : '#402020', - \ 'diff_text' : '#3e6333', - \ 'visual' : '#303060', - \ 'comment' : '#8686bf', - \ 'cursor' : '#5b5bb6', - \ } - -let s:light = { - \ 'NONE' : 'NONE', - \ 'bg' : '#f5f5ff', - \ 'fg' : '#203050', - \ 'gray1' : '#4f4f4f', - \ 'gray2' : '#bebebe', - \ 'gray3' : '#aeaeae', - \ 'gray4' : '#cecece', - \ 'red' : '#d77253', - \ 'red2' : '#dcc8c2', - \ 'orange' : '#e79230', - \ 'yellow' : '#cba224', - \ 'yellow2' : '#af8e29', - \ 'yellow3' : '#c6b683', - \ 'green' : '#6f9226', - \ 'blue' : '#6e6eff', - \ 'blue2' : '#6f8fff', - \ 'diff_add' : '#202050', - \ 'diff_change' : '#204020', - \ 'diff_delete' : '#402020', - \ 'diff_text' : '#c4ff88', - \ 'visual' : '#f0f0d0', - \ 'comment' : '#a0a0e0', - \ 'cursor' : '#5b5bb6', - \ } - - -function! s:hi(group_name, guifg, guibg, ...) abort - let attributes = get(a:000, 0, 'NONE') - " Even if 'termguicolors' is enabled the attribute "gui" is ignored, - " instead, "cterm" is used. - execute printf('hi %s guifg=%s guibg=%s gui=%s cterm=%s', - \ a:group_name, - \ s:pallete[a:guifg], s:pallete[a:guibg], attributes, attributes) +" Color palette {{{1 + +if &background ==# 'dark' + let s:palette = { + \ 'NONE': 'NONE', + \ 'fg': '#b1b1c8', + \ 'bg': '#101020', + \ 'blue': '#6e6eff', + \ 'blue-bg': '#202050', + \ 'blue2': '#70b0ff', + \ 'comment': '#8686bf', + \ 'cursor': '#5b5bb6', + \ 'gray': '#353535', + \ 'gray2': '#353536', + \ 'green': '#c4e088', + \ 'green-bg': '#204020', + \ 'orange': '#deab52', + \ 'orange2': '#ff7100', + \ 'red': '#a65f49', + \ 'red-bg': '#402020', + \ 'selection': '#303060', + \ 'yellow': '#a68f49', + \ 'yellow2': '#a89562', + \ 'yellow3': '#5c5241', + \ } +else + let s:palette = { + \ 'NONE': 'NONE', + \ 'fg': '#203050', + \ 'bg': '#f5f5ff', + \ 'blue': '#6e6eff', + \ 'blue-bg': '#202050', + \ 'blue2': '#6f8fff', + \ 'comment': '#a0a0e0', + \ 'cursor': '#5b5bb6', + \ 'gray': '#bebebe', + \ 'gray2': '#bebebf', + \ 'green': '#6f9226', + \ 'green-bg': '#204020', + \ 'orange': '#e79230', + \ 'orange2': '#ff7100', + \ 'red': '#d77253', + \ 'red-bg': '#402020', + \ 'selection': '#f0f0d0', + \ 'yellow': '#cba224', + \ 'yellow2': '#af8e29', + \ 'yellow3': '#c6b683', + \ } +endif + + + +" Semantic highlight group {{{1 + +function! s:hl(group_name, guifg, guibg, attr) abort + execute printf('hi! ocean%s guifg=%s guibg=%s gui=%s cterm=%s', + \ a:group_name, + \ s:palette[a:guifg], + \ s:palette[a:guibg], + \ a:attr, + \ a:attr) endfunction -command! -nargs=* - \ Hi - \ call s:hi(<f-args>) - - - -let s:pallete = &background ==# 'dark' ? s:dark : s:light - -Hi ColorColumn NONE red2 -Hi Comment comment NONE -Hi Constant red NONE -Hi Cursor fg cursor -Hi DiffAdd NONE diff_add -Hi DiffChange NONE diff_change -Hi DiffDelete NONE diff_delete -Hi DiffText NONE diff_text -Hi EndOfBuffer bg bg -Hi Error red NONE -Hi Identifier green NONE -Hi LineNr gray1 visual -Hi MatchParen NONE NONE -Hi MoreMsg comment NONE -Hi Normal fg bg -Hi PMenu fg gray2 -Hi PMenuSbar NONE gray2 -Hi PMenuSel fg visual -Hi PMenuThumb NONE gray4 -Hi PreProc orange NONE -Hi Search bg yellow3 bold -Hi Special red NONE -Hi SpecialComment comment NONE bold -Hi SpecialKey gray2 NONE -Hi SpellBad red NONE underline -Hi SpellCap red NONE underline -Hi SpellLocal yellow2 NONE underline -Hi SpellRare yellow2 NONE underline -Hi Statement blue NONE -Hi StatusLine gray1 gray2 -Hi StatusLineNC gray1 gray3 -Hi String yellow NONE -Hi Title orange NONE -Hi Todo fg NONE bold -Hi Type blue2 NONE -Hi Underlined NONE NONE underline -Hi Visual NONE visual -Hi WarningMsg yellow2 NONE bold - - -hi! link Character String -hi! link CursorColumn CursorLine -hi! link CursorIM Cursor -hi! link CursorLine Visual -hi! link CursorLineNr Normal -hi! link Directory Type -hi! link ErrorMsg Error -hi! link FoldColumn LineNr -hi! link Folded Comment -hi! link IncSearch Search -hi! link ModeMsg Comment -hi! link NonText SpecialKey -hi! link Operator Identifier -hi! link Question MoreMsg -hi! link SignColumn LineNr -hi! link TabLine StatusLineNC -hi! link TabLineFill EndOfBuffer -hi! link TabLineSel StatusLine -hi! link VertSplit StatusLine -hi! link WildMenu Title - - - -hi! link YankRoundRegion DiffChange - -hi! link OperatorSandwichBuns DiffChange -hi! link OperatorSandwichStuff DiffChange -hi! link OperatorSandwichDelete DiffChange -hi! link OperatorSandwichAdd OperatorSandwichBuns - -hi EasyMotionShade guifg=#4d4d4d guibg=NONE gui=NONE cterm=NONE -hi EasyMotionTarget guifg=#ff7100 guibg=NONE gui=underline cterm=underline -hi! link EasyMotionMoveHL IncSearch - -hi statusLineModeNormal guifg=NONE guibg=NONE gui=bold cterm=bold -hi statusLineModeInsert guifg=NONE guibg=NONE gui=bold cterm=bold -hi statusLineModeVisual guifg=NONE guibg=NONE gui=bold cterm=bold -hi statusLineModeOperator guifg=NONE guibg=NONE gui=bold cterm=bold -hi statusLineModeReplace guifg=NONE guibg=NONE gui=bold cterm=bold -hi statusLineModeCommand guifg=NONE guibg=NONE gui=bold cterm=bold -hi statusLineModeTerminal guifg=NONE guibg=NONE gui=bold cterm=bold -hi statusLineModeOther guifg=NONE guibg=NONE gui=bold cterm=bold -hi statusLineLeft guifg=#b7b7b7 guibg=#606060 gui=NONE cterm=NONE -hi statusLineRight guifg=#b7b7b7 guibg=#606060 gui=NONE cterm=NONE - - - -unlet s:pallete -unlet s:dark -unlet s:light -delfunction s:hi -delcommand Hi + +call s:hl('AnalysisError', 'red', 'NONE', 'underline') +call s:hl('AnalysisWarning', 'yellow2', 'NONE', 'underline') +call s:hl('Cursor', 'fg', 'cursor', 'NONE') +call s:hl('DecorationBold', 'NONE', 'NONE', 'bold') +call s:hl('DecorationUnderlined', 'NONE', 'NONE', 'underline') +call s:hl('DiffAdd', 'NONE', 'blue-bg', 'NONE') +call s:hl('DiffChange', 'NONE', 'green-bg', 'NONE') +call s:hl('DiffDelete', 'NONE', 'red-bg', 'NONE') +call s:hl('DiffText', 'NONE', 'green-bg', 'underline') +call s:hl('Error', 'red', 'NONE', 'NONE') +call s:hl('Hidden', 'bg', 'bg', 'NONE') +call s:hl('Normal', 'fg', 'bg', 'NONE') +call s:hl('Prompt', 'comment', 'NONE', 'bold') +call s:hl('Search', 'bg', 'yellow3', 'NONE') +call s:hl('Special', 'red', 'NONE', 'NONE') +call s:hl('SpecialKey', 'gray', 'NONE', 'NONE') +call s:hl('SyntaxComment', 'comment', 'NONE', 'NONE') +call s:hl('SyntaxCommentSpecial', 'fg', 'NONE', 'bold') +call s:hl('SyntaxConstant', 'red', 'NONE', 'NONE') +call s:hl('SyntaxIdentifier', 'green', 'NONE', 'NONE') +call s:hl('SyntaxStatement', 'blue', 'NONE', 'bold') +call s:hl('SyntaxStatement2', 'blue', 'NONE', 'NONE') +call s:hl('SyntaxString', 'yellow', 'NONE', 'NONE') +call s:hl('SyntaxType', 'blue2', 'NONE', 'NONE') +call s:hl('Title', 'orange', 'NONE', 'NONE') +call s:hl('UiCompletion', 'fg', 'gray', 'NONE') +call s:hl('UiSelection', 'NONE', 'selection', 'NONE') +call s:hl('UiStatusLine', 'fg', 'gray', 'NONE') +call s:hl('UiStatusLineNC', 'fg', 'gray2', 'NONE') +call s:hl('UiStatusLineModeCommand', 'bg', 'blue', 'bold') +call s:hl('UiStatusLineModeInsert', 'bg', 'green', 'bold') +call s:hl('UiStatusLineModeNormal', 'bg', 'blue', 'bold') +call s:hl('UiStatusLineModeOperator', 'bg', 'blue', 'bold') +call s:hl('UiStatusLineModeOther', 'bg', 'blue', 'bold') +call s:hl('UiStatusLineModeReplace', 'bg', 'red', 'bold') +call s:hl('UiStatusLineModeTerminal', 'bg', 'blue', 'bold') +call s:hl('UiStatusLineModeVisual', 'bg', 'orange', 'bold') +call s:hl('UiTarget', 'orange2', 'NONE', 'underline') +call s:hl('Warning', 'yellow2', 'NONE', 'NONE') + +delfunction! s:hl + + + +" Highlight link {{{1 + +" :sort /hi! link \w\+ \+/ + +" Vim builtins {{{2 + +hi! link SpellBad oceanAnalysisError +hi! link SpellCap oceanAnalysisError +hi! link SpellLocal oceanAnalysisWarning +hi! link SpellRare oceanAnalysisWarning +hi! link Cursor oceanCursor +hi! link CursorIM oceanCursor +hi! link Underlined oceanDecorationUnderlined +hi! link DiffAdd oceanDiffAdd +hi! link DiffChange oceanDiffChange +hi! link DiffDelete oceanDiffDelete +hi! link DiffText oceanDiffText +hi! link Error oceanError +hi! link ErrorMsg oceanError +hi! link EndOfBuffer oceanHidden +hi! link TabLineFill oceanHidden +hi! link MatchParen oceanHidden +hi! link CursorLineNr oceanNormal +hi! link Normal oceanNormal +hi! link PMenu oceanUiCompletion +hi! link PMenuSbar oceanUiCompletion +hi! link PMenuThumb oceanUiCompletion +hi! link MoreMsg oceanPrompt +hi! link Question oceanPrompt +hi! link IncSearch oceanSearch +hi! link Search oceanSearch +hi! link CursorColumn oceanUiSelection +hi! link CursorLine oceanUiSelection +hi! link FoldColumn oceanUiSelection +hi! link LineNr oceanUiSelection +hi! link PMenuSel oceanUiSelection +hi! link SignColumn oceanUiSelection +hi! link Visual oceanUiSelection +hi! link Special oceanSpecial +hi! link NonText oceanSpecialKey +hi! link SpecialKey oceanSpecialKey +hi! link TabLineSel oceanUiStatusLine +hi! link VertSplit oceanUiStatusLine +hi! link TabLine oceanUiStatusLine +hi! link Comment oceanSyntaxComment +hi! link Folded oceanSyntaxComment +hi! link ModeMsg oceanSyntaxComment +hi! link SpecialComment oceanSyntaxCommentSpecial +hi! link Todo oceanSyntaxCommentSpecial +hi! link Constant oceanSyntaxConstant +hi! link Identifier oceanSyntaxIdentifier +hi! link Statement oceanSyntaxStatement +hi! link Operator oceanSyntaxStatement2 +hi! link PreProc oceanSyntaxStatement2 +hi! link Character oceanSyntaxString +hi! link String oceanSyntaxString +hi! link Directory oceanSyntaxType +hi! link Type oceanSyntaxType +hi! link Title oceanTitle +hi! link WildMenu oceanTitle +hi! link ColorColumn oceanUiSelection +hi! link WarningMsg oceanWarning + + +" 'statusline' and 'tabline' {{{2 + +" Cited from ':h hl-StatusLineNC': +" > Note: if this is equal to "StatusLine" Vim will use "^^^" in +" > the status line of the current window. +hi! link StatusLine oceanUiStatusLine +hi! link StatusLineNC oceanUiStatusLineNC +hi! link statusLineModeNormal oceanUiStatusLineModeNormal +hi! link statusLineModeInsert oceanUiStatusLineModeInsert +hi! link statusLineModeVisual oceanUiStatusLineModeVisual +hi! link statusLineModeOperator oceanUiStatusLineModeOperator +hi! link statusLineModeReplace oceanUiStatusLineModeReplace +hi! link statusLineModeCommand oceanUiStatusLineModeCommand +hi! link statusLineModeTerminal oceanUiStatusLineModeTerminal +hi! link statusLineModeOther oceanUiStatusLineModeOther + + +" Third-party plugins {{{2 + +hi! link YankRoundRegion oceanUiSelection + +hi! link OperatorSandwichAdd oceanUiSelection +hi! link OperatorSandwichBuns oceanUiSelection +hi! link OperatorSandwichChange oceanUiSelection +hi! link OperatorSandwichDelete oceanUiSelection + +hi! link EasyMotionMoveHL oceanSearch +hi! link EasyMotionTarget oceanUiTarget + + +" File types {{{2 + +" c {{{3 + +hi! link cOctalZero oceanConstant + +" cpp {{{3 + +hi! link cppRawStringDelimiter oceanSyntaxString + +" html {{{3 + +hi! link htmlEndTag oceanSyntaxStatement2 +hi! link htmlTag oceanSyntaxStatement2 +hi! link htmlTagName oceanSyntaxStatement2 + +" php {{{3 + +hi! link phpParent oceanNormal +hi! link phpOperator oceanNormal +hi! link phpRelation oceanNormal +hi! link phpDocTags oceanSyntaxCommentSpecial +hi! link phpSpecialFunction oceanSyntaxIdentifier + +" ruby {{{3 + +hi! link rubyDataDirective oceanSyntaxStatement2 +hi! link rubyStringDelimiter oceanSyntaxString @@ -112,7 +112,7 @@ set breakindentopt+=sbr let &showbreak = '> ' set sidescrolloff=20 set display=lastline -let &fillchars = 'stl: ,stlnc: ,vert: ,fold: ,diff: ' +let &fillchars = 'vert: ,fold: ,diff: ' set cmdheight=2 set list let &listchars = "eol:\u00ac,tab:\u25b8 ,trail:\u00b7,extends:\u00bb,precedes:\u00ab" @@ -1206,7 +1206,7 @@ function! Statusline_build() abort let fenc = s:statusline_fenc_ff(bufnr) let ft = s:statusline_filetype(bufnr) return printf( - \ '%%#statusLineMode%s# %s %%#statusLineLeft# %s%s%s %%#StatusLine#%%=%%#statusLineRight# %s | %s | %s ', + \ '%%#statusLineMode%s# %s %%#statusLine# %s%s%s %%= %s | %s | %s ', \ mode_hl, \ mode, \ empty(ro) ? '' : ro . ' ', @@ -1223,7 +1223,7 @@ function! Statusline_build() abort let fenc = s:statusline_fenc_ff(bufnr) let ft = s:statusline_filetype(bufnr) return printf( - \ '%%#statusLineLeft# %s%s%s %%#StatusLine#%%=%%#statusLineRight# %s | %s | %s ', + \ ' %s%s%s %%= %s | %s | %s ', \ empty(ro) ? '' : ro . ' ', \ fname, \ empty(mod) ? '' : ' ' . mod, |
