big changes
This commit is contained in:
+413
-262
@@ -21,13 +21,29 @@
|
|||||||
return a:cond ? opts : extend(opts, { 'on': [], 'for': [] })
|
return a:cond ? opts : extend(opts, { 'on': [], 'for': [] })
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
Plug 'gelguy/wilder.nvim', Cond(!exists('g:vscode'))
|
"""""""""""""""""""""""
|
||||||
|
"""" THEME_PLUGINS """"
|
||||||
|
"""""""""""""""""""""""
|
||||||
|
|
||||||
|
Plug 'sainnhe/everforest', Cond(g:vim_type == 'vim')
|
||||||
|
Plug 'NLKNguyen/papercolor-theme'
|
||||||
|
|
||||||
|
" Neovim only
|
||||||
|
Plug 'EdenEast/nightfox.nvim', Cond(g:vim_type == 'nvim' && g:vim_version >= 0.5)
|
||||||
|
Plug 'projekt0n/github-nvim-theme', Cond(g:vim_type == 'nvim' && g:vim_version >= 0.5, { 'tag': 'v0.0.7' })
|
||||||
|
|
||||||
|
"""""""""""""""""""""""
|
||||||
|
"""""""" END """"""""""
|
||||||
|
"""""""""""""""""""""""
|
||||||
|
|
||||||
|
|
||||||
|
Plug 'gelguy/wilder.nvim'
|
||||||
" To use Python remote plugin features in Vim for wilder, can be skipped
|
" To use Python remote plugin features in Vim for wilder, can be skipped
|
||||||
" Plug 'roxma/nvim-yarp', Cond(g:vim_type == 'vim')
|
" Plug 'roxma/nvim-yarp', Cond(g:vim_type == 'vim')
|
||||||
" Plug 'roxma/vim-hug-neovim-rpc', Cond(g:vim_type == 'vim')
|
" Plug 'roxma/vim-hug-neovim-rpc', Cond(g:vim_type == 'vim')
|
||||||
|
|
||||||
Plug 'dstein64/vim-startuptime', Cond(!exists('g:vscode'))
|
Plug 'dstein64/vim-startuptime'
|
||||||
Plug 'simeji/winresizer', Cond(!exists('g:vscode'))
|
Plug 'simeji/winresizer'
|
||||||
Plug 'rust-lang/rust.vim', { 'for': ['rust'] }
|
Plug 'rust-lang/rust.vim', { 'for': ['rust'] }
|
||||||
|
|
||||||
Plug 'machakann/vim-sandwich'
|
Plug 'machakann/vim-sandwich'
|
||||||
@@ -35,77 +51,79 @@
|
|||||||
|
|
||||||
Plug 'jiangmiao/auto-pairs'
|
Plug 'jiangmiao/auto-pairs'
|
||||||
" Plug 'mg979/vim-visual-multi'
|
" Plug 'mg979/vim-visual-multi'
|
||||||
Plug 'RRethy/vim-illuminate', Cond(!exists('g:vscode'))
|
Plug 'RRethy/vim-illuminate'
|
||||||
|
|
||||||
"Plug 'easymotion/vim-easymotion'
|
"Plug 'easymotion/vim-easymotion'
|
||||||
Plug 'vim-scripts/restore_view.vim'
|
Plug 'mhinz/vim-startify'
|
||||||
Plug 'mhinz/vim-startify', Cond(!exists('g:vscode'))
|
Plug 'ludovicchabant/vim-gutentags', Cond(!exists('g:vscode'), { 'for': ['c', 'cpp'] })
|
||||||
|
|
||||||
Plug 'christoomey/vim-tmux-navigator', Cond(!exists('g:vscode'))
|
Plug 'christoomey/vim-tmux-navigator'
|
||||||
Plug 'NLKNguyen/papercolor-theme', Cond(!exists('g:vscode'))
|
|
||||||
Plug 'airblade/vim-rooter'
|
Plug 'airblade/vim-rooter'
|
||||||
Plug 'roxma/vim-tmux-clipboard', Cond(executable('tmux'))
|
Plug 'roxma/vim-tmux-clipboard', Cond(executable('tmux'))
|
||||||
|
Plug 'liuchengxu/vista.vim'
|
||||||
|
|
||||||
|
"""""""""""""""""""""""
|
||||||
|
"" ESSENTIAL_PLUGINS ""
|
||||||
|
"""""""""""""""""""""""
|
||||||
|
|
||||||
" Comment stuff out
|
" Comment stuff out
|
||||||
Plug 'tpope/vim-commentary'
|
Plug 'tpope/vim-commentary'
|
||||||
|
Plug 'vim-scripts/restore_view.vim'
|
||||||
|
|
||||||
Plug 'ludovicchabant/vim-gutentags', Cond(!exists('g:vscode'), { 'for': ['c', 'cpp'] })
|
" vim only plugins
|
||||||
" Plug 'lambdalisue/readablefold.vim'
|
Plug 'scrooloose/nerdtree', Cond(g:vim_type == 'vim' \|\| g:vim_version < 0.8, { 'on' : ['NERDTreeToggle', 'NERDTreeFind'] })
|
||||||
|
Plug 'tiagofumo/vim-nerdtree-syntax-highlight', Cond(g:vim_type == 'vim')
|
||||||
|
|
||||||
|
Plug 'neoclide/coc.nvim', Cond(!exists('g:vscode') && executable('node'), {'branch': 'release'})
|
||||||
|
|
||||||
Plug 'liuchengxu/vista.vim'
|
|
||||||
" only work with vim
|
" only work with vim
|
||||||
if g:vim_type == 'vim'
|
if g:vim_type == 'vim'
|
||||||
set encoding=UTF-8
|
set encoding=UTF-8
|
||||||
|
|
||||||
if executable('fzf')
|
if executable('fzf')
|
||||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||||
Plug 'junegunn/fzf.vim'
|
Plug 'junegunn/fzf.vim'
|
||||||
Plug 'antoinemadec/coc-fzf'
|
Plug 'antoinemadec/coc-fzf'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
Plug 'scrooloose/nerdtree', { 'on' : ['NERDTreeToggle', 'NERDTreeFind'] }
|
|
||||||
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
|
|
||||||
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
|
|
||||||
Plug 'Donaldttt/vim-bufferline'
|
Plug 'Donaldttt/vim-bufferline'
|
||||||
Plug 'ryanoasis/vim-devicons'
|
Plug 'ryanoasis/vim-devicons'
|
||||||
Plug 'sainnhe/everforest'
|
Plug 'wfxr/minimap.vim', Cond(!exists('g:vscode') && executable('code-minimap'))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if executable('node')
|
|
||||||
Plug 'neoclide/coc.nvim', Cond(!exists('g:vscode'), {'branch': 'release'})
|
|
||||||
endif
|
|
||||||
|
|
||||||
if g:vim_type == 'nvim'
|
if g:vim_type == 'nvim'
|
||||||
if g:vim_version >= 0.5
|
if g:vim_version >= 0.5
|
||||||
Plug 'xiyaowong/nvim-transparent', Cond(!exists('g:vscode'))
|
Plug 'xiyaowong/nvim-transparent'
|
||||||
Plug 'lukas-reineke/indent-blankline.nvim', Cond(!exists('g:vscode'))
|
Plug 'lukas-reineke/indent-blankline.nvim'
|
||||||
Plug 'EdenEast/nightfox.nvim', Cond(!exists('g:vscode'))
|
Plug 'echasnovski/mini.indentscope'
|
||||||
Plug 'projekt0n/github-nvim-theme', Cond(!exists('g:vscode'), { 'tag': 'v0.0.7' })
|
Plug 'echasnovski/mini.animate'
|
||||||
|
|
||||||
Plug 'nvim-lualine/lualine.nvim', Cond(!exists('g:vscode'))
|
|
||||||
|
|
||||||
|
Plug 'nvim-lualine/lualine.nvim'
|
||||||
|
Plug 'karb94/neoscroll.nvim'
|
||||||
|
Plug 'petertriho/nvim-scrollbar'
|
||||||
|
Plug 'folke/which-key.nvim'
|
||||||
endif
|
endif
|
||||||
if g:vim_version >= 0.7
|
if g:vim_version >= 0.7
|
||||||
Plug 'nvim-treesitter/nvim-treesitter', Cond(!exists('g:vscode') && executable('make'), {'do': ':TSUpdate'})
|
Plug 'nvim-treesitter/nvim-treesitter', Cond(!exists('g:vscode') && executable('make'), {'do': ':TSUpdate'})
|
||||||
|
|
||||||
" for telescope
|
" for telescope
|
||||||
Plug 'nvim-lua/plenary.nvim', Cond(!exists('g:vscode'))
|
Plug 'nvim-lua/plenary.nvim'
|
||||||
Plug 'nvim-telescope/telescope.nvim', Cond(!exists('g:vscode'), { 'tag': '0.1.x' })
|
Plug 'nvim-telescope/telescope.nvim', Cond(g:vim_type == 'nvim', { 'tag': '0.1.x' })
|
||||||
|
|
||||||
" c plugin for telescope to make it faster
|
" c plugin for telescope to make it faster
|
||||||
Plug 'nvim-telescope/telescope-fzf-native.nvim', Cond(!exists('g:vscode') && executable('make'), { 'do': 'make' })
|
Plug 'nvim-telescope/telescope-fzf-native.nvim', Cond(!exists('g:vscode') && executable('make'), { 'do': 'make' })
|
||||||
|
|
||||||
" comment out this plugin if the machine doesn't have required
|
" comment out this plugin if the machine doesn't have required
|
||||||
" font install
|
" font install
|
||||||
Plug 'nvim-tree/nvim-web-devicons', Cond(!exists('g:vscode'))
|
Plug 'nvim-tree/nvim-web-devicons'
|
||||||
|
Plug 'akinsho/toggleterm.nvim', Cond(g:vim_type == 'nvim', {'tag' : '*'})
|
||||||
endif
|
endif
|
||||||
if g:vim_version >= 0.8
|
if g:vim_version >= 0.8
|
||||||
Plug 'nvim-tree/nvim-tree.lua', Cond(!exists('g:vscode'))
|
Plug 'nvim-tree/nvim-tree.lua'
|
||||||
endif
|
|
||||||
if g:vim_version < 0.8
|
Plug 'rcarriga/nvim-notify'
|
||||||
Plug 'scrooloose/nerdtree', Cond(!exists('g:vscode'))
|
Plug 'folke/noice.nvim'
|
||||||
|
Plug 'MunifTanjim/nui.nvim'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -120,6 +138,12 @@
|
|||||||
|
|
||||||
" UTILITIES
|
" UTILITIES
|
||||||
" {
|
" {
|
||||||
|
|
||||||
|
" special filetypes probably defined by plugins that we don't want other
|
||||||
|
" plugins to mess around with them
|
||||||
|
|
||||||
|
let g:special_fts = ['help', 'nerdtree']
|
||||||
|
|
||||||
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)
|
||||||
@@ -134,29 +158,17 @@ function! HasPlug(plug_name, ...)
|
|||||||
return v:false
|
return v:false
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" display the name of the buffers which are displaied on screen
|
|
||||||
" like command :ls! a
|
|
||||||
function! GetActiveBuffers()
|
|
||||||
" let l:blist = getbufinfo({'bufloaded': 1, 'buflisted': 1})
|
|
||||||
let l:blist = getbufinfo({'bufloaded': 1})
|
|
||||||
let l:result = []
|
|
||||||
for l:item in l:blist
|
|
||||||
"skip unnamed buffers; also skip hidden buffers?
|
|
||||||
if empty(l:item.name) || l:item.hidden
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
" call add(l:result, { 'name' : shellescape(l:item.name), 'bufnr' : l:item.bufnr })
|
|
||||||
call add(l:result, l:item.bufnr )
|
|
||||||
endfor
|
|
||||||
return l:result
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" }
|
" }
|
||||||
|
|
||||||
" PLUGIN_CONFIGURATION
|
" PLUGIN_CONFIGURATION
|
||||||
" {
|
" {
|
||||||
|
if HasPlug('minimap.vim')
|
||||||
|
let g:special_fts += ['minimap']
|
||||||
|
nnoremap <silent> <leader>mm :MinimapToggle<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
if HasPlug('vista.vim')
|
if HasPlug('vista.vim')
|
||||||
|
let g:special_fts += ['vista']
|
||||||
let g:vista_default_executive = 'vim_lsp'
|
let g:vista_default_executive = 'vim_lsp'
|
||||||
if HasPlug('coc.nvim')
|
if HasPlug('coc.nvim')
|
||||||
let g:vista_default_executive = 'coc'
|
let g:vista_default_executive = 'coc'
|
||||||
@@ -259,7 +271,7 @@ endfunction
|
|||||||
call wilder#set_option('pipeline', [
|
call wilder#set_option('pipeline', [
|
||||||
\ wilder#debounce(10),
|
\ wilder#debounce(10),
|
||||||
\ wilder#branch(
|
\ wilder#branch(
|
||||||
\ wilder#cmdline_pipeline({'language': has('nvim') ? 'python' : 'vim'}),
|
\ wilder#cmdline_pipeline({'language': g:vim_type == 'nvim' ? 'python' : 'vim'}),
|
||||||
\ ),
|
\ ),
|
||||||
\ ])
|
\ ])
|
||||||
call wilder#set_option('renderer', wilder#popupmenu_renderer())
|
call wilder#set_option('renderer', wilder#popupmenu_renderer())
|
||||||
@@ -331,7 +343,8 @@ endfunction
|
|||||||
if HasPlug("winresizer")
|
if HasPlug("winresizer")
|
||||||
let g:winresizer_vert_resize = 2
|
let g:winresizer_vert_resize = 2
|
||||||
let g:winresizer_horiz_resize = 2
|
let g:winresizer_horiz_resize = 2
|
||||||
nnoremap <C-w>r :WinResizerStartResize<CR>
|
" nnoremap <C-w>r :WinResizerStartResize<CR>
|
||||||
|
let g:winresizer_start_key = '<C-w>r'
|
||||||
endif
|
endif
|
||||||
" }
|
" }
|
||||||
|
|
||||||
@@ -448,28 +461,80 @@ endfunction
|
|||||||
endif
|
endif
|
||||||
" }
|
" }
|
||||||
|
|
||||||
" vim-airline {
|
if HasPlug("vim-airline") || HasPlug('lualine.nvim')
|
||||||
|
|
||||||
|
function! AirlineCocStatus()
|
||||||
|
if ! exists('*CocAction')
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
" let loading = ["⢿", "⣻", "⣽", "⣾", "⣷", "⣯", "⣟", "⡿"]
|
||||||
|
let loading = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"]
|
||||||
|
try
|
||||||
|
let result = CocAction('services')
|
||||||
|
catch
|
||||||
|
return
|
||||||
|
endtry
|
||||||
|
let state = ''
|
||||||
|
let id = ''
|
||||||
|
for e in result
|
||||||
|
if e['languageIds'][0] == &ft
|
||||||
|
let state = e['state']
|
||||||
|
let id = e['id']
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
" messy way to get time in millisecond in vim
|
||||||
|
let time = float2nr(str2float(reltime()->reltimestr()[4:]) * 1000)
|
||||||
|
let speed = 800
|
||||||
|
let loadidx = time % speed
|
||||||
|
let msg = 'lsp[' . id . ']'
|
||||||
|
if state == "starting"
|
||||||
|
return msg . " " . loading[loadidx/(speed/10)]
|
||||||
|
endif
|
||||||
|
return msg . " ✔"
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
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.
|
||||||
" Use the powerline theme and optionally enable powerline symbols.
|
" Use the powerline theme and optionally enable powerline symbols.
|
||||||
|
|
||||||
" This must using my fork version of bufferline
|
" This must using my fork version of bufferline
|
||||||
"
|
|
||||||
|
" TODO
|
||||||
|
" 22 is a magic number, it is best it can change as buffer width
|
||||||
|
" changing
|
||||||
let g:bufferline_max_length = &columns - 22
|
let g:bufferline_max_length = &columns - 22
|
||||||
function! BufferNumber()
|
function! AirlineBufferNumber()
|
||||||
return len(g:index_to_buffer)
|
return len(g:index_to_buffer)
|
||||||
endfunction
|
endfunction
|
||||||
call airline#parts#define_function('bufnum', 'BufferNumber')
|
call airline#parts#define_function('bufnum', 'AirlineBufferNumber')
|
||||||
|
call airline#parts#define_function('cocstatus', 'AirlineCocStatus')
|
||||||
|
call airline#parts#define_accent('cocstatus', 'italic')
|
||||||
|
|
||||||
|
function! AirlineInit()
|
||||||
|
" this create function returns a format string for status line (:h
|
||||||
|
" stl). the string we append is what will happend if we pass
|
||||||
|
" cocstatus into the create function. By appending them we have
|
||||||
|
" more freedom format the highlight
|
||||||
|
" let g:airline_section_y = '%{%airline#util#wrap(AirlineCocStatus(), 0)%}'
|
||||||
|
let g:airline_section_a = airline#section#create(['mode'])
|
||||||
|
let g:airline_section_b = ''
|
||||||
|
let g:airline_section_error = ''
|
||||||
|
let g:airline_section_warning = ''
|
||||||
|
let g:airline_section_x = airline#section#create(['bufnum'])
|
||||||
|
let g:airline_section_y = airline#section#create(['cocstatus'])
|
||||||
|
let g:airline_section_z = airline#section#create(['filetype'])
|
||||||
|
" see source for current list
|
||||||
|
endfunction
|
||||||
|
autocmd User AirlineAfterInit call AirlineInit()
|
||||||
|
|
||||||
|
let g:airline#extensions#localsearch#enabled = 0
|
||||||
let g:airline_extensions = ['bufferline']
|
let g:airline_extensions = ['bufferline']
|
||||||
let g:airline_section_x = airline#section#create(['bufnum'])
|
|
||||||
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 = ['vista']
|
|
||||||
" see source for current list
|
|
||||||
let g:airline#extensions#nerdtree_statusline = 0
|
|
||||||
|
|
||||||
|
let g:airline_exclude_filetypes = ['vista', 'minimap']
|
||||||
|
let g:airline_skip_empty_sections = 1
|
||||||
" without this airline will overwrite some setting like bufferline_active_buffer_left, etc.
|
" without this airline will overwrite some setting like bufferline_active_buffer_left, etc.
|
||||||
let g:airline#extensions#bufferline#overwrite_variables = 0
|
let g:airline#extensions#bufferline#overwrite_variables = 0
|
||||||
let g:airline_mode_map = {
|
let g:airline_mode_map = {
|
||||||
@@ -522,8 +587,9 @@ endfunction
|
|||||||
\ 'grep -R --line-number --exclude-dir=".git;.svn" --color=always -- '.shellescape(<q-args>), 1,
|
\ 'grep -R --line-number --exclude-dir=".git;.svn" --color=always -- '.shellescape(<q-args>), 1,
|
||||||
\ fzf#vim#with_preview(), <bang>0)
|
\ fzf#vim#with_preview(), <bang>0)
|
||||||
endif
|
endif
|
||||||
noremap <leader><leader>r :Rg<CR>
|
noremap <leader>fr :Rg<CR>
|
||||||
noremap <leader><leader>f :Files<CR>
|
noremap <leader>ff :Files<CR>
|
||||||
|
noremap <leader>fc :Colors<CR>
|
||||||
endif
|
endif
|
||||||
" }
|
" }
|
||||||
|
|
||||||
@@ -543,9 +609,132 @@ endfunction
|
|||||||
|
|
||||||
" THEME_CONFIGURATION
|
" THEME_CONFIGURATION
|
||||||
" {
|
" {
|
||||||
"
|
" GOTO menu
|
||||||
|
" THEME_README
|
||||||
|
" THEME_PLUGINS_CONFIG
|
||||||
|
" THEME_ULTILITIES
|
||||||
|
" THEME_INIT " Setup theme when vim first start
|
||||||
|
" THEME_OPTIONS
|
||||||
|
|
||||||
|
"""""""""""""""""""""""""""""""""""""""
|
||||||
|
"""""""""""" THEME_README """""""""""""
|
||||||
|
"""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
" set custom callback functions to use when when enabling/diabling transparent
|
||||||
|
" for certain colorscheme
|
||||||
|
" let g:light_transparent_enable_cb = ''
|
||||||
|
" let g:light_transparent_disable_cb = ''
|
||||||
|
" let g:dark_transparent_enable_cb = ''
|
||||||
|
" let g:dark_transparent_disable_cb = ''
|
||||||
|
|
||||||
|
"""""""""""""""""""""""""""""""""""""""
|
||||||
|
""""""" THEME_PLUGINS_CONFIG """"""""""
|
||||||
|
"""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
" a list contains all available themes
|
||||||
|
let g:all_dark_themes = []
|
||||||
|
let g:all_light_themes = []
|
||||||
|
|
||||||
|
if HasPlug("github-nvim-theme")
|
||||||
|
let g:all_dark_themes += ['github_dark', 'github_dark_default', 'github_dimmed', 'github_dark_colorblind']
|
||||||
|
let g:all_light_themes += ['github_light', 'github_light_default', 'github_light_colorblind']
|
||||||
|
end
|
||||||
|
|
||||||
|
if HasPlug("nightfox.nvim")
|
||||||
|
let g:all_dark_themes += ['nightfox']
|
||||||
|
let g:all_light_themes += ['dawnfox']
|
||||||
|
end
|
||||||
|
|
||||||
|
if HasPlug('nvim-transparent')
|
||||||
|
|
||||||
|
" generic nvim transparent enable and disable function
|
||||||
|
function Nvim_TB_enable()
|
||||||
|
:TransparentEnable
|
||||||
|
endfunction
|
||||||
|
function Nvim_TB_disable()
|
||||||
|
:TransparentDisable
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let g:light_transparent_enable_cb = 'Nvim_TB_enable'
|
||||||
|
let g:light_transparent_disable_cb = 'Nvim_TB_disable'
|
||||||
|
let g:dark_transparent_enable_cb = 'Nvim_TB_enable'
|
||||||
|
let g:dark_transparent_disable_cb = 'Nvim_TB_disable'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if HasPlug('everforest')
|
||||||
|
let g:all_dark_themes += ['everforest']
|
||||||
|
let g:all_light_themes += ['everforest']
|
||||||
|
|
||||||
|
let g:everforest_better_performance = 1
|
||||||
|
let g:everforest_background = 'hard'
|
||||||
|
" let g:everforest_enable_italic = 1
|
||||||
|
function! Everforest_trans_enable()
|
||||||
|
let g:everforest_transparent_background = 2
|
||||||
|
colorscheme everforest
|
||||||
|
if exists(':AirlineTheme')
|
||||||
|
execute('AirlineTheme everforest')
|
||||||
|
endif
|
||||||
|
" 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
|
||||||
|
if exists(':AirlineTheme')
|
||||||
|
execute('AirlineTheme everforest')
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
function! CB_dark_tb_enable_everforest()
|
||||||
|
call Everforest_trans_enable()
|
||||||
|
endfunction
|
||||||
|
function! CB_light_tb_enable_everforest()
|
||||||
|
call Everforest_trans_enable()
|
||||||
|
endfunction
|
||||||
|
function! CB_dark_tb_disable_everforest()
|
||||||
|
call Everforest_trans_disable()
|
||||||
|
endfunction
|
||||||
|
function! CB_light_tb_disable_everforest()
|
||||||
|
call Everforest_trans_disable()
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
|
if HasPlug('papercolor-theme')
|
||||||
|
let g:all_dark_themes += ['PaperColor']
|
||||||
|
let g:all_light_themes += ['PaperColor']
|
||||||
|
|
||||||
|
function! CB_dark_tb_enable_PaperColor()
|
||||||
|
let g:PaperColor_Theme_Options = {
|
||||||
|
\ 'theme': {'default.dark': { 'transparent_background': 1 }}
|
||||||
|
\ }
|
||||||
|
execute("colorscheme " . g:dark_theme)
|
||||||
|
endfunction
|
||||||
|
function! CB_light_tb_enable_PaperColor()
|
||||||
|
let g:PaperColor_Theme_Options = {
|
||||||
|
\ 'theme': {'default.light': { 'transparent_background': 1 }}
|
||||||
|
\ }
|
||||||
|
execute("colorscheme " . g:light_theme)
|
||||||
|
endfunction
|
||||||
|
function! CB_dark_tb_disable_PaperColor()
|
||||||
|
let g:PaperColor_Theme_Options = {
|
||||||
|
\ 'theme': {'default.dark': { 'transparent_background': 0 }}
|
||||||
|
\ }
|
||||||
|
execute("colorscheme " . g:dark_theme)
|
||||||
|
endfunction
|
||||||
|
function! CB_light_tb_disable_PaperColor()
|
||||||
|
let g:PaperColor_Theme_Options = {
|
||||||
|
\ 'theme': {'default.light': { 'transparent_background': 0 }}
|
||||||
|
\ }
|
||||||
|
execute("colorscheme " . g:light_theme)
|
||||||
|
endfunction
|
||||||
|
endif
|
||||||
|
|
||||||
|
"""""""""""""""""""""""""""""""""""""""
|
||||||
|
"""""""""" THEME_ULTILITIES """""""""""
|
||||||
|
"""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
" debug function print out highlight group of cursor position
|
" debug function print out highlight group of cursor position
|
||||||
function! SynStack()
|
function! ShowHighLightGroup()
|
||||||
if !exists("*synstack")
|
if !exists("*synstack")
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
@@ -557,7 +746,7 @@ endfunction
|
|||||||
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
nmap <Leader>db :call SynStack()<CR>
|
nmap <Leader>db :call ShowHighLightGroup()<CR>
|
||||||
|
|
||||||
" search and filter highlight group
|
" search and filter highlight group
|
||||||
" :call Sh('airline')
|
" :call Sh('airline')
|
||||||
@@ -565,21 +754,16 @@ endfunction
|
|||||||
execute("filter /" . a:pattern . "/ highlight")
|
execute("filter /" . a:pattern . "/ highlight")
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" dark or light
|
" get current colorscheme name
|
||||||
if filereadable(g:vim_dir . '.light_theme.signal')
|
function! ColourSchemeName()
|
||||||
let g:dark_or_light_theme = 'light'
|
try
|
||||||
else
|
return g:colors_name
|
||||||
let g:dark_or_light_theme = 'dark'
|
catch /^Vim:E121/
|
||||||
endif
|
return "default"
|
||||||
|
catch /.*/
|
||||||
" what to use for dark theme
|
return "default"
|
||||||
let g:dark_theme = 'default'
|
endtry
|
||||||
" let g:airline_dark_theme = "violet"
|
endfunction
|
||||||
let g:airline_dark_theme = "angr"
|
|
||||||
|
|
||||||
" what to use for light theme
|
|
||||||
let g:light_theme = 'default'
|
|
||||||
let g:airline_light_theme = "silver"
|
|
||||||
|
|
||||||
" delete signal file if exist
|
" delete signal file if exist
|
||||||
function! DeleteSignalFile(name)
|
function! DeleteSignalFile(name)
|
||||||
@@ -600,18 +784,6 @@ endfunction
|
|||||||
return v:false
|
return v:false
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" transparent backgroud for supported terminal emulator
|
|
||||||
" check if transparent_dark_theme.signl or transparent_light_theme.signl
|
|
||||||
" exist and set respect variable
|
|
||||||
let g:transparent_dark_theme = v:false
|
|
||||||
let g:transparent_light_theme = v:false
|
|
||||||
if SignalFileExists('.transparent_dark_theme.signal')
|
|
||||||
let g:transparent_dark_theme = v:true
|
|
||||||
endif
|
|
||||||
if SignalFileExists('.transparent_light_theme.signal')
|
|
||||||
let g:transparent_light_theme = v:true
|
|
||||||
endif
|
|
||||||
|
|
||||||
function! SetDarkTheme()
|
function! SetDarkTheme()
|
||||||
set background=dark
|
set background=dark
|
||||||
hi clear
|
hi clear
|
||||||
@@ -623,6 +795,7 @@ endfunction
|
|||||||
set background=light
|
set background=light
|
||||||
hi clear
|
hi clear
|
||||||
execute("colorscheme " . g:light_theme)
|
execute("colorscheme " . g:light_theme)
|
||||||
|
execute("colorscheme " . g:light_theme)
|
||||||
let g:dark_or_light_theme = 'light'
|
let g:dark_or_light_theme = 'light'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -637,181 +810,80 @@ endfunction
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Fix colorscheme not working correctly under transparent background
|
|
||||||
function! TransparentBackgroundFix()
|
|
||||||
if !has('nvim') || g:vim_version < 0.5
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let g:custom_transparent_function_enable = ''
|
|
||||||
let g:custom_transparent_function_disable = ''
|
|
||||||
function! EnableTransparent()
|
function! EnableTransparent()
|
||||||
if g:custom_transparent_function_enable != ''
|
let colorscheme_name = ColourSchemeName()
|
||||||
execute('call ' . g:custom_transparent_function_enable)
|
if g:dark_or_light_theme == 'dark'
|
||||||
return
|
let dark_cb_name = 'CB_dark_tb_enable_' . colorscheme_name
|
||||||
endif
|
if exists('*' . dark_cb_name)
|
||||||
if g:vim_type == 'nvim' && g:vim_version > 0.5
|
execute('call ' . dark_cb_name . '()')
|
||||||
:TransparentEnable
|
elseif g:dark_transparent_enable_cb != ''
|
||||||
else
|
execute('call ' . g:dark_transparent_enable_cb . '()')
|
||||||
if g:dark_or_light_theme == 'dark'
|
else
|
||||||
let g:PaperColor_Theme_Options = {
|
return
|
||||||
\ 'theme': {
|
|
||||||
\ 'default.dark': {
|
|
||||||
\ 'transparent_background': 1
|
|
||||||
\ }
|
|
||||||
\ }
|
|
||||||
\ }
|
|
||||||
execute("colorscheme " . g:dark_theme)
|
|
||||||
elseif g:dark_or_light_theme == 'light'
|
|
||||||
let g:PaperColor_Theme_Options = {
|
|
||||||
\ 'theme': {
|
|
||||||
\ 'default.light': {
|
|
||||||
\ 'transparent_background': 1
|
|
||||||
\ }
|
|
||||||
\ }
|
|
||||||
\ }
|
|
||||||
execute("colorscheme " . g:light_theme)
|
|
||||||
endif
|
endif
|
||||||
|
let g:transparent_dark_theme = v:true
|
||||||
|
call CreateSignalFile('.transparent_dark_theme.signal')
|
||||||
|
else
|
||||||
|
let light_cb_name = 'CB_light_tb_enable_' . colorscheme_name
|
||||||
|
if exists('*' . light_cb_name)
|
||||||
|
execute('call ' . light_cb_name . '()')
|
||||||
|
elseif g:light_transparent_enable_cb != ''
|
||||||
|
execute('call ' . g:light_transparent_enable_cb . '()')
|
||||||
|
else
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
let g:transparent_light_theme = v:true
|
||||||
|
call CreateSignalFile('.transparent_light_theme.signal')
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! DisableTransparent()
|
function! DisableTransparent()
|
||||||
if g:custom_transparent_function_disable != ''
|
let colorscheme_name = ColourSchemeName()
|
||||||
execute('call ' . g:custom_transparent_function_disable)
|
if g:dark_or_light_theme == 'dark'
|
||||||
return
|
let dark_cb_name = 'CB_dark_tb_disable_' . colorscheme_name
|
||||||
endif
|
if exists('*' . dark_cb_name)
|
||||||
if g:vim_type == 'nvim' && g:vim_version > 0.5
|
set background=dark
|
||||||
:TransparentDisable
|
hi clear
|
||||||
else
|
execute('call ' . dark_cb_name . '()')
|
||||||
if g:dark_or_light_theme == 'dark'
|
elseif g:dark_transparent_disable_cb != ''
|
||||||
let g:PaperColor_Theme_Options = {
|
execute('call ' . g:dark_transparent_disable_cb . '()')
|
||||||
\ 'theme': {
|
else
|
||||||
\ 'default.dark': {
|
return
|
||||||
\ 'transparent_background': 0
|
|
||||||
\ }
|
|
||||||
\ }
|
|
||||||
\ }
|
|
||||||
execute("colorscheme " . g:dark_theme)
|
|
||||||
elseif g:dark_or_light_theme == 'light'
|
|
||||||
let g:PaperColor_Theme_Options = {
|
|
||||||
\ 'theme': {
|
|
||||||
\ 'default.light': {
|
|
||||||
\ 'transparent_background': 0
|
|
||||||
\ }
|
|
||||||
\ }
|
|
||||||
\ }
|
|
||||||
execute("colorscheme " . g:light_theme)
|
|
||||||
endif
|
endif
|
||||||
|
let g:transparent_dark_theme = v:false
|
||||||
|
call DeleteSignalFile('.transparent_dark_theme.signal')
|
||||||
|
else
|
||||||
|
let light_cb_name = 'CB_light_tb_disable_' . colorscheme_name
|
||||||
|
if exists('*' . light_cb_name)
|
||||||
|
set background=light
|
||||||
|
hi clear
|
||||||
|
execute('call ' . light_cb_name . '()')
|
||||||
|
elseif g:light_transparent_disable_cb != ''
|
||||||
|
execute('call ' . g:light_transparent_disable_cb . '()')
|
||||||
|
else
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
let g:transparent_light_theme = v:false
|
||||||
|
call DeleteSignalFile('.transparent_light_theme.signal')
|
||||||
endif
|
endif
|
||||||
|
" if g:vim_type == 'nvim' && g:vim_version > 0.5
|
||||||
|
" :TransparentDisable
|
||||||
|
" endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" ToggleTransparent background
|
" ToggleTransparent background
|
||||||
" only works in dark theme
|
|
||||||
function! ToggleTransparent()
|
function! ToggleTransparent()
|
||||||
if g:transparent_dark_theme && g:dark_or_light_theme == 'dark'
|
if g:transparent_dark_theme && g:dark_or_light_theme == 'dark'
|
||||||
call DisableTransparent()
|
call DisableTransparent()
|
||||||
let g:transparent_dark_theme = v:false
|
|
||||||
call DeleteSignalFile('.transparent_dark_theme.signal')
|
|
||||||
elseif g:transparent_light_theme && g:dark_or_light_theme == 'light'
|
elseif g:transparent_light_theme && g:dark_or_light_theme == 'light'
|
||||||
call DisableTransparent()
|
call DisableTransparent()
|
||||||
let g:transparent_light_theme = v:false
|
elseif ! g:transparent_light_theme && g:dark_or_light_theme == 'light'
|
||||||
call DeleteSignalFile('.transparent_light_theme.signal')
|
call EnableTransparent()
|
||||||
else
|
elseif ! g:transparent_dark_theme && g:dark_or_light_theme == 'dark'
|
||||||
call EnableTransparent()
|
call EnableTransparent()
|
||||||
if g:dark_or_light_theme == 'dark'
|
|
||||||
let g:transparent_dark_theme = v:true
|
|
||||||
call CreateSignalFile('.transparent_dark_theme.signal')
|
|
||||||
else
|
|
||||||
let g:transparent_light_theme = v:true
|
|
||||||
call CreateSignalFile('.transparent_light_theme.signal')
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
" vim theme
|
|
||||||
if g:vim_type == 'vim'
|
|
||||||
set t_Co=256
|
|
||||||
if HasPlug("papercolor-theme")
|
|
||||||
" improve coc color in this theme
|
|
||||||
let g:light_theme = 'PaperColor'
|
|
||||||
let g:dark_theme = 'PaperColor'
|
|
||||||
endif
|
|
||||||
if HasPlug("everforest")
|
|
||||||
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_better_performance = 1
|
|
||||||
let g:everforest_background = 'hard'
|
|
||||||
" let g:everforest_enable_italic = 1
|
|
||||||
|
|
||||||
function! Everforest_trans_enable()
|
|
||||||
let g:everforest_transparent_background = 2
|
|
||||||
colorscheme everforest
|
|
||||||
if exists(':AirlineTheme')
|
|
||||||
execute('AirlineTheme everforest')
|
|
||||||
endif
|
|
||||||
" 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
|
|
||||||
if exists(':AirlineTheme')
|
|
||||||
execute('AirlineTheme everforest')
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
let g:custom_transparent_function_enable = 'Everforest_trans_enable()'
|
|
||||||
let g:custom_transparent_function_disable = 'Everforest_trans_disable()'
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
" nvim only theme
|
|
||||||
if g:vim_type == 'nvim'
|
|
||||||
if g:vim_version >= 0.8 && HasPlug("nightfox.nvim")
|
|
||||||
let g:light_theme = 'dawnfox'
|
|
||||||
"let g:dark_theme = 'nightfox'
|
|
||||||
end
|
|
||||||
|
|
||||||
if g:vim_version >= 0.5 && HasPlug("github-nvim-theme")
|
|
||||||
let g:dark_theme = 'github_dark'
|
|
||||||
" let g:dark_theme = 'github_dark_default'
|
|
||||||
" let g:dark_theme = 'github_dimmed'
|
|
||||||
let g:airline_dark_theme = "hybrid"
|
|
||||||
end
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
if g:dark_or_light_theme == 'dark'
|
|
||||||
let g:airline_theme=g:airline_dark_theme
|
|
||||||
call SetDarkTheme()
|
|
||||||
else
|
|
||||||
let g:airline_theme=g:airline_light_theme
|
|
||||||
call SetLightTheme()
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Since in .vimrc we cannot call plugin function as they
|
|
||||||
" are not loaded (:help startup)
|
|
||||||
if (g:transparent_dark_theme && g:dark_or_light_theme == 'dark') || (g:transparent_light_theme && g:dark_or_light_theme == 'light')
|
|
||||||
if g:vim_type == 'nvim' && g:vim_version > 0.5
|
|
||||||
let g:transparent_enabled = v:true
|
|
||||||
else
|
|
||||||
call EnableTransparent()
|
|
||||||
endif
|
|
||||||
" call TransparentBackgroundFix()
|
|
||||||
else
|
|
||||||
if g:vim_type == 'nvim' && g:vim_version > 0.5
|
|
||||||
let g:transparent_enabled = v:false
|
|
||||||
else
|
|
||||||
call DisableTransparent()
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Allow to trigger background
|
" Allow to trigger background
|
||||||
function! ToggleBG()
|
function! ToggleBG()
|
||||||
" Inversion
|
" Inversion
|
||||||
@@ -822,7 +894,6 @@ endfunction
|
|||||||
else
|
else
|
||||||
call SetDarkTheme()
|
call SetDarkTheme()
|
||||||
call SetStatusLineTheme(g:airline_dark_theme)
|
call SetStatusLineTheme(g:airline_dark_theme)
|
||||||
" for saving theme state
|
|
||||||
call DeleteSignalFile('.light_theme.signal')
|
call DeleteSignalFile('.light_theme.signal')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -833,6 +904,91 @@ endfunction
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
"""""""""""""""""""""""""""""""""""""""
|
||||||
|
""""""""""""" THEME_INIT """"""""""""""
|
||||||
|
"""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
" transparent backgroud for supported terminal emulator
|
||||||
|
" check if transparent_dark_theme.signl or transparent_light_theme.signl
|
||||||
|
" exist and set respect variable
|
||||||
|
let g:transparent_dark_theme = v:false
|
||||||
|
let g:transparent_light_theme = v:false
|
||||||
|
|
||||||
|
function! Theme_initilize()
|
||||||
|
if SignalFileExists('.transparent_dark_theme.signal')
|
||||||
|
let g:transparent_dark_theme = v:true
|
||||||
|
endif
|
||||||
|
if SignalFileExists('.transparent_light_theme.signal')
|
||||||
|
let g:transparent_light_theme = v:true
|
||||||
|
endif
|
||||||
|
|
||||||
|
" dark or light
|
||||||
|
if filereadable(g:vim_dir . '.light_theme.signal')
|
||||||
|
let g:dark_or_light_theme = 'light'
|
||||||
|
else
|
||||||
|
let g:dark_or_light_theme = 'dark'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if g:dark_or_light_theme == 'dark'
|
||||||
|
let g:airline_theme=g:airline_dark_theme
|
||||||
|
call SetDarkTheme()
|
||||||
|
else
|
||||||
|
let g:airline_theme=g:airline_light_theme
|
||||||
|
call SetLightTheme()
|
||||||
|
endif
|
||||||
|
if (g:transparent_dark_theme && g:dark_or_light_theme == 'dark')
|
||||||
|
\ || (g:transparent_light_theme && g:dark_or_light_theme == 'light')
|
||||||
|
call EnableTransparent()
|
||||||
|
else
|
||||||
|
call DisableTransparent()
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
au! VimEnter * call Theme_initilize()
|
||||||
|
|
||||||
|
"""""""""""""""""""""""""""""""""""""""
|
||||||
|
""""""""""" THEME_OPTIONS """""""""""""
|
||||||
|
"""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
" Default
|
||||||
|
let g:dark_theme = 'default'
|
||||||
|
let g:light_theme = 'default'
|
||||||
|
|
||||||
|
" for airline
|
||||||
|
let g:airline_dark_theme = "angr"
|
||||||
|
let g:airline_light_theme = "silver"
|
||||||
|
|
||||||
|
" vim theme
|
||||||
|
if g:vim_type == 'vim'
|
||||||
|
set t_Co=256
|
||||||
|
if has('termguicolors')
|
||||||
|
set termguicolors
|
||||||
|
endif
|
||||||
|
|
||||||
|
if HasPlug("papercolor-theme")
|
||||||
|
" improve coc color in this theme
|
||||||
|
let g:light_theme = 'PaperColor'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if HasPlug("everforest")
|
||||||
|
let g:light_theme = 'everforest'
|
||||||
|
let g:dark_theme = 'everforest'
|
||||||
|
let g:airline_dark_theme = "everforest"
|
||||||
|
let g:airline_light_theme = "everforest"
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if g:vim_type == 'nvim'
|
||||||
|
if HasPlug("nightfox.nvim")
|
||||||
|
let g:light_theme = 'dawnfox'
|
||||||
|
let g:dark_theme = 'nightfox'
|
||||||
|
end
|
||||||
|
|
||||||
|
if HasPlug("github-nvim-theme")
|
||||||
|
let g:dark_theme = 'github_dark'
|
||||||
|
let g:airline_dark_theme = "hybrid"
|
||||||
|
end
|
||||||
|
endif
|
||||||
|
|
||||||
" }
|
" }
|
||||||
|
|
||||||
" KEY_MAPS
|
" KEY_MAPS
|
||||||
@@ -869,19 +1025,14 @@ endfunction
|
|||||||
" split window comform with other window management shortcuts
|
" split window comform with other window management shortcuts
|
||||||
nnoremap <silent> <C-w>% :vsplit<CR>
|
nnoremap <silent> <C-w>% :vsplit<CR>
|
||||||
nnoremap <silent> <C-w>" :split<CR>
|
nnoremap <silent> <C-w>" :split<CR>
|
||||||
|
" }
|
||||||
|
|
||||||
" }
|
|
||||||
"
|
|
||||||
" Lua configuration
|
" Lua configuration
|
||||||
if g:vim_type == 'nvim' && filereadable(g:mydotfiles_directory . '.vimrc.lua')
|
if g:vim_type == 'nvim' && filereadable(g:mydotfiles_directory . '.vimrc.lua')
|
||||||
execute('source ' . g:mydotfiles_directory . '/.vimrc.lua')
|
execute('source ' . g:mydotfiles_directory . '/.vimrc.lua')
|
||||||
endif
|
endif
|
||||||
"
|
|
||||||
" OTHER_CONFIGS
|
" OTHER_CONFIGS
|
||||||
" {
|
|
||||||
" show mapping info
|
|
||||||
" :verbose map ,cf
|
|
||||||
" }
|
|
||||||
|
|
||||||
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"
|
||||||
|
|||||||
+336
-86
@@ -1,15 +1,146 @@
|
|||||||
|
-------------------------------------------------
|
||||||
|
-------------------OPTIONS-----------------------
|
||||||
|
-------------------------------------------------
|
||||||
|
|
||||||
|
-- enable animation of command like "<C-u>" and "<C-d>", or cursor
|
||||||
|
-- jump animation. (Performence will be effected)
|
||||||
|
local animation_enable = true
|
||||||
|
|
||||||
|
-- false basicly enable plugins like noice, nvim-notify etc.
|
||||||
|
-- local classic_vim_ui = true
|
||||||
|
|
||||||
|
-------------------------------------------------
|
||||||
|
------------------UTILITIES----------------------
|
||||||
|
-------------------------------------------------
|
||||||
|
local vim = vim
|
||||||
|
|
||||||
|
function HasPlug(name)
|
||||||
|
return vim.fn.HasPlug(name)
|
||||||
|
end
|
||||||
|
|
||||||
|
function _G.put(...)
|
||||||
|
local objects = {}
|
||||||
|
for i = 1, select('#', ...) do
|
||||||
|
local v = select(i, ...)
|
||||||
|
table.insert(objects, vim.inspect(v))
|
||||||
|
end
|
||||||
|
|
||||||
|
print(table.concat(objects, '\n'))
|
||||||
|
return ...
|
||||||
|
end
|
||||||
|
|
||||||
|
local wk = nil
|
||||||
|
local function wk_register(opt)
|
||||||
|
if wk == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
wk.register(opt)
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------
|
||||||
|
----------------CONFIGURATION--------------------
|
||||||
|
-------------------------------------------------
|
||||||
|
|
||||||
local vim_version = vim.version()
|
local vim_version = vim.version()
|
||||||
|
|
||||||
local vim_version_minor = vim_version['minor']
|
local vim_version_minor = vim_version['minor']
|
||||||
|
|
||||||
show_icon = false
|
local show_icon = false
|
||||||
if vim.fn.HasPlug('nvim-web-devicons') then
|
if HasPlug('nvim-web-devicons') then
|
||||||
show_icon = true
|
show_icon = true
|
||||||
end
|
end
|
||||||
-- debug
|
|
||||||
-- print(vim.inspect(version))
|
local function nvim_noice_config()
|
||||||
--
|
if classic_vim_ui
|
||||||
|
or not HasPlug('noice.nvim')
|
||||||
|
or not HasPlug('nvim-notify')
|
||||||
|
or not HasPlug('nui.nvim') then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
require("noice").setup({
|
||||||
|
lsp = {
|
||||||
|
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||||
|
override = {
|
||||||
|
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||||
|
["vim.lsp.util.stylize_markdown"] = true,
|
||||||
|
["cmp.entry.get_documentation"] = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- you can enable a preset for easier configuration
|
||||||
|
presets = {
|
||||||
|
bottom_search = true, -- use a classic bottom cmdline for search
|
||||||
|
-- command_palette = true, -- position the cmdline and popupmenu together
|
||||||
|
long_message_to_split = true, -- long messages will be sent to a split
|
||||||
|
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||||
|
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||||
|
},
|
||||||
|
cmdline = {
|
||||||
|
enabled = true, -- enables the Noice cmdline UI
|
||||||
|
-- view = "cmdline", -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom
|
||||||
|
opts = {}, -- global options for the cmdline. See section on views
|
||||||
|
format = {
|
||||||
|
-- cmdline = false,
|
||||||
|
search_down = false,
|
||||||
|
search_up = false,
|
||||||
|
-- filter = false,
|
||||||
|
-- help = false,
|
||||||
|
-- input = {}, -- Used by input()
|
||||||
|
-- lua = false, -- to disable a format, set to `false`
|
||||||
|
},
|
||||||
|
},
|
||||||
|
messages = {
|
||||||
|
-- NOTE: If you enable messages, then the cmdline is enabled automatically.
|
||||||
|
-- This is a current Neovim limitation.
|
||||||
|
enabled = true, -- enables the Noice messages UI
|
||||||
|
view = "notify", -- default view for messages
|
||||||
|
view_error = "notify", -- view for errors
|
||||||
|
view_warn = "notify", -- view for warnings
|
||||||
|
view_history = "messages", -- view for :messages
|
||||||
|
view_search = false, -- view for search count messages. Set to `false` to disable
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local function nvim_scrollbar_config()
|
||||||
|
if classic_vim_ui or
|
||||||
|
not HasPlug('nvim-scrollbar') then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
require("scrollbar").setup({
|
||||||
|
excluded_filetypes = {
|
||||||
|
"prompt",
|
||||||
|
"TelescopePrompt",
|
||||||
|
"noice",
|
||||||
|
"startify",
|
||||||
|
"vista",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local function toggleterm_config()
|
||||||
|
if not HasPlug('toggleterm.nvim') then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
require("toggleterm").setup({
|
||||||
|
open_mapping = [[<c-\>]],
|
||||||
|
})
|
||||||
|
function _G.set_terminal_keymaps()
|
||||||
|
local opts = {buffer = 0}
|
||||||
|
vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts)
|
||||||
|
vim.keymap.set('t', 'jk', [[<C-\><C-n>]], opts)
|
||||||
|
vim.keymap.set('t', '<C-h>', [[<Cmd>wincmd h<CR>]], opts)
|
||||||
|
vim.keymap.set('t', '<C-j>', [[<Cmd>wincmd j<CR>]], opts)
|
||||||
|
vim.keymap.set('t', '<C-k>', [[<Cmd>wincmd k<CR>]], opts)
|
||||||
|
vim.keymap.set('t', '<C-l>', [[<Cmd>wincmd l<CR>]], opts)
|
||||||
|
vim.keymap.set('t', '<C-w>', [[<C-\><C-n><C-w>]], opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
|
||||||
|
end
|
||||||
|
|
||||||
local function vim_illuminate_config()
|
local function vim_illuminate_config()
|
||||||
if not vim.fn.HasPlug('vim-illuminate') then
|
if not HasPlug('vim-illuminate') then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
require('illuminate').configure({
|
require('illuminate').configure({
|
||||||
@@ -39,12 +170,25 @@ local function vim_illuminate_config()
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
local function telescope_config()
|
local function which_key_config()
|
||||||
if not vim.fn.HasPlug('telescope.nvim') then
|
if not HasPlug('which-key.nvim') then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if vim.fn.HasPlug('telescope-fzf-native.nvim') then
|
wk = require("which-key")
|
||||||
|
wk.setup()
|
||||||
|
end
|
||||||
|
|
||||||
|
local function telescope_config()
|
||||||
|
if not HasPlug('telescope.nvim') then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if HasPlug('telescope-fzf-native.nvim') then
|
||||||
require('telescope').setup {
|
require('telescope').setup {
|
||||||
|
pickers = {
|
||||||
|
colorscheme = {
|
||||||
|
enable_preview = true
|
||||||
|
}
|
||||||
|
},
|
||||||
extensions = {
|
extensions = {
|
||||||
fzf = {
|
fzf = {
|
||||||
fuzzy = true, -- false will only do exact matching
|
fuzzy = true, -- false will only do exact matching
|
||||||
@@ -59,64 +203,123 @@ local function telescope_config()
|
|||||||
|
|
||||||
local builtin = require('telescope.builtin')
|
local builtin = require('telescope.builtin')
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader><leader>f', builtin.find_files, {})
|
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = "Search files inside cwd" })
|
||||||
-- need to install ripgrep
|
-- need to install ripgrep
|
||||||
vim.keymap.set('n', '<leader><leader>r', builtin.live_grep, {})
|
vim.keymap.set('n', '<leader>fr', builtin.live_grep, { desc = "Regex search inside files" })
|
||||||
-- vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
|
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = "Search buffers" })
|
||||||
-- vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
|
vim.keymap.set('n', '<leader>fc', builtin.colorscheme, { desc = "Search colorscheme" })
|
||||||
vim.api.nvim_create_autocmd(
|
wk_register({ ["<leader>f"] = { name = "+Telescope" }})
|
||||||
"User",
|
|
||||||
{
|
vim.api.nvim_create_autocmd("User", {
|
||||||
pattern = "TelescopePreviewerLoaded",
|
pattern = "TelescopePreviewerLoaded",
|
||||||
command = "setlocal wrap number"
|
command = "setlocal wrap number" })
|
||||||
}
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function github_theme_config()
|
local function github_theme_config()
|
||||||
if not vim.fn.HasPlug('github-nvim-theme') then
|
if not HasPlug('github-nvim-theme') then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- Example config in Lua
|
-- Example config in Lua
|
||||||
require("github-theme").setup({
|
require("github-theme").setup({
|
||||||
-- Overwrite the highlight groups
|
-- Overwrite the highlight groups
|
||||||
overrides = function(c)
|
overrides = function(c)
|
||||||
return {
|
return {
|
||||||
NormalFloat = { link = 'Pmenu' },
|
NormalFloat = { link = 'Pmenu' },
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
local function color_picker_nvim_config()
|
local function animate_config()
|
||||||
-- config for ziontee113/color-picker.nvim
|
if not animation_enable then
|
||||||
require("color-picker").setup({
|
|
||||||
["keymap"] = { -- mapping example:
|
|
||||||
["U"] = "<Plug>ColorPickerSlider5Decrease",
|
|
||||||
["O"] = "<Plug>ColorPickerSlider5Increase",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
local opts = { noremap = true, silent = true }
|
|
||||||
|
|
||||||
vim.keymap.set("n", "cp", "<cmd>PickColor<cr>", opts)
|
|
||||||
-- vim.keymap.set("i", "<C-u>c", "<cmd>PickColorInsert<cr>", opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
local function indent_blankline_config()
|
|
||||||
if not vim.fn.HasPlug('indent-blankline.nvim') then
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- Example config in Lua
|
|
||||||
require("indent_blankline").setup {
|
|
||||||
show_current_context = true,
|
|
||||||
filetype_exclude = { "lspinfo", "packer", "checkhealth", "help", "man", "", "startify",}
|
|
||||||
-- use_treesitter = true,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if HasPlug('mini.animate') then
|
||||||
|
|
||||||
|
local animate = require('mini.animate')
|
||||||
|
animate.setup({
|
||||||
|
cursor = {
|
||||||
|
-- Whether to enable this animation
|
||||||
|
enable = true,
|
||||||
|
-- Timing of animation (how steps will progress in time)
|
||||||
|
-- timing = --<function: implements linear total 250ms animation duration>,
|
||||||
|
},
|
||||||
|
scroll = {
|
||||||
|
-- Whether to enable this animation
|
||||||
|
enable = true,
|
||||||
|
-- Timing of animation (how steps will progress in time)
|
||||||
|
timing = animate.gen_timing.linear({ duration = 150, unit = 'total' }),
|
||||||
|
},
|
||||||
|
open = {
|
||||||
|
-- Whether to enable this animation
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason",
|
||||||
|
"NvimTree", "vista", "toggleterm", "noice" },
|
||||||
|
callback = function()
|
||||||
|
vim.b.minianimate_disable = true
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- if HasPlug('neoscroll.nvim') then
|
||||||
|
-- require('neoscroll').setup({
|
||||||
|
-- -- Set any options as needed
|
||||||
|
-- mappings = {'<C-u>', '<C-d>', '<C-b>', '<C-f>',
|
||||||
|
-- },
|
||||||
|
-- })
|
||||||
|
|
||||||
|
-- local t = {}
|
||||||
|
-- -- Syntax: t[keys] = {function, {function arguments}}
|
||||||
|
-- t['<C-u>'] = {'scroll', {'-vim.wo.scroll', 'true', '150'}}
|
||||||
|
-- t['<C-d>'] = {'scroll', { 'vim.wo.scroll', 'true', '150'}}
|
||||||
|
-- t['<C-b>'] = {'scroll', {'-vim.api.nvim_win_get_height(0)', 'true', '200'}}
|
||||||
|
-- t['<C-f>'] = {'scroll', { 'vim.api.nvim_win_get_height(0)', 'true', '200'}}
|
||||||
|
-- -- t['zb'] = {'zb', {'250'}}
|
||||||
|
|
||||||
|
-- require('neoscroll.config').set_mappings(t)
|
||||||
|
-- end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function indentline_config()
|
||||||
|
if not animation_enable then
|
||||||
|
if HasPlug('indent-blankline.nvim') then
|
||||||
|
-- Example config in Lua
|
||||||
|
require("indent_blankline").setup {
|
||||||
|
show_current_context = true,
|
||||||
|
filetype_exclude = { "lspinfo", "packer", "checkhealth", "help", "man", "", "startify",}
|
||||||
|
-- use_treesitter = true,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if HasPlug('mini.indentscope') then
|
||||||
|
MiniIndentscope = require('mini.indentscope')
|
||||||
|
MiniIndentscope.setup({
|
||||||
|
symbol = '│',
|
||||||
|
-- draw = {
|
||||||
|
-- animation = MiniIndentscope.gen_animation.linear({
|
||||||
|
-- easing = 'out',
|
||||||
|
-- duration = 150,
|
||||||
|
-- unit = 'total'
|
||||||
|
-- })
|
||||||
|
-- },
|
||||||
|
})
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason",
|
||||||
|
"NvimTree", "vista", "startify", "toggleterm" },
|
||||||
|
callback = function()
|
||||||
|
vim.b.miniindentscope_disable = true
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function transparent_config()
|
local function transparent_config()
|
||||||
if not vim.fn.HasPlug('nvim-transparent') then
|
if not HasPlug('nvim-transparent') then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
require("transparent").setup({
|
require("transparent").setup({
|
||||||
@@ -131,16 +334,37 @@ local function transparent_config()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function lualine_config()
|
local function lualine_config()
|
||||||
if not vim.fn.HasPlug('lualine.nvim') then
|
if not HasPlug('lualine.nvim') then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
for i=1,9 do
|
|
||||||
vim.api.nvim_set_keymap('n', '<Leader>'..i, ':LualineBuffersJump '..i..'<CR>', { noremap = true, silent = true, nowait = true })
|
vim.api.nvim_set_hl(0, 'CocstatusSucceed', { fg = "#e32be0"})
|
||||||
-- :nnoremap <silent> <Leader>1 :LualineBuffersJump 1<CR>
|
vim.api.nvim_set_hl(0, 'CocstatusLoading', { fg = "#35f0e9"})
|
||||||
end
|
-- custom lualine plugin show coc lsp status
|
||||||
for i=10,20 do
|
local function cocstatus()
|
||||||
vim.api.nvim_set_keymap('n', '<Space>'..i, ':LualineBuffersJump '..i..'<CR>', { noremap = true, silent = true, nowait = true })
|
local loading = {"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}
|
||||||
-- :nnoremap <silent> <Leader>1 :LualineBuffersJump 1<CR>
|
local step = #loading
|
||||||
|
local ok, result = pcall( vim.fn.CocAction, 'services')
|
||||||
|
if not ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local ft = vim.bo.filetype
|
||||||
|
local state, id
|
||||||
|
for _, entry in ipairs(result) do
|
||||||
|
if entry['languageIds'][1] == ft then
|
||||||
|
state = entry['state']
|
||||||
|
id = entry['id']
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local speed = 1600
|
||||||
|
local loadidx = (vim.loop.now() % speed)
|
||||||
|
local msg = "LSP(" .. id .. ")"
|
||||||
|
if state == "starting" then
|
||||||
|
return msg .. " %#CocstatusLoading#" .. loading[math.floor(loadidx/(step * (speed/100))) + 1]
|
||||||
|
end
|
||||||
|
return msg .. " %#CocstatusSucceed#✔"
|
||||||
end
|
end
|
||||||
|
|
||||||
local disabled_filetypes_data = {}
|
local disabled_filetypes_data = {}
|
||||||
@@ -153,52 +377,69 @@ local function lualine_config()
|
|||||||
'vista'
|
'vista'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
require('lualine').setup {
|
|
||||||
|
local opt = {
|
||||||
options = {
|
options = {
|
||||||
icons_enabled = show_icon,
|
icons_enabled = show_icon,
|
||||||
theme = 'auto', -- lualine theme
|
theme = 'auto', -- lualine theme
|
||||||
-- theme = 'ayu', -- lualine theme
|
-- theme = 'ayu', -- lualine theme
|
||||||
always_divide_middle = false, -- When set to true, left sections i.e. 'a','b' and 'c'
|
-- component_separators = { left = '', right = ''},
|
||||||
-- can't take over the entire statusline even
|
-- section_separators = { left = '', right = ''},
|
||||||
-- if neither of 'x', 'y' or 'z' are present.
|
component_separators = { left = '', right = ''},
|
||||||
|
section_separators = { left = '', right = ''},
|
||||||
|
|
||||||
|
always_divide_middle = false,
|
||||||
globalstatus = true,
|
globalstatus = true,
|
||||||
disabled_filetypes = disabled_filetypes_data,
|
disabled_filetypes = disabled_filetypes_data,
|
||||||
|
refresh = {statusline = 200}
|
||||||
},
|
},
|
||||||
sections = {
|
sections = {
|
||||||
lualine_a = {'mode'},
|
lualine_a = { 'mode' },
|
||||||
lualine_b = {},
|
lualine_b = {},
|
||||||
lualine_c = {
|
lualine_c = {
|
||||||
{
|
{
|
||||||
'buffers',
|
'buffers',
|
||||||
mode = 2,
|
mode = 2,
|
||||||
filetype_names = {
|
filetype_names = {
|
||||||
TelescopePrompt = 'Telescope',
|
TelescopePrompt = 'Telescope',
|
||||||
dashboard = 'Dashboard',
|
dashboard = 'Dashboard',
|
||||||
packer = 'Packer',
|
packer = 'Packer',
|
||||||
fzf = 'FZF',
|
fzf = 'FZF',
|
||||||
alpha = 'Alpha',
|
alpha = 'Alpha',
|
||||||
NvimTree = ''
|
NvimTree = '',
|
||||||
},
|
vista = ''
|
||||||
max_length = vim.o.columns - 27, -- Maximum width of buffers component,
|
},
|
||||||
-- it can also be a function that returns
|
symbols = {
|
||||||
-- the value of `max_length` dynamically.
|
modified = ' ●', -- Text to show when the buffer is modified
|
||||||
symbols = {
|
alternate_file = '', -- Text to show to identify the alternate file
|
||||||
modified = ' ●', -- Text to show when the buffer is modified
|
directory = '', -- Text to show when the buffer is a directory
|
||||||
alternate_file = '', -- Text to show to identify the alternate file
|
},
|
||||||
directory = '', -- Text to show when the buffer is a directory
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
-- lualine_x = {'encoding', 'fileformat', 'filetype'},
|
-- lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||||
lualine_x = {},
|
lualine_x = { cocstatus },
|
||||||
lualine_y = {},
|
lualine_y = {'encoding'},
|
||||||
lualine_z = {'encoding', 'location'}
|
lualine_z = {'location' }
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require('lualine').setup(opt)
|
||||||
|
|
||||||
|
for i=1,9 do
|
||||||
|
-- :nnoremap <silent> <Leader>1 :LualineBuffersJump 1<CR>
|
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>' .. i, ':LualineBuffersJump ' .. i .. '<CR>',
|
||||||
|
{ noremap = true, silent = true, nowait = true })
|
||||||
|
end
|
||||||
|
for i=10,20 do
|
||||||
|
-- :nnoremap <silent> <Leader>1 :LualineBuffersJump 1<CR>
|
||||||
|
vim.api.nvim_set_keymap('n', '<Space>' .. i, ':LualineBuffersJump ' .. i .. '<CR>',
|
||||||
|
{ noremap = true, silent = true, nowait = true })
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function nvim_treesitter_config()
|
local function nvim_treesitter_config()
|
||||||
if not vim.fn.HasPlug('nvim-treesitter') then
|
if not HasPlug('nvim-treesitter') then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
require('nvim-treesitter.configs').setup {
|
require('nvim-treesitter.configs').setup {
|
||||||
@@ -214,7 +455,7 @@ local function nvim_treesitter_config()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function nvim_tree_config()
|
local function nvim_tree_config()
|
||||||
if not vim.fn.HasPlug('nvim-tree.lua') then
|
if not HasPlug('nvim-tree.lua') then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- disable netrw at the very start of your init.lua (strongly advised)
|
-- disable netrw at the very start of your init.lua (strongly advised)
|
||||||
@@ -272,17 +513,26 @@ end
|
|||||||
if vim_version_minor >= 5 then
|
if vim_version_minor >= 5 then
|
||||||
vim_illuminate_config()
|
vim_illuminate_config()
|
||||||
transparent_config()
|
transparent_config()
|
||||||
lualine_config()
|
|
||||||
github_theme_config()
|
github_theme_config()
|
||||||
indent_blankline_config()
|
indentline_config()
|
||||||
|
which_key_config()
|
||||||
|
animate_config()
|
||||||
|
nvim_scrollbar_config()
|
||||||
end
|
end
|
||||||
if vim_version_minor >= 7 then
|
if vim_version_minor >= 7 then
|
||||||
nvim_treesitter_config()
|
nvim_treesitter_config()
|
||||||
telescope_config()
|
telescope_config()
|
||||||
-- color_picker_nvim_config()
|
toggleterm_config()
|
||||||
-- lsp_zero_config()
|
|
||||||
end
|
end
|
||||||
if vim_version_minor >= 8 then
|
if vim_version_minor >= 8 then
|
||||||
nvim_tree_config()
|
nvim_tree_config()
|
||||||
|
nvim_noice_config()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function late_loading()
|
||||||
|
lualine_config()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- late loading
|
||||||
|
vim.api.nvim_create_autocmd({ "VimEnter" },
|
||||||
|
{ pattern = { "*" }, callback = late_loading, })
|
||||||
|
|||||||
Reference in New Issue
Block a user