" =============== Plugins ================================================ call plug#begin('~/.config/nvim/plugged') Plug 'https://github.com/vim-airline/vim-airline' " status bset mouse=aar on the bottom Plug 'https://github.com/preservim/nerdtree' " file tree Plug 'https://github.com/airblade/vim-gitgutter' " git diff Plug 'luochen1990/rainbow' Plug 'navarasu/onedark.nvim' Plug 'neoclide/coc.nvim', {'branch': 'release'} " code completion call plug#end() " =============== Vannila vim config ================================================ let mapleader = "\\" set splitbelow set clipboard=unnamedplus set number relativenumber windo set nowrap set showcmd set mouse=a " :set cursorline set foldmethod=syntax set updatetime=250 set tabstop=4 shiftwidth=4 smarttab highlight Comment ctermfg=Grey nnoremap p :split +term " =============== NERDTree ================================================ " Toggle file browser nnoremap e :NERDTreeToggle " =============== Colors ================================================ let g:onedark_config = { \ 'style': 'warmer', \} colorscheme onedark hi CocFloating guibg=#151515 guifg=clear hi Pmenu guibg=#151515 guifg=clear hi @parameter guifg=#ed6215 hi CursorColumn guibg=#e2c792 guifg=#232326 " =============== NERDTree Config ================================================ let NERDTreeShowHidden=1 " " =============== Rainbow Config ================================================ let g:rainbow_active = 1 " =============== COC Config ================================================ inoremap \ coc#pum#visible() ? coc#pum#next(1) : \ CheckBackspace() ? "\" : \ coc#refresh() inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" function! CheckBackspace() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction " Highlight the variable on hold autocmd CursorHold * silent call CocActionAsync('highlight') " coc rename nnoremap r (coc-rename) " Jump between references and definiton nnoremap :call CocActionAsync('jumpReferences') nnoremap K :call CocActionAsync('jumpDefinition') " show help menu nnoremap :call CocActionAsync('codeAction', 'cursor') " Show Documentation nnoremap J :call ShowDocumentation() function! ShowDocumentation() " Show hover when provider exists, fallback to vim's builtin behavior. if CocAction('hasProvider', 'hover') call CocActionAsync('definitionHover') else call feedkeys('K', 'in') endif endfunction