fix some problem displaying everforest theme
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
" get current neovim version
|
" get current neovim version
|
||||||
let g:vim_version = -1
|
let g:vim_version = -1
|
||||||
|
|
||||||
|
" vim runtime folder
|
||||||
|
let g:vim_dir = expand('~/.vim/')
|
||||||
|
|
||||||
" dotfile location
|
" dotfile location
|
||||||
let g:mydotfiles_directory = expand('~/.dotfiles/')
|
let g:mydotfiles_directory = expand('~/.dotfiles/')
|
||||||
let after_directory = g:mydotfiles_directory . 'config/vi-plugs/coc-theme/after/'
|
let after_directory = g:mydotfiles_directory . 'config/vi-plugs/coc-theme/after/'
|
||||||
@@ -141,6 +144,7 @@
|
|||||||
"set listchars=tab:•\ ,trail:•,extends:»,precedes:« " Unprintable chars mapping
|
"set listchars=tab:•\ ,trail:•,extends:»,precedes:« " Unprintable chars mapping
|
||||||
set nospell " Spell checking off
|
set nospell " Spell checking off
|
||||||
|
|
||||||
|
|
||||||
set matchpairs+=<:> " Match, to be used with %
|
set matchpairs+=<:> " Match, to be used with %
|
||||||
"set comments=sl:/*,mb:*,elx:*/ " auto format comment blocks
|
"set comments=sl:/*,mb:*,elx:*/ " auto format comment blocks
|
||||||
|
|
||||||
@@ -203,28 +207,20 @@
|
|||||||
|
|
||||||
" Functions {
|
" Functions {
|
||||||
|
|
||||||
" Initialize directories for undo, swap, viewdir
|
" Initialize directories for undo, swap, viewdir (see :h undodir, etc.)
|
||||||
" to ~/.vim/.vim*
|
" to ~/.vim/.vim*
|
||||||
function! InitializeDirectories()
|
function! InitializeDirectories()
|
||||||
let parent = $HOME
|
let common_dir = g:vim_dir
|
||||||
let prefix = 'vim'
|
|
||||||
let dir_list = {
|
let dir_list = {
|
||||||
\ 'backup': 'backupdir',
|
\ 'backupdir' : '.vimbackup',
|
||||||
\ 'views': 'viewdir',
|
\ 'viewdir' : '.vimviews',
|
||||||
\ 'swap': 'directory' }
|
\ 'directory' : '.vimswap' }
|
||||||
|
|
||||||
if has('persistent_undo')
|
if has('persistent_undo')
|
||||||
let dir_list['undo'] = 'undodir'
|
let dir_list['undodir'] = '.vimundo'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let g:spf13_consolidated_directory = $HOME . '/.vim/.'
|
for [settingname, dirname] in items(dir_list)
|
||||||
if exists('g:spf13_consolidated_directory')
|
|
||||||
let common_dir = g:spf13_consolidated_directory . prefix
|
|
||||||
else
|
|
||||||
let common_dir = parent . '/.' . prefix
|
|
||||||
endif
|
|
||||||
|
|
||||||
for [dirname, settingname] in items(dir_list)
|
|
||||||
let directory = common_dir . dirname . '/'
|
let directory = common_dir . dirname . '/'
|
||||||
if exists("*mkdir")
|
if exists("*mkdir")
|
||||||
if !isdirectory(directory)
|
if !isdirectory(directory)
|
||||||
@@ -243,41 +239,48 @@
|
|||||||
call InitializeDirectories()
|
call InitializeDirectories()
|
||||||
|
|
||||||
" Shell command
|
" Shell command
|
||||||
function! s:RunShellCommand(cmdline)
|
" function! s:RunShellCommand(cmdline)
|
||||||
botright new
|
" botright new
|
||||||
|
|
||||||
setlocal buftype=nofile
|
" setlocal buftype=nofile
|
||||||
setlocal bufhidden=delete
|
" setlocal bufhidden=delete
|
||||||
setlocal nobuflisted
|
" setlocal nobuflisted
|
||||||
setlocal noswapfile
|
" setlocal noswapfile
|
||||||
setlocal nowrap
|
" setlocal nowrap
|
||||||
setlocal filetype=shell
|
" setlocal filetype=shell
|
||||||
setlocal syntax=shell
|
" setlocal syntax=shell
|
||||||
|
|
||||||
call setline(1, a:cmdline)
|
" call setline(1, a:cmdline)
|
||||||
call setline(2, substitute(a:cmdline, '.', '=', 'g'))
|
" call setline(2, substitute(a:cmdline, '.', '=', 'g'))
|
||||||
execute 'silent $read !' . escape(a:cmdline, '%#')
|
" execute 'silent $read !' . escape(a:cmdline, '%#')
|
||||||
setlocal nomodifiable
|
" setlocal nomodifiable
|
||||||
endfunction
|
" endfunction
|
||||||
|
|
||||||
command! -complete=file -nargs=+ Shell call s:RunShellCommand(<q-args>)
|
" command! -complete=file -nargs=+ Shell call s:RunShellCommand(<q-args>)
|
||||||
" e.g. Grep current file for <search_term>: Shell grep -Hn <search_term> %
|
" e.g. Grep current file for <search_term>: Shell grep -Hn <search_term> %
|
||||||
|
|
||||||
|
" Visual mode pressing * or # searches for the current selection
|
||||||
|
" Super useful! From an idea by Michael Naumann
|
||||||
|
vnoremap <silent> * :<C-u>call VisualSelection('', '')<CR>/<C-R>=@/<CR><CR>
|
||||||
|
vnoremap <silent> # :<C-u>call VisualSelection('', '')<CR>?<C-R>=@/<CR><CR>
|
||||||
|
|
||||||
" Fix file type error for typescript
|
" Fix file type error for typescript
|
||||||
autocmd BufNewFile,BufRead *.ts set filetype=typescript
|
autocmd BufNewFile,BufRead *.ts set filetype=typescript
|
||||||
|
|
||||||
|
|
||||||
" These are to cancel the default behavior of d, D, c, C
|
" These are to cancel the default behavior of d, D, c, C
|
||||||
" to put the text they delete in the default register.
|
" to put the text they delete in the default register.
|
||||||
" Note that this means e.g. "ad won't copy the text into
|
" Note that this means e.g. "ad won't copy the text into
|
||||||
" register a anymore. You have to explicitly yank it.
|
" register a anymore. You have to explicitly yank it.
|
||||||
" TIPS: you can type :registers to view value in each registers
|
" TIPS: you can type :registers to view value in each registers
|
||||||
vnoremap p "0p
|
vnoremap y "+y
|
||||||
|
nnoremap y "+y
|
||||||
|
|
||||||
" copy to system
|
" copy to system
|
||||||
"set clipboard=unnamed
|
if g:os == 'Darwin' && g:os == 'Windows'
|
||||||
set clipboard=unnamedplus
|
set clipboard=unnamed
|
||||||
|
else
|
||||||
|
set clipboard=unnamedplus
|
||||||
|
endif
|
||||||
|
|
||||||
" fix paste mess up when using tmux
|
" fix paste mess up when using tmux
|
||||||
if &term =~ "screen"
|
if &term =~ "screen"
|
||||||
|
|||||||
+40
-25
@@ -20,7 +20,6 @@
|
|||||||
" Plugin environment
|
" Plugin environment
|
||||||
let g:mydotfiles_directory = expand('~/.dotfiles/')
|
let g:mydotfiles_directory = expand('~/.dotfiles/')
|
||||||
let s:plugin_dir = expand('~/.vim/plugged/')
|
let s:plugin_dir = expand('~/.vim/plugged/')
|
||||||
let g:vim_dir = expand('~/.vim/')
|
|
||||||
|
|
||||||
call plug#begin(s:plugin_dir)
|
call plug#begin(s:plugin_dir)
|
||||||
|
|
||||||
@@ -74,7 +73,6 @@
|
|||||||
set encoding=UTF-8
|
set encoding=UTF-8
|
||||||
Plug 'scrooloose/nerdtree'
|
Plug 'scrooloose/nerdtree'
|
||||||
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
|
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
|
||||||
" Plug 'tribela/vim-transparent'
|
|
||||||
Plug 'vim-airline/vim-airline'
|
Plug 'vim-airline/vim-airline'
|
||||||
Plug 'vim-airline/vim-airline-themes'
|
Plug 'vim-airline/vim-airline-themes'
|
||||||
" The bottom buffer display
|
" The bottom buffer display
|
||||||
@@ -121,6 +119,7 @@
|
|||||||
call plug#end()
|
call plug#end()
|
||||||
" }
|
" }
|
||||||
|
|
||||||
|
" only work for Plug.vim
|
||||||
function! HasPlug(plug_name, ...)
|
function! HasPlug(plug_name, ...)
|
||||||
let plug_dir_name = get(a:, 1, a:plug_name) " optional argument for the name of plug's folder
|
let plug_dir_name = get(a:, 1, a:plug_name) " optional argument for the name of plug's folder
|
||||||
if has_key(g:plugs, a:plug_name) && isdirectory(s:plugin_dir . "/" . plug_dir_name)
|
if has_key(g:plugs, a:plug_name) && isdirectory(s:plugin_dir . "/" . plug_dir_name)
|
||||||
@@ -239,8 +238,8 @@ endfunction
|
|||||||
|
|
||||||
" antoinemadec/coc-fzf {
|
" antoinemadec/coc-fzf {
|
||||||
if HasPlug("coc-fzf")
|
if HasPlug("coc-fzf")
|
||||||
nnoremap <silent> <space><space> :<C-u>CocFzfList<CR>
|
" nnoremap <silent> <space><space> :<C-u>CocFzfList<CR>
|
||||||
nnoremap <leader>o :<C-u>CocFzfList outline<CR>
|
" nnoremap <leader>o :<C-u>CocFzfList outline<CR>
|
||||||
endif
|
endif
|
||||||
" }
|
" }
|
||||||
|
|
||||||
@@ -250,13 +249,11 @@ endfunction
|
|||||||
let g:bufferline_modified = '+'
|
let g:bufferline_modified = '+'
|
||||||
|
|
||||||
" scrolling with fixed current buffer position
|
" scrolling with fixed current buffer position
|
||||||
let g:bufferline_rotate = 0
|
|
||||||
|
|
||||||
let g:bufferline_active_buffer_left = ''
|
let g:bufferline_active_buffer_left = ''
|
||||||
let g:bufferline_active_buffer_right = ''
|
let g:bufferline_active_buffer_right = ''
|
||||||
let g:bufferline_fixed_index = -1
|
" let g:bufferline_inactive_highlight = 'StatusLineNC'
|
||||||
let g:bufferline_inactive_highlight = 'StatusLineNC'
|
" let g:bufferline_active_highlight = 'StatusLine'
|
||||||
let g:bufferline_active_highlight = 'StatusLine'
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" }
|
" }
|
||||||
@@ -277,6 +274,9 @@ endfunction
|
|||||||
|
|
||||||
" NerdTree {
|
" NerdTree {
|
||||||
if (g:vim_type == 'vim' || g:vim_version < 0.8) && HasPlug('nerdtree')
|
if (g:vim_type == 'vim' || g:vim_version < 0.8) && HasPlug('nerdtree')
|
||||||
|
if HasPlug('vim-nerdtree-syntax-highlight')
|
||||||
|
let g:NERDTreeLimitedSyntax = 1
|
||||||
|
endif
|
||||||
let g:NERDShutUp=1
|
let g:NERDShutUp=1
|
||||||
|
|
||||||
" work around for nerdtree bug: https://github.com/preservim/nerdtree/issues/1321
|
" work around for nerdtree bug: https://github.com/preservim/nerdtree/issues/1321
|
||||||
@@ -301,8 +301,14 @@ endfunction
|
|||||||
let NERDTreeQuitOnOpen = 1
|
let NERDTreeQuitOnOpen = 1
|
||||||
let NERDTreeMouseMode = 2
|
let NERDTreeMouseMode = 2
|
||||||
let NERDTreeShowHidden = 1
|
let NERDTreeShowHidden = 1
|
||||||
let NERDTreeKeepTreeInNewTab = 1
|
|
||||||
|
|
||||||
|
if HasPlug('vim-devicons')
|
||||||
|
let NERDTreeDirArrowCollapsible = ''
|
||||||
|
let NERDTreeDirArrowExpandable = ''
|
||||||
|
else
|
||||||
|
" let NERDTreeDirArrowCollapsible = ''
|
||||||
|
" let NERDTreeDirArrowExpandable = ''
|
||||||
|
endif
|
||||||
" Exit Vim if NERDTree is the only window remaining in the only tab.
|
" Exit Vim if NERDTree is the only window remaining in the only tab.
|
||||||
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
|
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
|
||||||
endif
|
endif
|
||||||
@@ -313,7 +319,7 @@ endfunction
|
|||||||
|
|
||||||
endif
|
endif
|
||||||
" }
|
" }
|
||||||
|
|
||||||
" vim-airline {
|
" vim-airline {
|
||||||
if HasPlug("vim-airline")
|
if HasPlug("vim-airline")
|
||||||
" Set configuration options for the statusline plugin vim-airline.
|
" Set configuration options for the statusline plugin vim-airline.
|
||||||
@@ -332,10 +338,12 @@ endfunction
|
|||||||
let g:airline_section_y = ''
|
let g:airline_section_y = ''
|
||||||
let g:airline_section_z = airline#section#create(['filetype'])
|
let g:airline_section_z = airline#section#create(['filetype'])
|
||||||
let g:airline_skip_empty_sections = 1
|
let g:airline_skip_empty_sections = 1
|
||||||
let g:airline_exclude_filetypes = ['nerdtree']
|
" let g:airline_exclude_filetypes = ['nerdtree']
|
||||||
" see source for current list
|
" see source for current list
|
||||||
let g:airline#extensions#nerdtree_statusline = 0
|
let g:airline#extensions#nerdtree_statusline = 0
|
||||||
"let g:airline#extensions#bufferline#overwrite_variables = 0
|
|
||||||
|
" without this airline will overwrite some setting like bufferline_active_buffer_left, etc.
|
||||||
|
let g:airline#extensions#bufferline#overwrite_variables = 0
|
||||||
let g:airline_mode_map = {
|
let g:airline_mode_map = {
|
||||||
\ '__' : '-',
|
\ '__' : '-',
|
||||||
\ 'c' : 'C',
|
\ 'c' : 'C',
|
||||||
@@ -533,7 +541,6 @@ endfunction
|
|||||||
execute("colorscheme " . g:light_theme)
|
execute("colorscheme " . g:light_theme)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
" call TransparentBackgroundFix()
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! DisableTransparent()
|
function! DisableTransparent()
|
||||||
@@ -599,30 +606,35 @@ endfunction
|
|||||||
let g:dark_theme = 'PaperColor'
|
let g:dark_theme = 'PaperColor'
|
||||||
endif
|
endif
|
||||||
if HasPlug("everforest")
|
if HasPlug("everforest")
|
||||||
set termguicolors
|
if has('termguicolors')
|
||||||
|
set termguicolors
|
||||||
|
endif
|
||||||
let g:light_theme = 'everforest'
|
let g:light_theme = 'everforest'
|
||||||
let g:dark_theme = 'everforest'
|
let g:dark_theme = 'everforest'
|
||||||
let g:airline_dark_theme = "everforest"
|
let g:airline_dark_theme = "everforest"
|
||||||
let g:airline_light_theme = "everforest"
|
let g:airline_light_theme = "everforest"
|
||||||
" let g:everforest_background = 'soft'
|
|
||||||
let g:everforest_better_performance = 1
|
let g:everforest_better_performance = 1
|
||||||
|
" let g:everforest_background = 'soft'
|
||||||
" let g:everforest_enable_italic = 1
|
" let g:everforest_enable_italic = 1
|
||||||
|
|
||||||
function! Everforest_trans_enable()
|
function! Everforest_trans_enable()
|
||||||
let g:everforest_transparent_background = 1
|
let g:everforest_transparent_background = 2
|
||||||
colorscheme everforest
|
colorscheme everforest
|
||||||
" try
|
try
|
||||||
" execute('AirlineTheme everforest')
|
execute('AirlineTheme everforest')
|
||||||
" catch
|
catch
|
||||||
" endtry
|
endtry
|
||||||
|
" hack to fix caret characters appearing in the statusline when StatusLine
|
||||||
|
" and StatusLineNC has same highlight(https://vi.stackexchange.com/questions/15873/carets-in-status-line)
|
||||||
|
hi StatusLine guifg=#d3c6aa ctermfg=223
|
||||||
endfunction
|
endfunction
|
||||||
function! Everforest_trans_disable()
|
function! Everforest_trans_disable()
|
||||||
let g:everforest_transparent_background = 0
|
let g:everforest_transparent_background = 0
|
||||||
colorscheme everforest
|
colorscheme everforest
|
||||||
" try
|
try
|
||||||
" execute('AirlineTheme everforest')
|
execute('AirlineTheme everforest')
|
||||||
" catch
|
catch
|
||||||
" endtry
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
let g:custom_transparent_function_enable = 'Everforest_trans_enable()'
|
let g:custom_transparent_function_enable = 'Everforest_trans_enable()'
|
||||||
let g:custom_transparent_function_disable = 'Everforest_trans_disable()'
|
let g:custom_transparent_function_disable = 'Everforest_trans_disable()'
|
||||||
@@ -727,6 +739,9 @@ endfunction
|
|||||||
nnoremap <silent> <nowait> <Space>11 :call bufferline#jump(11)<CR>
|
nnoremap <silent> <nowait> <Space>11 :call bufferline#jump(11)<CR>
|
||||||
nnoremap <silent> <nowait> <Space>12 :call bufferline#jump(12)<CR>
|
nnoremap <silent> <nowait> <Space>12 :call bufferline#jump(12)<CR>
|
||||||
nnoremap <silent> <nowait> <Space>13 :call bufferline#jump(13)<CR>
|
nnoremap <silent> <nowait> <Space>13 :call bufferline#jump(13)<CR>
|
||||||
|
nnoremap <silent> <nowait> <Space>14 :call bufferline#jump(14)<CR>
|
||||||
|
nnoremap <silent> <nowait> <Space>15 :call bufferline#jump(15)<CR>
|
||||||
|
nnoremap <silent> <nowait> <Space>16 :call bufferline#jump(16)<CR>
|
||||||
end
|
end
|
||||||
|
|
||||||
" split window comform with other window management shortcuts
|
" split window comform with other window management shortcuts
|
||||||
@@ -746,5 +761,5 @@ endfunction
|
|||||||
" }
|
" }
|
||||||
|
|
||||||
if filereadable(g:mydotfiles_directory . "/config/theme.vim")
|
if filereadable(g:mydotfiles_directory . "/config/theme.vim")
|
||||||
exec "source " . g:mydotfiles_directory . "/config/theme.vim"
|
" exec "source " . g:mydotfiles_directory . "/config/theme.vim"
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user