From e7d8431e0ec6153dd84d5a399450a3218044f6c3 Mon Sep 17 00:00:00 2001 From: Nachuan Tang Date: Sat, 11 Feb 2023 07:15:30 -0500 Subject: [PATCH] . --- .vimrc.bundles | 11 ++++++----- .vimrc.lua | 15 +++++++++++++++ coc-nvim-config.vim | 3 +++ .../coc-theme/after/plugin => }/colortrans.py | 0 config/theme.vim | 18 ++++++++++++++---- install.sh | 3 +++ 6 files changed, 41 insertions(+), 9 deletions(-) rename config/{vi-plugs/coc-theme/after/plugin => }/colortrans.py (100%) diff --git a/.vimrc.bundles b/.vimrc.bundles index e674b0f..f84663a 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -128,6 +128,7 @@ " comment out this plugin if the machine doesn't have required " font install Plug 'nvim-tree/nvim-web-devicons' + Plug 'ziontee113/color-picker.nvim' endif if g:vim_version >= 0.8 Plug 'nvim-tree/nvim-tree.lua' @@ -327,7 +328,7 @@ endfunction " This must using my fork version of bufferline " - let g:bufferline_max_length = &columns - 22 + let g:bufferline_max_length = &columns - 22 function! BufferNumber() return len(g:index_to_buffer) endfunction @@ -720,10 +721,10 @@ endfunction nnoremap " :split " session related KeyBinding. These KeyBinding uses function from startify - nnoremap s :SSave - nnoremap l :SLoad - nnoremap d :SDelete! - nnoremap c :SClose + nnoremap s :SSave + nnoremap l :SLoad + nnoremap d :SDelete! + nnoremap c :SClose " } " diff --git a/.vimrc.lua b/.vimrc.lua index feb3b7d..7fb608e 100644 --- a/.vimrc.lua +++ b/.vimrc.lua @@ -16,6 +16,20 @@ local function github_theme_config() }) end +local function color_picker_nvim_config() + -- config for ziontee113/color-picker.nvim + require("color-picker").setup({ + ["keymap"] = { -- mapping example: + ["U"] = "ColorPickerSlider5Decrease", + ["O"] = "ColorPickerSlider5Increase", + }, + }) + local opts = { noremap = true, silent = true } + + vim.keymap.set("n", "cp", "PickColor", opts) + -- vim.keymap.set("i", "c", "PickColorInsert", opts) +end + local function indent_blankline_config() -- Example config in Lua require("indent_blankline").setup { @@ -205,6 +219,7 @@ if vim_version_minor >= 5 then end if vim_version_minor >= 7 then nvim_treesitter_config() + color_picker_nvim_config() -- lsp_zero_config() end if vim_version_minor >= 8 then diff --git a/coc-nvim-config.vim b/coc-nvim-config.vim index ce2c699..5b6e434 100644 --- a/coc-nvim-config.vim +++ b/coc-nvim-config.vim @@ -6,6 +6,8 @@ else inoremap coc#refresh() endif +set updatetime=300 + " Make auto-select the first completion item and notify coc.nvim to " format on enter, could be remapped by other vim plugin inoremap pumvisible() ? coc#_select_confirm() @@ -83,3 +85,4 @@ let g:coc_user_config = { call coc#config("java.jdt.ls.vmargs", '-javaagent:' . g:mydotfiles_directory . '/config/coc/java/lombok-1.18.26.jar') call coc#config("java.jdt.ls.lombokSupport.enabled", v:false) call coc#config("java.inlayHints.parameterNames.enabled", v:false) +call coc#config("inlayHint.enable", v:false) diff --git a/config/vi-plugs/coc-theme/after/plugin/colortrans.py b/config/colortrans.py similarity index 100% rename from config/vi-plugs/coc-theme/after/plugin/colortrans.py rename to config/colortrans.py diff --git a/config/theme.vim b/config/theme.vim index d8d3ffd..cba118d 100644 --- a/config/theme.vim +++ b/config/theme.vim @@ -2,7 +2,6 @@ function! GetHi(group, term) " Store output of group to variable let output = execute('hi ' . a:group) - " Find the term we're looking for return matchstr(output, a:term.'=\zs\S*') endfunction @@ -37,7 +36,7 @@ function! ThemeFix() endfunction function! GetRidOfBg() - let hiGroups = ['CocErrorSign'] + let hiGroups = ['CocErrorSign', 'CocWarningSign', 'CocHintSign'] for group in hiGroups if hlexists(group) execute('hi ' . group . ' ctermbg=none') @@ -46,10 +45,21 @@ function! GetRidOfBg() endfunction function! CocThemeFix() - hi CocErrorHighlight cterm=underline ctermfg=124 ctermbg=none + hi CocErrorHighlight cterm=underline ctermfg=124 ctermbg=none " Keyword at the error position highlight + hi CocErrorSign ctermbg=none ctermfg=124 " Error Sign at the sign column highlight + + hi CocWarningSign ctermbg=none ctermfg=214 " Warning Sign at the sign column highlight + hi CocHintSign ctermbg=none ctermfg=214 " Hint Sign at the sign column highlight + hi CocUnusedHighlight cterm=underline ctermfg=214 ctermbg=none " Unused variable/function etc. highlight + hi CocWarningHighlight cterm=underline ctermfg=214 ctermbg=none " Warning variable/function etc. highlight + + hi CocInfoHighlight ctermfg=207 ctermbg=none " Info variable/function etc. highlight + hi CocInfoSign ctermbg=none ctermfg=207 " Info Sign at the sign column highlight + + hi Todo ctermbg=none ctermfg=214 " Info Sign at the sign column highlight + hi Error cterm=underline ctermfg=124 ctermbg=none hi javaError cterm=underline ctermfg=124 ctermbg=none - call GetRidOfBg() endfunction call CocThemeFix() diff --git a/install.sh b/install.sh index f9f8baa..e8125b4 100755 --- a/install.sh +++ b/install.sh @@ -43,6 +43,9 @@ program_exists() { # return 0 if exists # 1 not contain string # 2 file not exist +# when using this function: +# file path should not be quoted but like this: +# file_contains 'abc' file_path file_contains(){ if [ -f "$2" ]; then a=`grep "$1" $2`