fix some problem displaying everforest theme
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
" get current neovim version
|
||||
let g:vim_version = -1
|
||||
|
||||
" vim runtime folder
|
||||
let g:vim_dir = expand('~/.vim/')
|
||||
|
||||
" dotfile location
|
||||
let g:mydotfiles_directory = expand('~/.dotfiles/')
|
||||
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 nospell " Spell checking off
|
||||
|
||||
|
||||
set matchpairs+=<:> " Match, to be used with %
|
||||
"set comments=sl:/*,mb:*,elx:*/ " auto format comment blocks
|
||||
|
||||
@@ -203,28 +207,20 @@
|
||||
|
||||
" Functions {
|
||||
|
||||
" Initialize directories for undo, swap, viewdir
|
||||
" Initialize directories for undo, swap, viewdir (see :h undodir, etc.)
|
||||
" to ~/.vim/.vim*
|
||||
function! InitializeDirectories()
|
||||
let parent = $HOME
|
||||
let prefix = 'vim'
|
||||
let common_dir = g:vim_dir
|
||||
let dir_list = {
|
||||
\ 'backup': 'backupdir',
|
||||
\ 'views': 'viewdir',
|
||||
\ 'swap': 'directory' }
|
||||
\ 'backupdir' : '.vimbackup',
|
||||
\ 'viewdir' : '.vimviews',
|
||||
\ 'directory' : '.vimswap' }
|
||||
|
||||
if has('persistent_undo')
|
||||
let dir_list['undo'] = 'undodir'
|
||||
let dir_list['undodir'] = '.vimundo'
|
||||
endif
|
||||
|
||||
let g:spf13_consolidated_directory = $HOME . '/.vim/.'
|
||||
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)
|
||||
for [settingname, dirname] in items(dir_list)
|
||||
let directory = common_dir . dirname . '/'
|
||||
if exists("*mkdir")
|
||||
if !isdirectory(directory)
|
||||
@@ -243,41 +239,48 @@
|
||||
call InitializeDirectories()
|
||||
|
||||
" Shell command
|
||||
function! s:RunShellCommand(cmdline)
|
||||
botright new
|
||||
" function! s:RunShellCommand(cmdline)
|
||||
" botright new
|
||||
|
||||
setlocal buftype=nofile
|
||||
setlocal bufhidden=delete
|
||||
setlocal nobuflisted
|
||||
setlocal noswapfile
|
||||
setlocal nowrap
|
||||
setlocal filetype=shell
|
||||
setlocal syntax=shell
|
||||
" setlocal buftype=nofile
|
||||
" setlocal bufhidden=delete
|
||||
" setlocal nobuflisted
|
||||
" setlocal noswapfile
|
||||
" setlocal nowrap
|
||||
" setlocal filetype=shell
|
||||
" setlocal syntax=shell
|
||||
|
||||
call setline(1, a:cmdline)
|
||||
call setline(2, substitute(a:cmdline, '.', '=', 'g'))
|
||||
execute 'silent $read !' . escape(a:cmdline, '%#')
|
||||
setlocal nomodifiable
|
||||
endfunction
|
||||
" call setline(1, a:cmdline)
|
||||
" call setline(2, substitute(a:cmdline, '.', '=', 'g'))
|
||||
" execute 'silent $read !' . escape(a:cmdline, '%#')
|
||||
" setlocal nomodifiable
|
||||
" 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> %
|
||||
|
||||
|
||||
" 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
|
||||
autocmd BufNewFile,BufRead *.ts set filetype=typescript
|
||||
|
||||
|
||||
" These are to cancel the default behavior of d, D, c, C
|
||||
" to put the text they delete in the default register.
|
||||
" Note that this means e.g. "ad won't copy the text into
|
||||
" register a anymore. You have to explicitly yank it.
|
||||
" TIPS: you can type :registers to view value in each registers
|
||||
vnoremap p "0p
|
||||
|
||||
vnoremap y "+y
|
||||
nnoremap y "+y
|
||||
|
||||
" copy to system
|
||||
"set clipboard=unnamed
|
||||
set clipboard=unnamedplus
|
||||
if g:os == 'Darwin' && g:os == 'Windows'
|
||||
set clipboard=unnamed
|
||||
else
|
||||
set clipboard=unnamedplus
|
||||
endif
|
||||
|
||||
" fix paste mess up when using tmux
|
||||
if &term =~ "screen"
|
||||
|
||||
+40
-25
@@ -20,7 +20,6 @@
|
||||
" Plugin environment
|
||||
let g:mydotfiles_directory = expand('~/.dotfiles/')
|
||||
let s:plugin_dir = expand('~/.vim/plugged/')
|
||||
let g:vim_dir = expand('~/.vim/')
|
||||
|
||||
call plug#begin(s:plugin_dir)
|
||||
|
||||
@@ -74,7 +73,6 @@
|
||||
set encoding=UTF-8
|
||||
Plug 'scrooloose/nerdtree'
|
||||
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
|
||||
" Plug 'tribela/vim-transparent'
|
||||
Plug 'vim-airline/vim-airline'
|
||||
Plug 'vim-airline/vim-airline-themes'
|
||||
" The bottom buffer display
|
||||
@@ -121,6 +119,7 @@
|
||||
call plug#end()
|
||||
" }
|
||||
|
||||
" only work for Plug.vim
|
||||
function! HasPlug(plug_name, ...)
|
||||
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)
|
||||
@@ -239,8 +238,8 @@ endfunction
|
||||
|
||||
" antoinemadec/coc-fzf {
|
||||
if HasPlug("coc-fzf")
|
||||
nnoremap <silent> <space><space> :<C-u>CocFzfList<CR>
|
||||
nnoremap <leader>o :<C-u>CocFzfList outline<CR>
|
||||
" nnoremap <silent> <space><space> :<C-u>CocFzfList<CR>
|
||||
" nnoremap <leader>o :<C-u>CocFzfList outline<CR>
|
||||
endif
|
||||
" }
|
||||
|
||||
@@ -250,13 +249,11 @@ endfunction
|
||||
let g:bufferline_modified = '+'
|
||||
|
||||
" scrolling with fixed current buffer position
|
||||
let g:bufferline_rotate = 0
|
||||
|
||||
let g:bufferline_active_buffer_left = ''
|
||||
let g:bufferline_active_buffer_right = ''
|
||||
let g:bufferline_fixed_index = -1
|
||||
let g:bufferline_inactive_highlight = 'StatusLineNC'
|
||||
let g:bufferline_active_highlight = 'StatusLine'
|
||||
" let g:bufferline_inactive_highlight = 'StatusLineNC'
|
||||
" let g:bufferline_active_highlight = 'StatusLine'
|
||||
endif
|
||||
|
||||
" }
|
||||
@@ -277,6 +274,9 @@ endfunction
|
||||
|
||||
" 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
|
||||
|
||||
" work around for nerdtree bug: https://github.com/preservim/nerdtree/issues/1321
|
||||
@@ -301,8 +301,14 @@ endfunction
|
||||
let NERDTreeQuitOnOpen = 1
|
||||
let NERDTreeMouseMode = 2
|
||||
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.
|
||||
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
|
||||
endif
|
||||
@@ -313,7 +319,7 @@ endfunction
|
||||
|
||||
endif
|
||||
" }
|
||||
|
||||
|
||||
" vim-airline {
|
||||
if HasPlug("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_z = airline#section#create(['filetype'])
|
||||
let g:airline_skip_empty_sections = 1
|
||||
let g:airline_exclude_filetypes = ['nerdtree']
|
||||
" let g:airline_exclude_filetypes = ['nerdtree']
|
||||
" see source for current list
|
||||
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 = {
|
||||
\ '__' : '-',
|
||||
\ 'c' : 'C',
|
||||
@@ -533,7 +541,6 @@ endfunction
|
||||
execute("colorscheme " . g:light_theme)
|
||||
endif
|
||||
endif
|
||||
" call TransparentBackgroundFix()
|
||||
endfunction
|
||||
|
||||
function! DisableTransparent()
|
||||
@@ -599,30 +606,35 @@ endfunction
|
||||
let g:dark_theme = 'PaperColor'
|
||||
endif
|
||||
if HasPlug("everforest")
|
||||
set termguicolors
|
||||
if has('termguicolors')
|
||||
set termguicolors
|
||||
endif
|
||||
let g:light_theme = 'everforest'
|
||||
let g:dark_theme = 'everforest'
|
||||
let g:airline_dark_theme = "everforest"
|
||||
let g:airline_light_theme = "everforest"
|
||||
" let g:everforest_background = 'soft'
|
||||
let g:everforest_better_performance = 1
|
||||
" let g:everforest_background = 'soft'
|
||||
" let g:everforest_enable_italic = 1
|
||||
|
||||
function! Everforest_trans_enable()
|
||||
let g:everforest_transparent_background = 1
|
||||
let g:everforest_transparent_background = 2
|
||||
colorscheme everforest
|
||||
" try
|
||||
" execute('AirlineTheme everforest')
|
||||
" catch
|
||||
" endtry
|
||||
try
|
||||
execute('AirlineTheme everforest')
|
||||
catch
|
||||
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
|
||||
function! Everforest_trans_disable()
|
||||
let g:everforest_transparent_background = 0
|
||||
colorscheme everforest
|
||||
" try
|
||||
" execute('AirlineTheme everforest')
|
||||
" catch
|
||||
" endtry
|
||||
try
|
||||
execute('AirlineTheme everforest')
|
||||
catch
|
||||
endtry
|
||||
endfunction
|
||||
let g:custom_transparent_function_enable = 'Everforest_trans_enable()'
|
||||
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>12 :call bufferline#jump(12)<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
|
||||
|
||||
" split window comform with other window management shortcuts
|
||||
@@ -746,5 +761,5 @@ endfunction
|
||||
" }
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user