improve plugin config
This commit is contained in:
@@ -225,7 +225,8 @@
|
|||||||
|
|
||||||
" Functions {
|
" Functions {
|
||||||
|
|
||||||
" Initialize directories {
|
" Initialize directories for undo, swap, viewdir
|
||||||
|
" to ~/.vim/.vim*
|
||||||
function! InitializeDirectories()
|
function! InitializeDirectories()
|
||||||
let parent = $HOME
|
let parent = $HOME
|
||||||
let prefix = 'vim'
|
let prefix = 'vim'
|
||||||
@@ -238,11 +239,6 @@
|
|||||||
let dir_list['undo'] = 'undodir'
|
let dir_list['undo'] = 'undodir'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" To specify a different directory in which to place the vimbackup,
|
|
||||||
" vimviews, vimundo, and vimswap files/directories, add the following to
|
|
||||||
" your .vimrc.before.local file:
|
|
||||||
" let g:spf13_consolidated_directory = <full path to desired directory>
|
|
||||||
" eg: let g:spf13_consolidated_directory = $HOME . '/.vim/'
|
|
||||||
let g:spf13_consolidated_directory = $HOME . '/.vim/.'
|
let g:spf13_consolidated_directory = $HOME . '/.vim/.'
|
||||||
if exists('g:spf13_consolidated_directory')
|
if exists('g:spf13_consolidated_directory')
|
||||||
let common_dir = g:spf13_consolidated_directory . prefix
|
let common_dir = g:spf13_consolidated_directory . prefix
|
||||||
@@ -267,9 +263,8 @@
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
call InitializeDirectories()
|
call InitializeDirectories()
|
||||||
" }
|
|
||||||
|
|
||||||
" Shell command {
|
" Shell command
|
||||||
function! s:RunShellCommand(cmdline)
|
function! s:RunShellCommand(cmdline)
|
||||||
botright new
|
botright new
|
||||||
|
|
||||||
@@ -289,7 +284,7 @@
|
|||||||
|
|
||||||
command! -complete=file -nargs=+ Shell call s:RunShellCommand(<q-args>)
|
command! -complete=file -nargs=+ Shell call s:RunShellCommand(<q-args>)
|
||||||
" e.g. Grep current file for <search_term>: Shell grep -Hn <search_term> %
|
" e.g. Grep current file for <search_term>: Shell grep -Hn <search_term> %
|
||||||
" }
|
|
||||||
" Fix file type error for typescript
|
" Fix file type error for typescript
|
||||||
autocmd BufNewFile,BufRead *.ts set filetype=typescript
|
autocmd BufNewFile,BufRead *.ts set filetype=typescript
|
||||||
|
|
||||||
|
|||||||
+38
-52
@@ -13,59 +13,44 @@
|
|||||||
let config_dir = '~/.dotfiles/'
|
let config_dir = '~/.dotfiles/'
|
||||||
let plugin_dir = '~/.vim/plugged/'
|
let plugin_dir = '~/.vim/plugged/'
|
||||||
let g:vim_dir = '~/.vim/'
|
let g:vim_dir = '~/.vim/'
|
||||||
|
|
||||||
call plug#begin(plugin_dir)
|
call plug#begin(plugin_dir)
|
||||||
|
|
||||||
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||||
Plug 'rust-lang/rust.vim'
|
Plug 'rust-lang/rust.vim'
|
||||||
" syntax highlighting(and more) for typescript
|
Plug 'leafgarland/typescript-vim'
|
||||||
" {
|
|
||||||
Plug 'leafgarland/typescript-vim'
|
|
||||||
" }
|
|
||||||
" {
|
" {
|
||||||
Plug 'alvan/vim-closetag'
|
Plug 'alvan/vim-closetag'
|
||||||
let g:closetag_filenames = '*.html,*.xhtml,*.phtml, *.js'
|
let g:closetag_filenames = '*.html,*.xhtml,*.phtml, *.js'
|
||||||
" }
|
" }
|
||||||
|
|
||||||
"{
|
|
||||||
"Plug 'altercation/vim-colors-solarized'
|
|
||||||
"}
|
|
||||||
|
|
||||||
Plug 'scrooloose/nerdtree'
|
Plug 'scrooloose/nerdtree'
|
||||||
|
|
||||||
" for markdown{
|
|
||||||
Plug 'godlygeek/tabular'
|
Plug 'godlygeek/tabular'
|
||||||
Plug 'preservim/vim-markdown'
|
" for markdown{
|
||||||
|
Plug 'preservim/vim-markdown'
|
||||||
"}
|
"}
|
||||||
|
|
||||||
" for window resize{
|
" for window resize{
|
||||||
Plug 'simeji/winresizer'
|
Plug 'simeji/winresizer'
|
||||||
let g:winresizer_start_key = '<leader-r>'
|
let g:winresizer_start_key = '<leader-r>'
|
||||||
let g:winresizer_vert_resize = 2
|
let g:winresizer_vert_resize = 2
|
||||||
let g:winresizer_horiz_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'
|
||||||
|
|
||||||
" {
|
" {
|
||||||
Plug 'jiangmiao/auto-pairs'
|
Plug 'jiangmiao/auto-pairs'
|
||||||
"let g:AutoPairsFlyMode = 1
|
"let g:AutoPairsFlyMode = 1
|
||||||
|
|
||||||
" }
|
" }
|
||||||
" {
|
|
||||||
Plug 'mg979/vim-visual-multi'
|
Plug 'mg979/vim-visual-multi'
|
||||||
" }
|
|
||||||
"if has('nvim') && str2float(g:nvim_version) >= 0.5
|
|
||||||
" Plug 'nvim-lualine/lualine.nvim'
|
|
||||||
"else
|
|
||||||
Plug 'vim-airline/vim-airline'
|
Plug 'vim-airline/vim-airline'
|
||||||
Plug 'vim-airline/vim-airline-themes'
|
Plug 'vim-airline/vim-airline-themes'
|
||||||
"endif
|
|
||||||
|
|
||||||
" For nvim-bufferline
|
|
||||||
" {
|
|
||||||
"Plug 'kyazdani42/nvim-web-devicons'
|
|
||||||
"Plug 'akinsho/nvim-bufferline.lua'
|
|
||||||
" }
|
|
||||||
Plug 'bling/vim-bufferline'
|
Plug 'bling/vim-bufferline'
|
||||||
Plug 'easymotion/vim-easymotion'
|
Plug 'easymotion/vim-easymotion'
|
||||||
Plug 'nathanaelkane/vim-indent-guides'
|
Plug 'nathanaelkane/vim-indent-guides'
|
||||||
@@ -75,11 +60,6 @@
|
|||||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" nvim support only theme
|
|
||||||
" {
|
|
||||||
"Plug 'projekt0n/github-nvim-theme'
|
|
||||||
" }
|
|
||||||
|
|
||||||
" vim theme
|
" vim theme
|
||||||
" {
|
" {
|
||||||
Plug 'NLKNguyen/papercolor-theme'
|
Plug 'NLKNguyen/papercolor-theme'
|
||||||
@@ -93,13 +73,22 @@
|
|||||||
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
" Helper functions
|
|
||||||
" {
|
|
||||||
|
|
||||||
" }
|
|
||||||
|
|
||||||
" Plugin Preferences
|
" Plugin Preferences
|
||||||
" {
|
" {
|
||||||
|
" godlygeek/tabular {
|
||||||
|
if isdirectory(expand(plugin_dir . "/tabular"))
|
||||||
|
nmap <leader>t= :Tabularize /=<CR>
|
||||||
|
vmap <leader>t= :Tabularize /=<CR>
|
||||||
|
|
||||||
|
nmap <leader>t\| :Tab /\|<CR>
|
||||||
|
vmap <leader>t\| :Tab /\|<CR>
|
||||||
|
|
||||||
|
nmap <leader>t: :Tab /:\zs<CR>
|
||||||
|
vmap <leader>t: :Tab /:\zs<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
|
" }
|
||||||
|
|
||||||
" xiyaowong/nvim-transparent {
|
" xiyaowong/nvim-transparent {
|
||||||
|
|
||||||
" }
|
" }
|
||||||
@@ -113,17 +102,17 @@
|
|||||||
|
|
||||||
"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$']
|
||||||
let NERDTreeChDirMode=0
|
let NERDTreeChDirMode = 0
|
||||||
let NERDTreeQuitOnOpen=1
|
let NERDTreeQuitOnOpen = 1
|
||||||
let NERDTreeMouseMode=2
|
let NERDTreeMouseMode = 2
|
||||||
let NERDTreeShowHidden=1
|
let NERDTreeShowHidden = 1
|
||||||
let NERDTreeKeepTreeInNewTab=1
|
let NERDTreeKeepTreeInNewTab = 1
|
||||||
endif
|
endif
|
||||||
" }
|
" }
|
||||||
" indent_guides {
|
" indent_guides {
|
||||||
if isdirectory(expand(plugin_dir . "/vim-indent-guides/"))
|
if isdirectory(expand(plugin_dir . "/vim-indent-guides/"))
|
||||||
let g:indent_guides_start_level = 2
|
let g:indent_guides_start_level = 2
|
||||||
let g:indent_guides_guide_size = 1
|
let g:indent_guides_guide_size = 1
|
||||||
let g:indent_guides_enable_on_vim_startup = 0
|
let g:indent_guides_enable_on_vim_startup = 0
|
||||||
map <leader>i :IndentGuidesToggle<CR>
|
map <leader>i :IndentGuidesToggle<CR>
|
||||||
|
|
||||||
@@ -137,10 +126,10 @@
|
|||||||
" vim-airline {
|
" 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_z = ''
|
||||||
let g:airline_section_y = ''
|
let g:airline_section_y = ''
|
||||||
let g:airline_section_x = ''
|
let g:airline_section_x = ''
|
||||||
let g:airline_section_warning = ''
|
let g:airline_section_warning = ''
|
||||||
"let g:airline#extensions#tabline#left_sep = ''
|
"let g:airline#extensions#tabline#left_sep = ''
|
||||||
"let g:airline#extensions#tabline#left_alt_sep = '|'
|
"let g:airline#extensions#tabline#left_alt_sep = '|'
|
||||||
@@ -164,11 +153,8 @@
|
|||||||
" 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']
|
let g:coc_global_extensions = ['coc-pyright', 'coc-rls', 'coc-clangd', 'coc-tsserver', 'coc-html', 'coc-cmake', 'coc-sql', 'coc-json']
|
||||||
|
|
||||||
" space-d jump to definition if coc is installed
|
|
||||||
"nnoremap <silent><nowait> <space>d :call CocAction('jumpDefinition', v: false)<CR>
|
|
||||||
"nnoremap <silent><nowait> <space>r :call CocAction('jumpReferences', v: false)<CR>
|
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user