.
This commit is contained in:
@@ -80,8 +80,14 @@
|
|||||||
"
|
"
|
||||||
" set tabpagemax=15 " Only show 15 tabs
|
" set tabpagemax=15 " Only show 15 tabs
|
||||||
" set showmode " Display the current mode
|
" set showmode " Display the current mode
|
||||||
set cursorline " Highlight current line
|
set cursorline " Highlight current line
|
||||||
set cmdheight=1 " get rid of the extra useless line at the bottom(not working, probably a plugin is changing the value)
|
|
||||||
|
" get rid of current line highlight, instead just highlight the number column
|
||||||
|
augroup CLClear
|
||||||
|
autocmd! ColorScheme * hi clear CursorLine
|
||||||
|
augroup END
|
||||||
|
|
||||||
|
set cmdheight=1 " get rid of the extra useless line at the bottom(if not working, probably a plugin is changing the value)
|
||||||
|
|
||||||
"highlight clear SignColumn " SignColumn should match background
|
"highlight clear SignColumn " SignColumn should match background
|
||||||
"highlight clear LineNr " Current line number row will have same background color in relative mode
|
"highlight clear LineNr " Current line number row will have same background color in relative mode
|
||||||
@@ -151,21 +157,21 @@
|
|||||||
noremap k gk
|
noremap k gk
|
||||||
|
|
||||||
" Stupid shift key fixes
|
" Stupid shift key fixes
|
||||||
if !exists('g:spf13_no_keyfixes')
|
" if !exists('g:spf13_no_keyfixes')
|
||||||
if has("user_commands")
|
" if has("user_commands")
|
||||||
command! -bang -nargs=* -complete=file E e<bang> <args>
|
" command! -bang -nargs=* -complete=file E e<bang> <args>
|
||||||
command! -bang -nargs=* -complete=file W w<bang> <args>
|
" command! -bang -nargs=* -complete=file W w<bang> <args>
|
||||||
command! -bang -nargs=* -complete=file Wq wq<bang> <args>
|
" command! -bang -nargs=* -complete=file Wq wq<bang> <args>
|
||||||
command! -bang -nargs=* -complete=file WQ wq<bang> <args>
|
" command! -bang -nargs=* -complete=file WQ wq<bang> <args>
|
||||||
command! -bang Wa wa<bang>
|
" command! -bang Wa wa<bang>
|
||||||
command! -bang WA wa<bang>
|
" command! -bang WA wa<bang>
|
||||||
command! -bang Q q<bang>
|
" command! -bang Q q<bang>
|
||||||
command! -bang QA qa<bang>
|
" command! -bang QA qa<bang>
|
||||||
command! -bang Qa qa<bang>
|
" command! -bang Qa qa<bang>
|
||||||
endif
|
" endif
|
||||||
|
|
||||||
cmap Tabe tabe
|
" cmap Tabe tabe
|
||||||
endif
|
" endif
|
||||||
|
|
||||||
" Yank from the cursor to the end of the line, to be consistent with C and D.
|
" Yank from the cursor to the end of the line, to be consistent with C and D.
|
||||||
nnoremap Y y$
|
nnoremap Y y$
|
||||||
@@ -207,17 +213,7 @@
|
|||||||
map zh zH
|
map zh zH
|
||||||
|
|
||||||
" Easier formatting
|
" Easier formatting
|
||||||
nnoremap <silent> <leader>q gwip
|
" nnoremap <silent> <leader>q gwip
|
||||||
|
|
||||||
" Plugins {
|
|
||||||
|
|
||||||
" AutoCloseTag {
|
|
||||||
" Make it so AutoCloseTag works for xml and xhtml files as well
|
|
||||||
au FileType xhtml,xml ru ftplugin/html/autoclosetag.vim
|
|
||||||
nmap <Leader>ac <Plug>ToggleAutoCloseMappings
|
|
||||||
" }
|
|
||||||
|
|
||||||
" }
|
|
||||||
|
|
||||||
" Functions {
|
" Functions {
|
||||||
|
|
||||||
|
|||||||
+143
-91
@@ -36,18 +36,12 @@
|
|||||||
let g:closetag_filenames = '*.html,*.xhtml,*.phtml, *.js'
|
let g:closetag_filenames = '*.html,*.xhtml,*.phtml, *.js'
|
||||||
" }
|
" }
|
||||||
|
|
||||||
Plug 'scrooloose/nerdtree'
|
|
||||||
|
|
||||||
" for markdown{
|
" for markdown{
|
||||||
Plug 'preservim/vim-markdown'
|
Plug 'preservim/vim-markdown'
|
||||||
"}
|
"}
|
||||||
|
|
||||||
" for window resize{
|
Plug 'simeji/winresizer'
|
||||||
Plug 'simeji/winresizer'
|
|
||||||
let g:winresizer_start_key = '<leader-r>'
|
|
||||||
let g:winresizer_vert_resize = 2
|
|
||||||
let g:winresizer_horiz_resize = 2
|
|
||||||
" }
|
|
||||||
|
|
||||||
Plug 'tpope/vim-surround'
|
Plug 'tpope/vim-surround'
|
||||||
Plug 'rhysd/conflict-marker.vim'
|
Plug 'rhysd/conflict-marker.vim'
|
||||||
@@ -55,7 +49,7 @@
|
|||||||
Plug 'jiangmiao/auto-pairs'
|
Plug 'jiangmiao/auto-pairs'
|
||||||
Plug 'mg979/vim-visual-multi'
|
Plug 'mg979/vim-visual-multi'
|
||||||
|
|
||||||
Plug 'easymotion/vim-easymotion'
|
"Plug 'easymotion/vim-easymotion'
|
||||||
Plug 'vim-scripts/restore_view.vim'
|
Plug 'vim-scripts/restore_view.vim'
|
||||||
|
|
||||||
if executable('fzf')
|
if executable('fzf')
|
||||||
@@ -74,17 +68,20 @@
|
|||||||
Plug 'wellle/tmux-complete.vim'
|
Plug 'wellle/tmux-complete.vim'
|
||||||
Plug 'NoahTheDuke/vim-just'
|
Plug 'NoahTheDuke/vim-just'
|
||||||
|
|
||||||
Plug 'ludovicchabant/vim-gutentags', { 'for': ['c', 'cpp'] }
|
Plug 'ludovicchabant/vim-gutentags', { 'for': ['c', 'cpp', 'vim'] }
|
||||||
Plug 'lambdalisue/readablefold.vim'
|
Plug 'lambdalisue/readablefold.vim'
|
||||||
|
|
||||||
" only work with vim
|
" only work with vim
|
||||||
if g:vim_type == 'vim'
|
if g:vim_type == 'vim'
|
||||||
|
Plug 'scrooloose/nerdtree'
|
||||||
|
" Plug 'tribela/vim-transparent'
|
||||||
Plug 'vim-airline/vim-airline'
|
Plug 'vim-airline/vim-airline'
|
||||||
Plug 'vim-airline/vim-airline-themes'
|
Plug 'vim-airline/vim-airline-themes'
|
||||||
|
" The bottom buffer display
|
||||||
|
Plug 'Donaldttt/vim-bufferline'
|
||||||
|
" Plug 'itchyny/lightline.vim'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" The bottom buffer display
|
|
||||||
Plug 'bling/vim-bufferline'
|
|
||||||
" only work with nvim > 0.5
|
" only work with nvim > 0.5
|
||||||
" For other versions, just loading the plugin may
|
" For other versions, just loading the plugin may
|
||||||
" cause error
|
" cause error
|
||||||
@@ -98,16 +95,20 @@
|
|||||||
|
|
||||||
Plug 'nvim-lualine/lualine.nvim'
|
Plug 'nvim-lualine/lualine.nvim'
|
||||||
|
|
||||||
" partial code execution
|
|
||||||
" Plug 'michaelb/sniprun', {'do': 'bash install.sh'}
|
|
||||||
endif
|
endif
|
||||||
if g:vim_version >= 0.7
|
if g:vim_version >= 0.7
|
||||||
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
||||||
|
|
||||||
|
" comment out this plugin if the machine doesn't have required
|
||||||
|
" font install
|
||||||
Plug 'nvim-tree/nvim-web-devicons'
|
Plug 'nvim-tree/nvim-web-devicons'
|
||||||
endif
|
endif
|
||||||
if g:vim_version >= 0.8
|
if g:vim_version >= 0.8
|
||||||
Plug 'nvim-tree/nvim-tree.lua'
|
Plug 'nvim-tree/nvim-tree.lua'
|
||||||
endif
|
endif
|
||||||
|
if g:vim_version < 0.8
|
||||||
|
Plug 'scrooloose/nerdtree'
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
@@ -135,19 +136,25 @@ if g:vim_type == 'nvim'
|
|||||||
if g:vim_version >= 0.7
|
if g:vim_version >= 0.7
|
||||||
" nvim-treesitter/nvim-treesitter {
|
" nvim-treesitter/nvim-treesitter {
|
||||||
|
|
||||||
if filereadable(expand(g:dotfile_path . '.vimrc.lua'))
|
|
||||||
execute('source ' . g:dotfile_path . '/.vimrc.lua')
|
|
||||||
endif
|
|
||||||
|
|
||||||
" }
|
" }
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
" }
|
" }
|
||||||
|
" simeji/winresizer {
|
||||||
|
if isdirectory(expand(plugin_dir . "/winresizer"))
|
||||||
|
let g:winresizer_vert_resize = 2
|
||||||
|
let g:winresizer_horiz_resize = 2
|
||||||
|
nnoremap <C-w>r :WinResizerStartResize<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
" ludovicchabant/vim-gutentags {
|
" ludovicchabant/vim-gutentags {
|
||||||
set statusline+=%{gutentags#statusline()}
|
if isdirectory(expand(plugin_dir . "/vim-gutentags"))
|
||||||
|
if exists("*gutentags#statusline()")
|
||||||
|
set statusline+=%{gutentags#statusline()}
|
||||||
|
endif
|
||||||
let g:gutentags_cache_dir=g:vim_dir . '/.vimtags/'
|
let g:gutentags_cache_dir=g:vim_dir . '/.vimtags/'
|
||||||
let g:gutentags_project_root=['.git', '.hg', '.svn', '.bzr', '_darcs', '_FOSSIL_', '.fslckout', 'src']
|
let g:gutentags_project_root=['.git', '.hg', '.svn', '.bzr', '_darcs', '_FOSSIL_', '.fslckout', 'src']
|
||||||
|
endif
|
||||||
"}
|
"}
|
||||||
|
|
||||||
" easymotion/vim-easymotion {
|
" easymotion/vim-easymotion {
|
||||||
@@ -181,11 +188,13 @@ endif
|
|||||||
let g:bufferline_modified = '+'
|
let g:bufferline_modified = '+'
|
||||||
|
|
||||||
" scrolling with fixed current buffer position
|
" scrolling with fixed current buffer position
|
||||||
let g:bufferline_rotate = 1
|
let g:bufferline_rotate = 0
|
||||||
|
|
||||||
let g:bufferline_active_buffer_left = ''
|
let g:bufferline_active_buffer_left = ''
|
||||||
let g:bufferline_active_buffer_right = ''
|
let g:bufferline_active_buffer_right = ''
|
||||||
let g:bufferline_fixed_index = -1
|
let g:bufferline_fixed_index = -1
|
||||||
|
let g:bufferline_inactive_highlight = 'StatusLineNC'
|
||||||
|
let g:bufferline_active_highlight = 'StatusLine'
|
||||||
|
|
||||||
" }
|
" }
|
||||||
|
|
||||||
@@ -202,15 +211,23 @@ endif
|
|||||||
" }
|
" }
|
||||||
|
|
||||||
" NerdTree {
|
" NerdTree {
|
||||||
if g:vim_type == 'vim' && isdirectory(expand(plugin_dir . "/nerdtree"))
|
if (g:vim_type == 'vim' || g:vim_version < 0.8) && isdirectory(expand(plugin_dir . "/nerdtree"))
|
||||||
let g:NERDShutUp=1
|
let g:NERDShutUp=1
|
||||||
|
|
||||||
" work around for nerdtree bug: https://github.com/preservim/nerdtree/issues/1321
|
" work around for nerdtree bug: https://github.com/preservim/nerdtree/issues/1321
|
||||||
let g:NERDTreeMinimalMenu=1
|
let g:NERDTreeMinimalMenu=1
|
||||||
|
|
||||||
"nnoremap <C-e> :NERDTreeToggle<CR>
|
"nnoremap <C-e> :NERDTreeToggle<CR>
|
||||||
nnoremap <leader>e :NERDTreeToggle<CR>
|
" nnoremap <leader>e :NERDTreeToggle<CR>
|
||||||
"nmap <leader>e :NERDTreeFind<CR>
|
function! NERDTreeFindToggle()
|
||||||
|
let my_filetype = &filetype
|
||||||
|
if my_filetype == 'nerdtree' || my_filetype == ''
|
||||||
|
:NERDTreeToggle
|
||||||
|
else
|
||||||
|
:NERDTreeFind
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
nnoremap <silent> <leader>e :call NERDTreeFindToggle()<CR>
|
||||||
|
|
||||||
"let NERDTreeShowBookmarks=1
|
"let NERDTreeShowBookmarks=1
|
||||||
"let NERDTreeIgnore=['\.py[cd]$', '\~$', '\.swo$', '\.swp$', '^\.git$', '^\.hg$', '^\.svn$', '\.bzr$']
|
"let NERDTreeIgnore=['\.py[cd]$', '\~$', '\.swo$', '\.swp$', '^\.git$', '^\.hg$', '^\.svn$', '\.bzr$']
|
||||||
@@ -219,19 +236,18 @@ endif
|
|||||||
let NERDTreeMouseMode = 2
|
let NERDTreeMouseMode = 2
|
||||||
let NERDTreeShowHidden = 1
|
let NERDTreeShowHidden = 1
|
||||||
let NERDTreeKeepTreeInNewTab = 1
|
let NERDTreeKeepTreeInNewTab = 1
|
||||||
|
|
||||||
|
" 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
|
endif
|
||||||
" }
|
" }
|
||||||
|
|
||||||
" nvim-tree.lua {
|
" nvim-tree.lua {
|
||||||
if g:vim_type == 'nvim' && isdirectory(expand(plugin_dir . "/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
|
" Hide vim bottom statusline
|
||||||
" autocmd FileType NvimTree setlocal noshowmode noruler laststatus=0 noshowcmd
|
" autocmd FileType NvimTree setlocal noshowmode noruler laststatus=0 noshowcmd
|
||||||
"set noshowmode noruler laststatus=0 noshowcmd
|
" set noshowmode noruler laststatus=0 noshowcmd
|
||||||
" autocmd BufRead,BufNewFile NvimTree set laststatus=0 " This will work instead
|
" autocmd BufRead,BufNewFile NvimTree set laststatus=0 " This will work instead
|
||||||
endif
|
endif
|
||||||
" }
|
" }
|
||||||
@@ -240,21 +256,34 @@ endif
|
|||||||
" nvim-lualine/lualine.nvim {
|
" nvim-lualine/lualine.nvim {
|
||||||
" }
|
" }
|
||||||
"else
|
"else
|
||||||
|
"
|
||||||
|
" itchyny/lightline.vim {
|
||||||
|
if g:vim_type == 'vim' && isdirectory(expand(plugin_dir . "/lightline.vim"))
|
||||||
|
set laststatus=2
|
||||||
|
let g:lightline = {
|
||||||
|
\ 'colorscheme': 'wombat',
|
||||||
|
\ 'active': {
|
||||||
|
\ 'left': [ [ 'mode', 'paste' ],
|
||||||
|
\ [ 'buffers' ] ]
|
||||||
|
\ },
|
||||||
|
\ 'component_function': {
|
||||||
|
\ 'buffers': 'bufferline#get_echo_string'
|
||||||
|
\ },
|
||||||
|
\ }
|
||||||
|
endif
|
||||||
|
" }
|
||||||
|
"
|
||||||
" vim-airline {
|
" vim-airline {
|
||||||
if g:vim_type == 'vim' && isdirectory(expand(plugin_dir . "/airline"))
|
if g:vim_type == 'vim' && isdirectory(expand(plugin_dir . "/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.
|
||||||
let g:airline_section_b = ''
|
let g:airline_section_b = ''
|
||||||
let g:airline_section_z = ''
|
|
||||||
let g:airline_section_y = ''
|
|
||||||
let g:airline_section_x = ''
|
let g:airline_section_x = ''
|
||||||
|
let g:airline_section_y = ''
|
||||||
|
"let g:airline_section_z = ''
|
||||||
let g:airline_section_warning = ''
|
let g:airline_section_warning = ''
|
||||||
"let g:airline#extensions#tabline#left_sep = ''
|
let g:airline_exclude_filetypes = ['nerdtree'] " see source for current list
|
||||||
"let g:airline#extensions#tabline#left_alt_sep = '|'
|
let g:airline#extensions#nerdtree_statusline = 0
|
||||||
|
|
||||||
"let g:airline_left_sep='>'
|
|
||||||
"let g:airline_right_sep='<'
|
|
||||||
"let g:airline_skip_empty_sections = 1
|
|
||||||
"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 = {
|
||||||
\ '__' : '-',
|
\ '__' : '-',
|
||||||
@@ -311,7 +340,7 @@ endif
|
|||||||
" coc-tsserver: javascript
|
" coc-tsserver: javascript
|
||||||
" coc-pyright: python
|
" coc-pyright: python
|
||||||
" coc-clangd: c/c++, may need to install clangd seperatly
|
" coc-clangd: c/c++, may need to install clangd seperatly
|
||||||
let g:coc_global_extensions = ['coc-pyright', 'coc-rls', 'coc-clangd', 'coc-tsserver', 'coc-html', 'coc-cmake', 'coc-json', 'coc-sh']
|
let g:coc_global_extensions = ['coc-pyright', 'coc-rls', 'coc-clangd', 'coc-tsserver', 'coc-html', 'coc-cmake', 'coc-json', 'coc-sh', 'coc-java']
|
||||||
|
|
||||||
let g:coc_user_config = {
|
let g:coc_user_config = {
|
||||||
\ 'suggest.noselect': v:true,
|
\ 'suggest.noselect': v:true,
|
||||||
@@ -320,6 +349,8 @@ endif
|
|||||||
if filereadable(expand(config_dir . "/.exp-coc-config"))
|
if filereadable(expand(config_dir . "/.exp-coc-config"))
|
||||||
exec "source " . config_dir . "/.exp-coc-config"
|
exec "source " . config_dir . "/.exp-coc-config"
|
||||||
endif
|
endif
|
||||||
|
" warning that coc work best for vim >= 8.3
|
||||||
|
let g:coc_disable_startup_warning = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" }
|
" }
|
||||||
@@ -328,7 +359,6 @@ endif
|
|||||||
" Theme_Appearance
|
" Theme_Appearance
|
||||||
" {
|
" {
|
||||||
"
|
"
|
||||||
|
|
||||||
" debug function print out highlight group of cursor position
|
" debug function print out highlight group of cursor position
|
||||||
function! SynStack()
|
function! SynStack()
|
||||||
if !exists("*synstack")
|
if !exists("*synstack")
|
||||||
@@ -354,7 +384,8 @@ endif
|
|||||||
|
|
||||||
" what to use for dark theme
|
" what to use for dark theme
|
||||||
let g:dark_theme = 'default'
|
let g:dark_theme = 'default'
|
||||||
let g:airline_dark_theme = "deus"
|
" let g:airline_dark_theme = "violet"
|
||||||
|
let g:airline_dark_theme = "angr"
|
||||||
|
|
||||||
" what to use for light theme
|
" what to use for light theme
|
||||||
let g:light_theme = 'default'
|
let g:light_theme = 'default'
|
||||||
@@ -426,48 +457,52 @@ endif
|
|||||||
function! EnableTransparent()
|
function! EnableTransparent()
|
||||||
if g:vim_type == 'nvim' && g:vim_version > 0.5
|
if g:vim_type == 'nvim' && g:vim_version > 0.5
|
||||||
:TransparentEnable
|
:TransparentEnable
|
||||||
elseif g:dark_or_white_theme == 'dark'
|
else
|
||||||
let g:PaperColor_Theme_Options = {
|
if g:dark_or_white_theme == 'dark'
|
||||||
\ 'theme': {
|
let g:PaperColor_Theme_Options = {
|
||||||
\ 'default.dark': {
|
\ 'theme': {
|
||||||
\ 'transparent_background': 1
|
\ 'default.dark': {
|
||||||
\ }
|
\ 'transparent_background': 1
|
||||||
\ }
|
\ }
|
||||||
\ }
|
\ }
|
||||||
execute("colorscheme " . g:dark_theme)
|
\ }
|
||||||
elseif g:dark_or_white_theme == 'light'
|
execute("colorscheme " . g:dark_theme)
|
||||||
let g:PaperColor_Theme_Options = {
|
elseif g:dark_or_white_theme == 'light'
|
||||||
\ 'theme': {
|
let g:PaperColor_Theme_Options = {
|
||||||
\ 'default.light': {
|
\ 'theme': {
|
||||||
\ 'transparent_background': 1
|
\ 'default.light': {
|
||||||
\ }
|
\ 'transparent_background': 1
|
||||||
\ }
|
\ }
|
||||||
\ }
|
\ }
|
||||||
execute("colorscheme " . g:light_theme)
|
\ }
|
||||||
|
execute("colorscheme " . g:light_theme)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! DisableTransparent()
|
function! DisableTransparent()
|
||||||
if g:vim_type == 'nvim' && g:vim_version > 0.5
|
if g:vim_type == 'nvim' && g:vim_version > 0.5
|
||||||
:TransparentDisable
|
:TransparentDisable
|
||||||
elseif g:dark_or_white_theme == 'dark'
|
else
|
||||||
let g:PaperColor_Theme_Options = {
|
if g:dark_or_white_theme == 'dark'
|
||||||
\ 'theme': {
|
let g:PaperColor_Theme_Options = {
|
||||||
\ 'default.dark': {
|
\ 'theme': {
|
||||||
\ 'transparent_background': 0
|
\ 'default.dark': {
|
||||||
\ }
|
\ 'transparent_background': 0
|
||||||
\ }
|
\ }
|
||||||
\ }
|
\ }
|
||||||
execute("colorscheme " . g:dark_theme)
|
\ }
|
||||||
elseif g:dark_or_white_theme == 'light'
|
execute("colorscheme " . g:dark_theme)
|
||||||
let g:PaperColor_Theme_Options = {
|
elseif g:dark_or_white_theme == 'light'
|
||||||
\ 'theme': {
|
let g:PaperColor_Theme_Options = {
|
||||||
\ 'default.light': {
|
\ 'theme': {
|
||||||
\ 'transparent_background': 0
|
\ 'default.light': {
|
||||||
\ }
|
\ 'transparent_background': 0
|
||||||
\ }
|
\ }
|
||||||
\ }
|
\ }
|
||||||
execute("colorscheme " . g:light_theme)
|
\ }
|
||||||
|
execute("colorscheme " . g:light_theme)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -587,34 +622,51 @@ endif
|
|||||||
" {
|
" {
|
||||||
|
|
||||||
" Toggle dark/light theme
|
" Toggle dark/light theme
|
||||||
noremap <leader>bg :call ToggleBG()<CR>
|
noremap <silent> <leader>bg :call ToggleBG()<CR>
|
||||||
|
|
||||||
" Toggle transparent background
|
" Toggle transparent background
|
||||||
noremap <leader>tb :call ToggleTransparent()<CR>
|
noremap <silent> <leader>tb :call ToggleTransparent()<CR>
|
||||||
|
|
||||||
" Buffer navigation
|
" Buffer navigation
|
||||||
nnoremap <space>q :bprevious<CR>
|
nnoremap <silent> <space>q :bprevious<CR>
|
||||||
nnoremap <space>e :bnext<CR>
|
nnoremap <silent> <space>e :bnext<CR>
|
||||||
|
|
||||||
" leader s change all occurence
|
" leader s change all occurence
|
||||||
nnoremap <Leader>s :%s/\<<C-r><C-w>\>/
|
nnoremap <silent> <Leader>s :%s/\<<C-r><C-w>\>/
|
||||||
|
|
||||||
" leader num change tab
|
" leader num change tab
|
||||||
nnoremap <Leader>1 :b1<CR>
|
" only for vim or nvim without lualine
|
||||||
nnoremap <Leader>2 :b2<CR>
|
if g:vim_type == 'vim' || (g:vim_type == 'nvim' && g:vim_version < 0.5)
|
||||||
nnoremap <Leader>3 :b3<CR>
|
" nnoremap <Leader>1 :b1<CR>
|
||||||
nnoremap <Leader>4 :b4<CR>
|
" nnoremap <Leader>2 :b2<CR>
|
||||||
nnoremap <Leader>5 :b5<CR>
|
" nnoremap <Leader>3 :b3<CR>
|
||||||
nnoremap <Leader>6 :b6<CR>
|
" nnoremap <Leader>4 :b4<CR>
|
||||||
nnoremap <Leader>7 :b7<CR>
|
" nnoremap <Leader>5 :b5<CR>
|
||||||
nnoremap <Leader>8 :b8<CR>
|
" nnoremap <Leader>6 :b6<CR>
|
||||||
nnoremap <Leader>9 :b9<CR>
|
" nnoremap <Leader>7 :b7<CR>
|
||||||
|
" nnoremap <Leader>8 :b8<CR>
|
||||||
|
" nnoremap <Leader>9 :b9<CR>
|
||||||
|
nnoremap <Leader>1 :call bufferline#jump(1)<CR>
|
||||||
|
nnoremap <Leader>2 :call bufferline#jump(2)<CR>
|
||||||
|
nnoremap <Leader>3 :call bufferline#jump(3)<CR>
|
||||||
|
nnoremap <Leader>4 :call bufferline#jump(4)<CR>
|
||||||
|
nnoremap <Leader>5 :call bufferline#jump(5)<CR>
|
||||||
|
nnoremap <Leader>6 :call bufferline#jump(6)<CR>
|
||||||
|
nnoremap <Leader>7 :call bufferline#jump(7)<CR>
|
||||||
|
nnoremap <Leader>8 :call bufferline#jump(8)<CR>
|
||||||
|
nnoremap <Leader>9 :call bufferline#jump(9)<CR>
|
||||||
|
end
|
||||||
|
|
||||||
" split window comform with other window management shortcuts
|
" split window comform with other window management shortcuts
|
||||||
nnoremap <C-w>% :vsplit<CR>
|
nnoremap <silent> <C-w>% :vsplit<CR>
|
||||||
nnoremap <C-w>" :split<CR>
|
nnoremap <silent> <C-w>" :split<CR>
|
||||||
" }
|
" }
|
||||||
"
|
"
|
||||||
|
" Lua configuration
|
||||||
|
if g:vim_type == 'nvim' && filereadable(expand(g:dotfile_path . '.vimrc.lua'))
|
||||||
|
execute('source ' . g:dotfile_path . '/.vimrc.lua')
|
||||||
|
endif
|
||||||
|
"
|
||||||
" Useful_Info{
|
" Useful_Info{
|
||||||
" show mapping info
|
" show mapping info
|
||||||
" :verbose map ,cf
|
" :verbose map ,cf
|
||||||
|
|||||||
+131
-95
@@ -1,111 +1,147 @@
|
|||||||
|
vim_version = vim.version()
|
||||||
|
vim_version_minor = vim_version['minor']
|
||||||
|
|
||||||
require('nvim-treesitter.configs').setup {
|
-- debug
|
||||||
-- ensure_installed = { "c", "bash", "lua" },
|
-- print(vim.inspect(version))
|
||||||
sync_install = false,
|
|
||||||
auto_install = true,
|
|
||||||
-- ignore_install = { "javascript" },
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
additional_vim_regex_highlighting = false,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lualine').setup {
|
if vim_version_minor >= 5 then
|
||||||
options = {
|
|
||||||
theme = 'auto', -- lualine theme
|
require("transparent").setup({
|
||||||
disabled_filetypes = { -- Filetypes to disable lualine for.
|
enable = true, -- boolean: enable transparent
|
||||||
|
extra_groups = { -- table/string: additional groups that should be cleared
|
||||||
|
-- In particular, when you set it to 'all', that means all available groups
|
||||||
|
|
||||||
|
"NvimTreeNormal",
|
||||||
|
"VertSplit",
|
||||||
|
},
|
||||||
|
exclude = {}, -- table: groups you don't want to clear
|
||||||
|
})
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
if vim_version_minor >= 7 then
|
||||||
|
|
||||||
|
require('nvim-treesitter.configs').setup {
|
||||||
|
-- ensure_installed = { "c", "bash", "lua" },
|
||||||
|
sync_install = false,
|
||||||
|
auto_install = true,
|
||||||
|
-- ignore_install = { "javascript" },
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
additional_vim_regex_highlighting = false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
if vim_version_minor >= 5 then
|
||||||
|
|
||||||
|
for i=1,9 do
|
||||||
|
vim.api.nvim_set_keymap('n', '<Leader>'..i, ':LualineBuffersJump '..i..'<CR>', { noremap = true, silent = true })
|
||||||
|
-- :nnoremap <silent> <Leader>1 :LualineBuffersJump 1<CR>
|
||||||
|
end
|
||||||
|
|
||||||
|
local disabled_filetypes_data = {}
|
||||||
|
if vim_version_minor < 7 then
|
||||||
|
-- globalstatus only work for nvim >= 0.7
|
||||||
|
disabled_filetypes_data = { -- Filetypes to disable lualine for.
|
||||||
statusline = {}, -- only ignores the ft for statusline.
|
statusline = {}, -- only ignores the ft for statusline.
|
||||||
winbar = {}, -- only ignores the ft for winbar.
|
winbar = {}, -- only ignores the ft for winbar.
|
||||||
'NvimTree'
|
'NvimTree'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
require('lualine').setup {
|
||||||
|
options = {
|
||||||
|
theme = 'auto', -- lualine theme
|
||||||
|
-- theme = 'ayu', -- lualine theme
|
||||||
|
always_divide_middle = false, -- When set to true, left sections i.e. 'a','b' and 'c'
|
||||||
|
-- can't take over the entire statusline even
|
||||||
|
-- if neither of 'x', 'y' or 'z' are present.
|
||||||
|
globalstatus = true,
|
||||||
|
disabled_filetypes = disabled_filetypes_data,
|
||||||
},
|
},
|
||||||
},
|
sections = {
|
||||||
sections = {
|
lualine_a = {'mode'},
|
||||||
lualine_a = {'mode'},
|
lualine_b = {},
|
||||||
lualine_b = {},
|
lualine_c = {
|
||||||
lualine_c = {
|
{
|
||||||
{
|
'buffers',
|
||||||
'buffers',
|
mode = 2,
|
||||||
mode = 4,
|
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 = 'NvimTree'
|
},
|
||||||
|
max_length = vim.o.columns * 2 / 3, -- Maximum width of buffers component,
|
||||||
|
-- it can also be a function that returns
|
||||||
|
-- the value of `max_length` dynamically.
|
||||||
|
symbols = {
|
||||||
|
modified = ' ●', -- Text to show when the buffer is modified
|
||||||
|
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 = {},
|
||||||
|
lualine_y = {'encoding'},
|
||||||
|
lualine_z = {'location'}
|
||||||
},
|
},
|
||||||
-- lualine_x = {'encoding', 'fileformat', 'filetype'},
|
}
|
||||||
lualine_x = {'encoding'},
|
|
||||||
lualine_y = {},
|
|
||||||
lualine_z = {'location'}
|
|
||||||
},
|
|
||||||
-- tabline = {
|
|
||||||
-- lualine_a = {
|
|
||||||
-- {
|
|
||||||
-- 'buffers',
|
|
||||||
-- mode = 4,
|
|
||||||
-- }
|
|
||||||
-- },
|
|
||||||
-- lualine_b = {},
|
|
||||||
-- lualine_c = {},
|
|
||||||
-- lualine_x = {},
|
|
||||||
-- lualine_y = {},
|
|
||||||
-- lualine_z = {'tabs'}
|
|
||||||
-- },
|
|
||||||
-- winbar = {
|
|
||||||
-- lualine_a = {},
|
|
||||||
-- lualine_b = {},
|
|
||||||
-- lualine_c = {'filename'},
|
|
||||||
-- lualine_x = {},
|
|
||||||
-- lualine_y = {},
|
|
||||||
-- lualine_z = {}
|
|
||||||
-- },
|
|
||||||
}
|
|
||||||
|
|
||||||
-- nvim-tree configuration
|
end
|
||||||
--
|
|
||||||
|
|
||||||
-- disable netrw at the very start of your init.lua (strongly advised)
|
if vim_version_minor >= 8 then
|
||||||
vim.g.loaded_netrw = 1
|
-- nvim-tree configuration
|
||||||
vim.g.loaded_netrwPlugin = 1
|
--
|
||||||
|
|
||||||
-- set termguicolors to enable highlight groups
|
-- disable netrw at the very start of your init.lua (strongly advised)
|
||||||
vim.opt.termguicolors = true
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
|
||||||
-- setup with some options
|
-- set termguicolors to enable highlight groups
|
||||||
require("nvim-tree").setup({
|
vim.opt.termguicolors = true
|
||||||
sort_by = "case_sensitive",
|
|
||||||
view = {
|
-- setup with some options
|
||||||
width = 30,
|
require("nvim-tree").setup({
|
||||||
mappings = {
|
sort_by = "case_sensitive",
|
||||||
list = {
|
view = {
|
||||||
{ key = "C-[", action = "dir_up" },
|
width = 30,
|
||||||
{ key = "C-]", action = "cd" },
|
mappings = {
|
||||||
{ key = "<C-k>", action = "toggle_file_info" },
|
list = {
|
||||||
},
|
{ key = "C-[", action = "dir_up" },
|
||||||
},
|
{ key = "C-]", action = "cd" },
|
||||||
},
|
{ key = "<C-k>", action = "toggle_file_info" },
|
||||||
renderer = {
|
|
||||||
group_empty = true,
|
|
||||||
},
|
|
||||||
filters = {
|
|
||||||
dotfiles = false,
|
|
||||||
},
|
|
||||||
actions = {
|
|
||||||
open_file = {
|
|
||||||
quit_on_open = true,
|
|
||||||
resize_window = true,
|
|
||||||
window_picker = {
|
|
||||||
exclude = {
|
|
||||||
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
|
|
||||||
buftype = { "nofile", "terminal", "help" },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
renderer = {
|
||||||
})
|
group_empty = true,
|
||||||
|
},
|
||||||
|
filters = {
|
||||||
|
dotfiles = false,
|
||||||
|
},
|
||||||
|
actions = {
|
||||||
|
open_file = {
|
||||||
|
quit_on_open = true,
|
||||||
|
resize_window = true,
|
||||||
|
window_picker = {
|
||||||
|
exclude = {
|
||||||
|
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
|
||||||
|
buftype = { "nofile", "terminal", "help" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
--
|
vim.api.nvim_set_keymap('n', '<Leader>e', ':NvimTreeFindFileToggle<CR>', { noremap = true, silent = true })
|
||||||
-- nvim-tree configuration end
|
|
||||||
|
--
|
||||||
|
-- nvim-tree configuration end
|
||||||
|
--
|
||||||
|
end
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ fzf_command_list_all=(\
|
|||||||
# fzf match files
|
# fzf match files
|
||||||
fzf_command_list_file=(\
|
fzf_command_list_file=(\
|
||||||
cat \
|
cat \
|
||||||
vim \
|
#vim \
|
||||||
nvim \
|
#nvim \
|
||||||
set_wallpaper \
|
set_wallpaper \
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user