From 1909413718c5db77b621c61f26dcbf9b914f263a Mon Sep 17 00:00:00 2001 From: Nachuan Tang Date: Sat, 23 Jul 2022 19:31:21 -0400 Subject: [PATCH 1/6] change theme --- .vimrc.bundles | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/.vimrc.bundles b/.vimrc.bundles index 6dd382d..ca37283 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -82,7 +82,6 @@ " vim theme " { - Plug 'danilo-augusto/vim-afterglow' Plug 'NLKNguyen/papercolor-theme' " } @@ -90,6 +89,7 @@ Plug 'xiyaowong/nvim-transparent' endif Plug 'EdenEast/nightfox.nvim' + Plug 'catppuccin/vim', { 'as': 'catppuccin' } call plug#end() @@ -214,7 +214,13 @@ if g:vim_type == 'nvim' && g:vim_version > 0.5 :TransparentEnable elseif g:theme_color == 'dark' - let g:afterglow_inherit_background=1 + let g:PaperColor_Theme_Options = { + \ 'theme': { + \ 'default.dark': { + \ 'transparent_background': 1 + \ } + \ } + \ } execute("colorscheme " . g:dark_theme) elseif g:theme_color == 'light' let g:PaperColor_Theme_Options = { @@ -232,7 +238,13 @@ if g:vim_type == 'nvim' && g:vim_version > 0.5 :TransparentDisable elseif g:theme_color == 'dark' - let g:afterglow_inherit_background=0 + let g:PaperColor_Theme_Options = { + \ 'theme': { + \ 'default.dark': { + \ 'transparent_background': 0 + \ } + \ } + \ } execute("colorscheme " . g:dark_theme) elseif g:theme_color == 'light' let g:PaperColor_Theme_Options = { @@ -276,20 +288,17 @@ " let g:dark_theme = 'github_dark' " let g:light_theme = 'github_light' if isdirectory(expand(plugin_dir . "/nightfox.nvim")) && has('nvim') && g:vim_version >= 0.5 - "let g:dark_theme = 'Nightfox' - let g:dark_theme = 'Nordfox' - let g:light_theme = 'Dayfox' - + "let g:dark_theme = 'nordfox' + let g:light_theme = 'dawnfox' + let g:dark_theme = 'nightfox' + let g:airline_dark_theme = "hybrid" " } " { " vim theme - elseif isdirectory(expand(plugin_dir . "/vim-afterglow")) - if isdirectory(expand(plugin_dir . "/papercolor-theme")) - let g:light_theme = 'PaperColor' - endif - "let g:afterglow_inherit_background=1 - let g:dark_theme = 'afterglow' + elseif isdirectory(expand(plugin_dir . "/papercolor-theme")) + let g:light_theme = 'PaperColor' + let g:dark_theme = 'PaperColor' endif " } From ade97984e0c1e7c2c39dc6152aa63347ffa406d7 Mon Sep 17 00:00:00 2001 From: Donaldttt Date: Sat, 23 Jul 2022 19:41:11 -0400 Subject: [PATCH 2/6] fix ui problem --- .exp-coc-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.exp-coc-config b/.exp-coc-config index 2aecf19..f0454d5 100644 --- a/.exp-coc-config +++ b/.exp-coc-config @@ -21,7 +21,7 @@ set shortmess+=c " Always show the signcolumn, otherwise it would shift the text each time " diagnostics appear/become resolved. -set signcolumn=yes +"set signcolumn=yes " Use tab for trigger completion with characters ahead and navigate. " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by From 5b2d6ffc0dca2907d40379ad7a93e6dd10d6afb0 Mon Sep 17 00:00:00 2001 From: Donaldttt Date: Sat, 23 Jul 2022 19:47:26 -0400 Subject: [PATCH 3/6] fix install script --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index eb79799..9527356 100755 --- a/install.sh +++ b/install.sh @@ -18,7 +18,7 @@ success() { msg "\33[32m[✔]\33[0m ${1}${2}" } -function fatal_error() { +fatal_error() { msg "\33[31m[✘]\33[0m ${1}${2}" exit 1 } From 13ed406f40bceb3457dd759fc36627a726b593e5 Mon Sep 17 00:00:00 2001 From: Donaldttt Date: Sat, 23 Jul 2022 19:54:14 -0400 Subject: [PATCH 4/6] fix bug --- .vimrc.bundles | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.vimrc.bundles b/.vimrc.bundles index ca37283..aaf32e8 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -85,9 +85,9 @@ Plug 'NLKNguyen/papercolor-theme' " } - if g:vim_type == 'nvim' && g:vim_version > 0.5 - Plug 'xiyaowong/nvim-transparent' - endif + " only work with nvim > 0.5 + Plug 'xiyaowong/nvim-transparent' + Plug 'EdenEast/nightfox.nvim' Plug 'catppuccin/vim', { 'as': 'catppuccin' } From 3b7136de3e13eb0329b5d751a4e65219d5954de8 Mon Sep 17 00:00:00 2001 From: Donaldttt Date: Sat, 23 Jul 2022 23:11:12 -0400 Subject: [PATCH 5/6] fix bugs --- .vimrc.bundles | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.vimrc.bundles b/.vimrc.bundles index aaf32e8..d7f67a6 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -86,7 +86,11 @@ " } " only work with nvim > 0.5 - Plug 'xiyaowong/nvim-transparent' + " For other versions, just loading the plugin may + " cause error + if g:vim_type == 'nvim' && g:vim_version > 0.5 + Plug 'xiyaowong/nvim-transparent' + endif Plug 'EdenEast/nightfox.nvim' Plug 'catppuccin/vim', { 'as': 'catppuccin' } @@ -297,6 +301,7 @@ " { " vim theme elseif isdirectory(expand(plugin_dir . "/papercolor-theme")) + " improve coc color in this theme let g:light_theme = 'PaperColor' let g:dark_theme = 'PaperColor' endif From 99f7c26cb2efb2e0546ac512fb1f9669fd5c9bc8 Mon Sep 17 00:00:00 2001 From: Nachuan Tang Date: Sun, 24 Jul 2022 02:36:39 -0400 Subject: [PATCH 6/6] improve plugin config --- .vimrc | 13 +++----- .vimrc.bundles | 90 +++++++++++++++++++++----------------------------- 2 files changed, 42 insertions(+), 61 deletions(-) diff --git a/.vimrc b/.vimrc index a4eaba0..8cb2fb1 100644 --- a/.vimrc +++ b/.vimrc @@ -225,7 +225,8 @@ " Functions { - " Initialize directories { + " Initialize directories for undo, swap, viewdir + " to ~/.vim/.vim* function! InitializeDirectories() let parent = $HOME let prefix = 'vim' @@ -238,11 +239,6 @@ let dir_list['undo'] = 'undodir' endif - " To specify a different directory in which to place the vimbackup, - " vimviews, vimundo, and vimswap files/directories, add the following to - " your .vimrc.before.local file: - " let g:spf13_consolidated_directory = - " eg: let g:spf13_consolidated_directory = $HOME . '/.vim/' let g:spf13_consolidated_directory = $HOME . '/.vim/.' if exists('g:spf13_consolidated_directory') let common_dir = g:spf13_consolidated_directory . prefix @@ -267,9 +263,8 @@ endfor endfunction call InitializeDirectories() - " } - " Shell command { + " Shell command function! s:RunShellCommand(cmdline) botright new @@ -289,7 +284,7 @@ command! -complete=file -nargs=+ Shell call s:RunShellCommand() " e.g. Grep current file for : Shell grep -Hn % - " } + " Fix file type error for typescript autocmd BufNewFile,BufRead *.ts set filetype=typescript diff --git a/.vimrc.bundles b/.vimrc.bundles index ca37283..e3de258 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -13,59 +13,44 @@ let config_dir = '~/.dotfiles/' let plugin_dir = '~/.vim/plugged/' let g:vim_dir = '~/.vim/' + call plug#begin(plugin_dir) Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'rust-lang/rust.vim' - " syntax highlighting(and more) for typescript - " { - Plug 'leafgarland/typescript-vim' - " } + Plug 'leafgarland/typescript-vim' + " { Plug 'alvan/vim-closetag' let g:closetag_filenames = '*.html,*.xhtml,*.phtml, *.js' " } - "{ - "Plug 'altercation/vim-colors-solarized' - "} - Plug 'scrooloose/nerdtree' - " for markdown{ Plug 'godlygeek/tabular' - Plug 'preservim/vim-markdown' + " for markdown{ + Plug 'preservim/vim-markdown' "} " for window resize{ Plug 'simeji/winresizer' - let g:winresizer_start_key = '' - let g:winresizer_vert_resize = 2 + let g:winresizer_start_key = '' + let g:winresizer_vert_resize = 2 let g:winresizer_horiz_resize = 2 " } Plug 'tpope/vim-surround' Plug 'rhysd/conflict-marker.vim' + " { - Plug 'jiangmiao/auto-pairs' - "let g:AutoPairsFlyMode = 1 - + Plug 'jiangmiao/auto-pairs' + "let g:AutoPairsFlyMode = 1 " } - " { Plug 'mg979/vim-visual-multi' - " } - "if has('nvim') && str2float(g:nvim_version) >= 0.5 - " Plug 'nvim-lualine/lualine.nvim' - "else + Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' - "endif - - " For nvim-bufferline - " { - "Plug 'kyazdani42/nvim-web-devicons' - "Plug 'akinsho/nvim-bufferline.lua' - " } + Plug 'bling/vim-bufferline' Plug 'easymotion/vim-easymotion' Plug 'nathanaelkane/vim-indent-guides' @@ -75,11 +60,6 @@ Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } endif - " nvim support only theme - " { - "Plug 'projekt0n/github-nvim-theme' - " } - " vim theme " { Plug 'NLKNguyen/papercolor-theme' @@ -93,13 +73,22 @@ call plug#end() -" Helper functions -" { - -" } - " Plugin Preferences " { + " godlygeek/tabular { + if isdirectory(expand(plugin_dir . "/tabular")) + nmap t= :Tabularize /= + vmap t= :Tabularize /= + + nmap t\| :Tab /\| + vmap t\| :Tab /\| + + nmap t: :Tab /:\zs + vmap t: :Tab /:\zs + endif + + " } + " xiyaowong/nvim-transparent { " } @@ -113,17 +102,17 @@ "let NERDTreeShowBookmarks=1 "let NERDTreeIgnore=['\.py[cd]$', '\~$', '\.swo$', '\.swp$', '^\.git$', '^\.hg$', '^\.svn$', '\.bzr$'] - let NERDTreeChDirMode=0 - let NERDTreeQuitOnOpen=1 - let NERDTreeMouseMode=2 - let NERDTreeShowHidden=1 - let NERDTreeKeepTreeInNewTab=1 + let NERDTreeChDirMode = 0 + let NERDTreeQuitOnOpen = 1 + let NERDTreeMouseMode = 2 + let NERDTreeShowHidden = 1 + let NERDTreeKeepTreeInNewTab = 1 endif " } " indent_guides { if isdirectory(expand(plugin_dir . "/vim-indent-guides/")) - let g:indent_guides_start_level = 2 - let g:indent_guides_guide_size = 1 + let g:indent_guides_start_level = 2 + let g:indent_guides_guide_size = 1 let g:indent_guides_enable_on_vim_startup = 0 map i :IndentGuidesToggle @@ -137,10 +126,10 @@ " vim-airline { " Set configuration options for the statusline plugin vim-airline. " Use the powerline theme and optionally enable powerline symbols. - let g:airline_section_b = '' - let g:airline_section_z = '' - let g:airline_section_y = '' - let g:airline_section_x = '' + let g:airline_section_b = '' + let g:airline_section_z = '' + let g:airline_section_y = '' + let g:airline_section_x = '' let g:airline_section_warning = '' "let g:airline#extensions#tabline#left_sep = '' "let g:airline#extensions#tabline#left_alt_sep = '|' @@ -164,11 +153,8 @@ " coc-tsserver: javascript " coc-pyright: python " coc-clangd: c/c++, may need to install clangd seperatly - let g:coc_global_extensions = ['coc-pyright', 'coc-rls'] + let g:coc_global_extensions = ['coc-pyright', 'coc-rls', 'coc-clangd', 'coc-tsserver', 'coc-html', 'coc-cmake', 'coc-sql', 'coc-json'] - " space-d jump to definition if coc is installed - "nnoremap d :call CocAction('jumpDefinition', v: false) - "nnoremap r :call CocAction('jumpReferences', v: false) if filereadable(expand(config_dir . "/.exp-coc-config")) exec "source " . config_dir . "/.exp-coc-config" endif