Files
dotfiles/.vimrc.bundles
T

242 lines
7.2 KiB
Plaintext

" Environment {
" Basics {
set nocompatible " Must be first line
" }
" }
"
" Plugin directory
let config_dir = '~/.dotfiles/'
let plugin_dir = '~/.vim/plugged/'
call plug#begin(plugin_dir)
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'rust-lang/rust.vim'
" syntax highlighting(and more) for typescript
" {
Plug 'leafgarland/typescript-vim'
" }
" {
Plug 'alvan/vim-closetag'
let g:closetag_filenames = '*.html,*.xhtml,*.phtml, *.js'
" }
"{
Plug 'altercation/vim-colors-solarized'
"}
Plug 'scrooloose/nerdtree'
" for markdown{
Plug 'godlygeek/tabular'
Plug 'preservim/vim-markdown'
"}
" for window resize{
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 'rhysd/conflict-marker.vim'
" {
Plug 'jiangmiao/auto-pairs'
"let g:AutoPairsFlyMode = 1
" }
" {
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-themes'
"endif
" For nvim-bufferline
" {
"Plug 'kyazdani42/nvim-web-devicons'
"Plug 'akinsho/nvim-bufferline.lua'
" }
Plug 'bling/vim-bufferline'
Plug 'easymotion/vim-easymotion'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'vim-scripts/restore_view.vim'
if executable('fzf')
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
endif
" nvim support only theme
" {
Plug 'projekt0n/github-nvim-theme'
" }
" vim theme
" {
Plug 'nanotech/jellybeans.vim'
Plug 'danilo-augusto/vim-afterglow'
Plug 'NLKNguyen/papercolor-theme'
" }
if g:vim_type == 'nvim' && g:vim_version > 0.5
Plug 'xiyaowong/nvim-transparent'
endif
call plug#end()
" Helper functions
" {
function! SetAirlineTheme(theme)
if has('nvim') && str2float(g:nvim_version) >= 0.5
else
execute("AirlineTheme " . a:theme)
endif
endfunction
" }
" Plugin Preferences
" {
" xiyaowong/nvim-transparent {
" }
" NerdTree {
if isdirectory(expand(plugin_dir . "/nerdtree"))
let g:NERDShutUp=1
nnoremap <C-e> :NERDTreeToggle<CR>
nnoremap <leader>e :NERDTreeToggle<CR>
"nmap <leader>e :NERDTreeFind<CR>
let NERDTreeShowBookmarks=1
"let NERDTreeIgnore=['\.py[cd]$', '\~$', '\.swo$', '\.swp$', '^\.git$', '^\.hg$', '^\.svn$', '\.bzr$']
let NERDTreeChDirMode=0
let NERDTreeQuitOnOpen=1
let NERDTreeMouseMode=2
let NERDTreeShowHidden=1
let NERDTreeKeepTreeInNewTab=1
endif
" }
" indent_guides {
if isdirectory(expand(plugin_dir . "/vim-indent-guides/"))
let g:indent_guides_start_level = 2
let g:indent_guides_guide_size = 1
let g:indent_guides_enable_on_vim_startup = 0
map <leader>i :IndentGuidesToggle<CR>
endif
" }
"if has('nvim') && str2float(g:nvim_version) >= 0.5 && isdirectory(expand(plugin_dir . "/lualine.nvim"))
" nvim-lualine/lualine.nvim {
" }
"else
" vim-airline {
" Set configuration options for the statusline plugin vim-airline.
" Use the powerline theme and optionally enable powerline symbols.
let g:airline_section_b = ''
let g:airline_section_z = ''
let g:airline_section_y = ''
let g:airline_section_x = ''
let g:airline_section_warning = ''
let g:airline#extensions#tabline#left_sep = ''
let g:airline#extensions#tabline#left_alt_sep = '|'
if isdirectory(expand(plugin_dir . "/vim-airline-themes/"))
"let g:airline_theme = 'solarized'
endif
" }
"endif
" junegunnjunegunn/fzf {
" [Buffers] Jump to the existing window if possible
let g:fzf_buffers_jump = 1
"let $FZF_DEFAULT_COMMAND = 'find -L'
let $FZF_DEFAULT_COMMAND='find . \( -name node_modules -o -name .git \) -prune -o -print'
noremap <leader>f :FZF<CR>
" }
" neoclide/coc.nvim {
" add desired extensions to the following global variable
" coc-tsserver: javascript
" coc-pyright: python
" coc-clangd: c/c++, may need to install clangd seperatly
let g:coc_global_extensions = ['coc-pyright', 'coc-rls']
" 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"))
exec "source " . config_dir . "/.exp-coc-config"
endif
" }
" }
" THEME APPEARANCE
" {
" {
" nvim only theme
" has('nvim') check if it's running on nvim rather than
" having neovim on your machine
if isdirectory(expand(plugin_dir . "/github-nvim-theme")) && has('nvim') && g:vim_version >= 0.5
let g:github_function_style = "italic"
"let g:github_sidebars = ["qf", "vista_kind", "terminal", "packer"]
colorscheme github_dark
" Allow to trigger background
function! ToggleBG()
" Inversion
if g:colors_name == "github_light"
colorscheme github_dark
call SetAirlineTheme("afterglow")
":AirlineTheme afterglow
else
colorscheme github_light
call SetAirlineTheme("silver")
":AirlineTheme silver
endif
endfunction
noremap <leader>bg :call ToggleBG()<CR>
" }
" {
" vim theme
"elseif isdirectory(expand(plugin_dir . "/jellybeans.vim")) && !has('nvim')
elseif isdirectory(expand(plugin_dir . "/vim-afterglow"))
let g:afterglow_inherit_background=1
colorscheme afterglow
let g:airline_theme='afterglow'
" Allow to trigger background
function! ToggleBG()
" Inversion
if g:colors_name == "afterglow"
set background=light
colorscheme PaperColor
call SetAirlineTheme("silver")
":AirlineTheme silver
else
set background=dark
colorscheme afterglow
call SetAirlineTheme("afterglow")
":AirlineTheme afterglow
endif
endfunction
noremap <leader>bg :call ToggleBG()<CR>
endif
" }
" }