returnrequire('packer').startup(function(use) -- packer可以自己管理自己的版本 use 'wbthomason/packer.nvim'
use 'akinsho/toggleterm.nvim' use 'neoclide/coc.nvim' use 'scrooloose/nerdcommenter' use 'preservim/nerdtree' use 'Xuyuanp/nerdtree-git-plugin' use { 'nvim-telescope/telescope.nvim', requires = { {'nvim-lua/plenary.nvim'} } } use 'vim-airline/vim-airline' use 'vim-airline/vim-airline-themes' use 'bronson/vim-trailing-whitespace' use 'jiangmiao/auto-pairs' end)
" Telescope " 'Ctrl + p' to find file and open in current tab iffilereadable(fnamemodify('.git/config', ':p')) nmap<c-p> :Telescope git_files<cr> else nmap<c-p> :Telescope find_files<cr> endif " 'Ctrl + f' to find line in current buffer map<c-f> :Telescope current_buffer_fuzzy_find<cr> " 'Ctrl + t' to find tags in current buffer map<c-t> :Telescope tags<cr> " 'Ctrl + b' to find buffers map<leader>b :Telescope buffers<cr>
" coc inoremap<expr><Tab>pumvisible() ? "\<C-y>" : "\<Tab>" inoremap<silent><expr><CR> coc#pum#visible() ? coc#pum#confirm() \: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>" nmap<silent> gd <Plug>(coc-definition) nmap<silent>gr<Plug>(coc-references) " Use K to show documentation in preview window nnoremap<silent> K :call ShowDocumentation()<CR> function!ShowDocumentation() if CocAction('hasProvider', 'hover') call CocActionAsync('doHover') else callfeedkeys('K', 'in') endif endfunction " Formatting selected code xmap<c-k><c-f><Plug>(coc-format-selected) nmap<M-F> :CocCommand editor.action.formatDocument<cr> " go to diagnostic nmap<silent><leader>dp<Plug>(coc-diagnostic-prev) nmap<silent><leader>dn <Plug>(coc-diagnostic-next) " Highlight the symbol and its references when holding the cursor autocmd CursorHold * silentcall CocActionAsync('highlight')