Merge branch 'dev' of https://github.com/Donaldttt/dotfiles into dev
This commit is contained in:
+68
-32
@@ -55,11 +55,6 @@
|
||||
Plug 'jiangmiao/auto-pairs'
|
||||
Plug 'mg979/vim-visual-multi'
|
||||
|
||||
Plug 'vim-airline/vim-airline'
|
||||
Plug 'vim-airline/vim-airline-themes'
|
||||
|
||||
" The bottom buffer display
|
||||
Plug 'bling/vim-bufferline'
|
||||
Plug 'easymotion/vim-easymotion'
|
||||
Plug 'vim-scripts/restore_view.vim'
|
||||
|
||||
@@ -77,10 +72,19 @@
|
||||
|
||||
" put text in neibouring tmux pane into auto complete
|
||||
Plug 'wellle/tmux-complete.vim'
|
||||
Plug 'NoahTheDuke/vim-just'
|
||||
|
||||
Plug 'ludovicchabant/vim-gutentags'
|
||||
Plug 'ludovicchabant/vim-gutentags', { 'for': ['c', 'cpp'] }
|
||||
Plug 'lambdalisue/readablefold.vim'
|
||||
|
||||
" only work with vim
|
||||
if g:vim_type == 'vim'
|
||||
Plug 'vim-airline/vim-airline'
|
||||
Plug 'vim-airline/vim-airline-themes'
|
||||
endif
|
||||
|
||||
" The bottom buffer display
|
||||
Plug 'bling/vim-bufferline'
|
||||
" only work with nvim > 0.5
|
||||
" For other versions, just loading the plugin may
|
||||
" cause error
|
||||
@@ -92,11 +96,17 @@
|
||||
Plug 'EdenEast/nightfox.nvim'
|
||||
Plug 'projekt0n/github-nvim-theme'
|
||||
|
||||
Plug 'nvim-lualine/lualine.nvim'
|
||||
|
||||
" partial code execution
|
||||
" Plug 'michaelb/sniprun', {'do': 'bash install.sh'}
|
||||
endif
|
||||
if g:vim_version >= 0.7
|
||||
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
||||
Plug 'nvim-tree/nvim-web-devicons'
|
||||
endif
|
||||
if g:vim_version >= 0.8
|
||||
Plug 'nvim-tree/nvim-tree.lua'
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -137,6 +147,7 @@ endif
|
||||
" ludovicchabant/vim-gutentags {
|
||||
set statusline+=%{gutentags#statusline()}
|
||||
let g:gutentags_cache_dir=g:vim_dir . '/.vimtags/'
|
||||
let g:gutentags_project_root=['.git', '.hg', '.svn', '.bzr', '_darcs', '_FOSSIL_', '.fslckout', 'src']
|
||||
"}
|
||||
|
||||
" easymotion/vim-easymotion {
|
||||
@@ -191,7 +202,7 @@ endif
|
||||
" }
|
||||
|
||||
" NerdTree {
|
||||
if isdirectory(expand(plugin_dir . "/nerdtree"))
|
||||
if g:vim_type == 'vim' && isdirectory(expand(plugin_dir . "/nerdtree"))
|
||||
let g:NERDShutUp=1
|
||||
|
||||
" work around for nerdtree bug: https://github.com/preservim/nerdtree/issues/1321
|
||||
@@ -210,12 +221,27 @@ endif
|
||||
let NERDTreeKeepTreeInNewTab = 1
|
||||
endif
|
||||
" }
|
||||
|
||||
" nvim-tree.lua {
|
||||
if g:vim_type == 'nvim' && isdirectory(expand(plugin_dir . "/nvim-tree.lua"))
|
||||
|
||||
|
||||
nnoremap <leader>e :NvimTreeFindFileToggle<CR>
|
||||
nnoremap <leader>r :NvimTreeRefresh<CR>
|
||||
|
||||
" Hide vim bottom statusline
|
||||
" autocmd FileType NvimTree setlocal noshowmode noruler laststatus=0 noshowcmd
|
||||
set noshowmode noruler laststatus=0 noshowcmd
|
||||
" autocmd BufRead,BufNewFile NvimTree set laststatus=0 " This will work instead
|
||||
endif
|
||||
" }
|
||||
|
||||
"if has('nvim') && str2float(g:nvim_version) >= 0.5 && isdirectory(expand(plugin_dir . "/lualine.nvim"))
|
||||
" nvim-lualine/lualine.nvim {
|
||||
" }
|
||||
"else
|
||||
" vim-airline {
|
||||
if g:vim_type == 'vim' && isdirectory(expand(plugin_dir . "/airline"))
|
||||
" Set configuration options for the statusline plugin vim-airline.
|
||||
" Use the powerline theme and optionally enable powerline symbols.
|
||||
let g:airline_section_b = ''
|
||||
@@ -253,6 +279,7 @@ endif
|
||||
if isdirectory(expand(plugin_dir . "/vim-airline-themes/"))
|
||||
"let g:airline_theme = 'solarized'
|
||||
endif
|
||||
endif
|
||||
" }
|
||||
"endif
|
||||
|
||||
@@ -320,9 +347,9 @@ endif
|
||||
|
||||
" dark or light
|
||||
if filereadable(expand(g:vim_dir . '.light_theme.signal'))
|
||||
let g:theme_color = 'light'
|
||||
let g:dark_or_white_theme = 'light'
|
||||
else
|
||||
let g:theme_color = 'dark'
|
||||
let g:dark_or_white_theme = 'dark'
|
||||
endif
|
||||
|
||||
" what to use for dark theme
|
||||
@@ -349,21 +376,21 @@ endif
|
||||
set background=dark
|
||||
hi clear
|
||||
execute("colorscheme " . g:dark_theme)
|
||||
let g:theme_color = 'dark'
|
||||
let g:dark_or_white_theme = 'dark'
|
||||
endfunction
|
||||
|
||||
function! SetLightTheme()
|
||||
set background=light
|
||||
hi clear
|
||||
execute("colorscheme " . g:light_theme)
|
||||
let g:theme_color = 'light'
|
||||
let g:dark_or_white_theme = 'light'
|
||||
endfunction
|
||||
|
||||
" Change bottom airline/lualine theme
|
||||
" Currently only support airline
|
||||
function! SetAirlineTheme(theme)
|
||||
if has('nvim') && g:vim_version >= 0.5
|
||||
execute('AirlineTheme ' . a:theme)
|
||||
if g:vim_type == 'nvim' && g:vim_version >= 0.5
|
||||
"execute('AirlineTheme ' . a:theme)
|
||||
else
|
||||
execute('AirlineTheme ' . a:theme)
|
||||
endif
|
||||
@@ -374,6 +401,7 @@ endif
|
||||
function! TransparentBackgroundFix()
|
||||
"if !has('nvim') || g:vim_version < 0.5
|
||||
if v:true
|
||||
"if v:false
|
||||
highlight SignColumn ctermbg=none
|
||||
"highlight CursorLineNr ctermbg=none
|
||||
highlight CocWarningHighlight ctermbg=none
|
||||
@@ -384,7 +412,7 @@ endif
|
||||
highlight CocWarningSign ctermbg=none
|
||||
highlight CocInfoSign ctermbg=none
|
||||
highlight CocHintSign ctermbg=none
|
||||
if g:theme_color == 'dark'
|
||||
if g:dark_or_white_theme == 'dark'
|
||||
highlight! link TempColor Visual
|
||||
highlight! link CocFloating TempColor
|
||||
highlight! link CocErrorFloat TempColor
|
||||
@@ -398,7 +426,7 @@ endif
|
||||
function! EnableTransparent()
|
||||
if g:vim_type == 'nvim' && g:vim_version > 0.5
|
||||
:TransparentEnable
|
||||
elseif g:theme_color == 'dark'
|
||||
elseif g:dark_or_white_theme == 'dark'
|
||||
let g:PaperColor_Theme_Options = {
|
||||
\ 'theme': {
|
||||
\ 'default.dark': {
|
||||
@@ -407,7 +435,7 @@ endif
|
||||
\ }
|
||||
\ }
|
||||
execute("colorscheme " . g:dark_theme)
|
||||
elseif g:theme_color == 'light'
|
||||
elseif g:dark_or_white_theme == 'light'
|
||||
let g:PaperColor_Theme_Options = {
|
||||
\ 'theme': {
|
||||
\ 'default.light': {
|
||||
@@ -422,7 +450,7 @@ endif
|
||||
function! DisableTransparent()
|
||||
if g:vim_type == 'nvim' && g:vim_version > 0.5
|
||||
:TransparentDisable
|
||||
elseif g:theme_color == 'dark'
|
||||
elseif g:dark_or_white_theme == 'dark'
|
||||
let g:PaperColor_Theme_Options = {
|
||||
\ 'theme': {
|
||||
\ 'default.dark': {
|
||||
@@ -431,7 +459,7 @@ endif
|
||||
\ }
|
||||
\ }
|
||||
execute("colorscheme " . g:dark_theme)
|
||||
elseif g:theme_color == 'light'
|
||||
elseif g:dark_or_white_theme == 'light'
|
||||
let g:PaperColor_Theme_Options = {
|
||||
\ 'theme': {
|
||||
\ 'default.light': {
|
||||
@@ -458,17 +486,17 @@ endif
|
||||
" ToggleTransparent background
|
||||
" only works in dark theme
|
||||
function! ToggleTransparent()
|
||||
if g:transparent_dark_theme && g:theme_color == 'dark'
|
||||
if g:transparent_dark_theme && g:dark_or_white_theme == 'dark'
|
||||
call DisableTransparent()
|
||||
let g:transparent_dark_theme = v:false
|
||||
call DeleteSignalFile('.transparent_dark_theme.signal')
|
||||
elseif g:transparent_light_theme && g:theme_color == 'light'
|
||||
elseif g:transparent_light_theme && g:dark_or_white_theme == 'light'
|
||||
call DisableTransparent()
|
||||
let g:transparent_light_theme = v:false
|
||||
call DeleteSignalFile('.transparent_light_theme.signal')
|
||||
else
|
||||
call EnableTransparent()
|
||||
if g:theme_color == 'dark'
|
||||
if g:dark_or_white_theme == 'dark'
|
||||
let g:transparent_dark_theme = v:true
|
||||
call CreateSignalFile('.transparent_dark_theme.signal')
|
||||
else
|
||||
@@ -481,22 +509,30 @@ endif
|
||||
|
||||
|
||||
" vim theme
|
||||
if isdirectory(expand(plugin_dir . "/papercolor-theme"))
|
||||
" improve coc color in this theme
|
||||
let g:light_theme = 'PaperColor'
|
||||
let g:dark_theme = 'PaperColor'
|
||||
endif
|
||||
if !has('nvim') && isdirectory(expand(plugin_dir . "/papercolor-theme"))
|
||||
set t_Co=256
|
||||
" improve coc color in this theme
|
||||
let g:light_theme = 'PaperColor'
|
||||
let g:dark_theme = 'PaperColor'
|
||||
"let g:airline_dark_theme = "papercolor"
|
||||
"let g:airline_light_theme = "papercolor"
|
||||
endif
|
||||
|
||||
" nvim only theme
|
||||
if isdirectory(expand(plugin_dir . "/nightfox.nvim")) && isdirectory(expand(plugin_dir . "/github-nvim-theme")) && has('nvim') && g:vim_version >= 0.5
|
||||
if has('nvim')
|
||||
if g:vim_version >= 0.8 && isdirectory(expand(plugin_dir . "/nightfox.nvim"))
|
||||
let g:light_theme = 'dawnfox'
|
||||
"let g:dark_theme = 'nightfox'
|
||||
end
|
||||
|
||||
if g:vim_version >= 0.5 && isdirectory(expand(plugin_dir . "/github-nvim-theme"))
|
||||
let g:dark_theme = 'github_dark'
|
||||
let g:airline_dark_theme = "hybrid"
|
||||
endif
|
||||
end
|
||||
endif
|
||||
|
||||
|
||||
if g:theme_color == 'dark'
|
||||
if g:dark_or_white_theme == 'dark'
|
||||
let g:airline_theme=g:airline_dark_theme
|
||||
call SetDarkTheme()
|
||||
else
|
||||
@@ -506,7 +542,7 @@ endif
|
||||
|
||||
" Since in .vimrc we cannot call plugin function as they
|
||||
" are not loaded (:help startup)
|
||||
if g:transparent_dark_theme && g:theme_color == 'dark' || g:transparent_light_theme && g:theme_color == 'light'
|
||||
if g:transparent_dark_theme && g:dark_or_white_theme == 'dark' || g:transparent_light_theme && g:dark_or_white_theme == 'light'
|
||||
if g:vim_type == 'nvim' && g:vim_version > 0.5
|
||||
let g:transparent_enabled = v:true
|
||||
else
|
||||
@@ -524,7 +560,7 @@ endif
|
||||
" Allow to trigger background
|
||||
function! ToggleBG()
|
||||
" Inversion
|
||||
if g:theme_color == "dark"
|
||||
if g:dark_or_white_theme == "dark"
|
||||
call SetLightTheme()
|
||||
call SetAirlineTheme(g:airline_light_theme)
|
||||
call CreateSignalFile('.light_theme.signal')
|
||||
@@ -535,7 +571,7 @@ endif
|
||||
call DeleteSignalFile(".light_theme.signal")
|
||||
endif
|
||||
|
||||
if g:transparent_dark_theme && g:theme_color == 'dark' || g:transparent_light_theme && g:theme_color == 'light'
|
||||
if g:transparent_dark_theme && g:dark_or_white_theme == 'dark' || g:transparent_light_theme && g:dark_or_white_theme == 'light'
|
||||
call EnableTransparent()
|
||||
else
|
||||
call DisableTransparent()
|
||||
|
||||
Reference in New Issue
Block a user