.
This commit is contained in:
@@ -2,6 +2,5 @@
|
|||||||
*.pyc
|
*.pyc
|
||||||
*._*
|
*._*
|
||||||
.vim/
|
.vim/
|
||||||
autoload/
|
|
||||||
node_modules/
|
node_modules/
|
||||||
tags
|
tags
|
||||||
|
|||||||
@@ -115,7 +115,7 @@
|
|||||||
" endif
|
" endif
|
||||||
|
|
||||||
set backspace=indent,eol,start " Backspace for dummies
|
set backspace=indent,eol,start " Backspace for dummies
|
||||||
|
set fillchars=eob:\ " it can remove '~' at the end of buffer
|
||||||
set number " Line numbers on
|
set number " Line numbers on
|
||||||
set showmatch " Show matching brackets/parenthesis
|
set showmatch " Show matching brackets/parenthesis
|
||||||
set incsearch " Find as you type search
|
set incsearch " Find as you type search
|
||||||
|
|||||||
+26
-21
@@ -7,7 +7,7 @@
|
|||||||
" KEY_MAPS
|
" KEY_MAPS
|
||||||
" OTHER_CONFIGS
|
" OTHER_CONFIGS
|
||||||
|
|
||||||
let g:debug_mode = v:true
|
let g:debug_mode = v:false
|
||||||
let g:high_performence = v:false " set true will also disable animation
|
let g:high_performence = v:false " set true will also disable animation
|
||||||
let g:autocomplte_enable = v:true
|
let g:autocomplte_enable = v:true
|
||||||
let g:copilot_enable = v:false
|
let g:copilot_enable = v:false
|
||||||
@@ -27,7 +27,7 @@ nmap <leader><leader>t :call SwapWord()<CR>
|
|||||||
|
|
||||||
"""""" PLUGIN_INSTALL """"""
|
"""""" PLUGIN_INSTALL """"""
|
||||||
|
|
||||||
let g:mydotfiles_directory = expand('~/.dotfiles/')
|
let g:dotfiledir = expand('~/.dotfiles/')
|
||||||
let g:plugin_dir = expand('~/.vim/plugged/')
|
let g:plugin_dir = expand('~/.vim/plugged/')
|
||||||
let g:config_file_path = g:vim_dir . ".config.vim"
|
let g:config_file_path = g:vim_dir . ".config.vim"
|
||||||
call plug#begin(g:plugin_dir)
|
call plug#begin(g:plugin_dir)
|
||||||
@@ -38,6 +38,9 @@ call plug#begin(g:plugin_dir)
|
|||||||
endfunction
|
endfunction
|
||||||
let g:animation_enable = g:high_performence ? v:false : g:animation_enable
|
let g:animation_enable = g:high_performence ? v:false : g:animation_enable
|
||||||
|
|
||||||
|
" custom plugin
|
||||||
|
Plug 'Donaldttt/fzf-color-preview', Cond(g:vim_v >= 800)
|
||||||
|
|
||||||
"""" THEME_PLUGINS """"
|
"""" THEME_PLUGINS """"
|
||||||
|
|
||||||
Plug 'sainnhe/everforest'
|
Plug 'sainnhe/everforest'
|
||||||
@@ -160,7 +163,7 @@ augroup end
|
|||||||
"""""" UTILITIES """"""
|
"""""" UTILITIES """"""
|
||||||
|
|
||||||
" import ultilities functions
|
" import ultilities functions
|
||||||
execute('source ' . g:mydotfiles_directory . '/utils.vim')
|
execute('source ' . g:dotfiledir . '/utils.vim')
|
||||||
|
|
||||||
function! SaveConfig()
|
function! SaveConfig()
|
||||||
let p = ReadVariable(g:config_file_path)
|
let p = ReadVariable(g:config_file_path)
|
||||||
@@ -431,10 +434,10 @@ if HasPlug("vim-bufferline") && HasPlug("vim-airline")
|
|||||||
|
|
||||||
" scrolling with fixed current buffer position
|
" scrolling with fixed current buffer position
|
||||||
|
|
||||||
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_inactive_highlight = 'airline_b_inactive'
|
let g:bufferline_inactive_highlight = 'airline_c'
|
||||||
let g:bufferline_active_highlight = 'airline_b_bold'
|
let g:bufferline_active_highlight = 'airline_c_bold'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if HasPlug("undotree")
|
if HasPlug("undotree")
|
||||||
@@ -504,8 +507,10 @@ if HasPlug("vim-airline")
|
|||||||
" TODO
|
" TODO
|
||||||
" 22 is a magic number, it is best it can change as buffer width
|
" 22 is a magic number, it is best it can change as buffer width
|
||||||
" changing
|
" changing
|
||||||
|
|
||||||
" This must use my fork version of bufferline
|
" This must use my fork version of bufferline
|
||||||
let g:bufferline_max_length = &columns - 22
|
" the number of cols bufferline cannot use out of max of screen cols
|
||||||
|
let g:bufferline_forbided_col = 32
|
||||||
call airline#parts#define_function('bufnum', 'AirlineBufferNumber')
|
call airline#parts#define_function('bufnum', 'AirlineBufferNumber')
|
||||||
call airline#parts#define_function('cocstatus', 'AirlineCocStatus')
|
call airline#parts#define_function('cocstatus', 'AirlineCocStatus')
|
||||||
call airline#parts#define_accent('cocstatus', 'italic')
|
call airline#parts#define_accent('cocstatus', 'italic')
|
||||||
@@ -527,9 +532,10 @@ if HasPlug("vim-airline")
|
|||||||
" let g:airline_section_y = '%{%airline#util#wrap(AirlineCocStatus(), 0)%}'
|
" let g:airline_section_y = '%{%airline#util#wrap(AirlineCocStatus(), 0)%}'
|
||||||
let g:airline_section_a = airline#section#create(['mode'])
|
let g:airline_section_a = airline#section#create(['mode'])
|
||||||
let g:airline_section_b = ''
|
let g:airline_section_b = ''
|
||||||
let g:airline_section_error = ''
|
let g:airline_section_error = ''
|
||||||
let g:airline_section_warning = ''
|
let g:airline_section_warning = ''
|
||||||
let g:airline_section_x = airline#section#create(['bufnum'])
|
" let g:airline_section_x = airline#section#create(['bufnum'])
|
||||||
|
let g:airline_section_x = ''
|
||||||
let g:airline_section_y = _airline_section_y
|
let g:airline_section_y = _airline_section_y
|
||||||
let g:airline_section_z = airline#section#create(['filetype'])
|
let g:airline_section_z = airline#section#create(['filetype'])
|
||||||
" see source for current list
|
" see source for current list
|
||||||
@@ -598,7 +604,7 @@ if HasPlug("fzf") && HasPlug("fzf.vim")
|
|||||||
if g:os == 'Windows'
|
if g:os == 'Windows'
|
||||||
let g:fzf_preview_window = []
|
let g:fzf_preview_window = []
|
||||||
else
|
else
|
||||||
let g:fzf_preview_window = ['right:50%', 'ctrl-/']
|
let g:fzf_preview_window = ['right:50%']
|
||||||
end
|
end
|
||||||
|
|
||||||
let g:fzf_colors = {
|
let g:fzf_colors = {
|
||||||
@@ -630,22 +636,21 @@ if HasPlug("fzf") && HasPlug("fzf.vim")
|
|||||||
function! FzfAirlineColorSelect(color_name)
|
function! FzfAirlineColorSelect(color_name)
|
||||||
call SetStatusLineTheme(&background, a:color_name)
|
call SetStatusLineTheme(&background, a:color_name)
|
||||||
endfunction
|
endfunction
|
||||||
|
let g:VimrpcFzfColor = function('FzfColorSelect')
|
||||||
|
let g:VimrpcFzfAirline = function('FzfAirlineColorSelect')
|
||||||
|
|
||||||
noremap <leader>fr :Rg<CR>
|
noremap <leader>fr :Rg<CR>
|
||||||
noremap <leader>ff :Files<CR>
|
noremap <leader>ff :Files<CR>
|
||||||
noremap <leader>ft :CFile<CR>
|
noremap <leader>ft :CFile<CR>
|
||||||
noremap <leader>fc :call fzf#vim#colors({
|
noremap <leader>fa :AirlinePreview<CR>
|
||||||
\ 'sink': function('FzfColorSelect')})<CR>
|
noremap <leader>fc :ColorsPreview<CR>
|
||||||
noremap <leader>fa :call fzf#run(fzf#wrap({
|
|
||||||
\ 'source': airline#util#themes(''),
|
|
||||||
\ 'sink': function('FzfAirlineColorSelect')}))<CR>
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if HasPlug("coc.nvim") && executable('node')
|
if HasPlug("coc.nvim") && executable('node')
|
||||||
" coc-clangd: c/c++, may need to install clangd seperatly
|
" coc-clangd: c/c++, may need to install clangd seperatly
|
||||||
|
|
||||||
if filereadable(g:mydotfiles_directory . "/coc-nvim-config.vim")
|
if filereadable(g:dotfiledir . "/coc-nvim-config.vim")
|
||||||
exec "source " . g:mydotfiles_directory . "/coc-nvim-config.vim"
|
exec "source " . g:dotfiledir . "/coc-nvim-config.vim"
|
||||||
endif
|
endif
|
||||||
" warning that coc work best for vim >= 8.3
|
" warning that coc work best for vim >= 8.3
|
||||||
let g:coc_disable_startup_warning = 1
|
let g:coc_disable_startup_warning = 1
|
||||||
@@ -941,8 +946,8 @@ endif
|
|||||||
"""""" OTHERS """"""
|
"""""" OTHERS """"""
|
||||||
|
|
||||||
" Lua configuration
|
" Lua configuration
|
||||||
if has('nvim') && filereadable(g:mydotfiles_directory . '.vimrc.lua')
|
if has('nvim') && filereadable(g:dotfiledir . '.vimrc.lua')
|
||||||
execute('source ' . g:mydotfiles_directory . '/.vimrc.lua')
|
execute('source ' . g:dotfiledir . '/.vimrc.lua')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call s:executeLateInit()
|
call s:executeLateInit()
|
||||||
|
|||||||
+4
-1
@@ -502,7 +502,7 @@ local function nvim_tree_config()
|
|||||||
vim.g.loaded_netrw = 1
|
vim.g.loaded_netrw = 1
|
||||||
vim.g.loaded_netrwPlugin = 1
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
|
||||||
local api = require('nvim-tree.api')
|
local api = require('nvim-tree.api')
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
function M.print_node_path()
|
function M.print_node_path()
|
||||||
@@ -539,6 +539,9 @@ local function nvim_tree_config()
|
|||||||
filters = {
|
filters = {
|
||||||
dotfiles = false,
|
dotfiles = false,
|
||||||
},
|
},
|
||||||
|
git = {
|
||||||
|
ignore = false,
|
||||||
|
},
|
||||||
actions = {
|
actions = {
|
||||||
open_file = {
|
open_file = {
|
||||||
quit_on_open = true,
|
quit_on_open = true,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#! /usr/bin/env python
|
#! /usr/bin/env python3
|
||||||
|
|
||||||
""" Convert values between RGB hex codes and xterm-256 color codes.
|
""" Convert values between RGB hex codes and xterm-256 color codes.
|
||||||
|
|
||||||
|
|||||||
@@ -1,69 +0,0 @@
|
|||||||
|
|
||||||
function! GetHi(group, term)
|
|
||||||
" Store output of group to variable
|
|
||||||
let output = execute('hi ' . a:group)
|
|
||||||
" Find the term we're looking for
|
|
||||||
return matchstr(output, a:term.'=\zs\S*')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! StrIsNr(input)
|
|
||||||
if a:input =~# '^\d\+$'
|
|
||||||
return v:true
|
|
||||||
endif
|
|
||||||
return v:false
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Pick an appropriate 256 color base on old color
|
|
||||||
function! SuitableColor(oldColor)
|
|
||||||
return a:oldColor - 40
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ThemeFix()
|
|
||||||
let newValue = -1
|
|
||||||
let hiGroups = ['CocErrorFloat', 'CocFloating', 'NormalFloat']
|
|
||||||
if has('nvim')
|
|
||||||
for group in hiGroups
|
|
||||||
if hlexists(group)
|
|
||||||
let oldColor = GetHi(group, 'ctermbg')
|
|
||||||
if StrIsNr(oldColor)
|
|
||||||
let newValue = SuitableColor(str2nr(oldColor))
|
|
||||||
" execute('hi ' . group . ' ctermbg=' . newValue)
|
|
||||||
execute('autocmd! ColorScheme * hi ' . group . ' ctermbg=' . newValue)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
end
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! GetRidOfBg()
|
|
||||||
let hiGroups = ['CocErrorSign', 'CocWarningSign', 'CocHintSign']
|
|
||||||
for group in hiGroups
|
|
||||||
if hlexists(group)
|
|
||||||
execute('hi ' . group . ' ctermbg=none')
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! CocThemeFix()
|
|
||||||
hi CocErrorHighlight cterm=underline ctermfg=124 ctermbg=none " Keyword at the error position highlight
|
|
||||||
hi CocErrorSign ctermbg=none ctermfg=124 " Error Sign at the sign column highlight
|
|
||||||
|
|
||||||
hi CocWarningSign ctermbg=none ctermfg=214 " Warning Sign at the sign column highlight
|
|
||||||
hi CocHintSign ctermbg=none ctermfg=214 " Hint Sign at the sign column highlight
|
|
||||||
hi CocUnusedHighlight cterm=underline ctermfg=214 ctermbg=none " Unused variable/function etc. highlight
|
|
||||||
hi CocWarningHighlight cterm=underline ctermfg=214 ctermbg=none " Warning variable/function etc. highlight
|
|
||||||
|
|
||||||
hi CocInfoHighlight ctermfg=207 ctermbg=none " Info variable/function etc. highlight
|
|
||||||
hi CocInfoSign ctermbg=none ctermfg=207 " Info Sign at the sign column highlight
|
|
||||||
|
|
||||||
hi Todo ctermbg=none ctermfg=214 " Info Sign at the sign column highlight
|
|
||||||
|
|
||||||
hi Error cterm=underline ctermfg=124 ctermbg=none
|
|
||||||
hi javaError cterm=underline ctermfg=124 ctermbg=none
|
|
||||||
|
|
||||||
highlight CursorLineNr ctermbg=none
|
|
||||||
highlight SignColumn ctermbg=none
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
call CocThemeFix()
|
|
||||||
au! ColorScheme * call CocThemeFix()
|
|
||||||
Reference in New Issue
Block a user