" Shortcuts map :NERDTreeToggle nnoremap s :TagbarToggle " Remove Highlight nnoremap :let @/="" " Always show the signcolumn if has("patch-8.1.1564") " Recently vim can merge signcolumn and number column into one set signcolumn=number else set signcolumn=yes endif " Required for operations modifying multiple buffers like rename. " Used by coc.nvim set hidden " Set more space for displaying messages " Used by coc.nvim set cmdheight=2 " Highlight the symbol and its references when holding the cursor. autocmd CursorHold * silent call CocActionAsync('highlight') " C-Space triggers autocompletion inoremap coc#refresh() " coc.nvim quick fix nmap qf (coc-fix-current) " Use tab for trigger completion with characters ahead and navigate. " Used by coc.nvim inoremap \ pumvisible() ? "\" : \ check_back_space() ? "\" : \ coc#refresh() inoremap pumvisible() ? "\" : "\" function! s:check_back_space() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction " Use to confirm completion, `u` means break undo chain at current " position. " Used by coc.nvim if exists('*complete_info') inoremap complete_info()["selected"] != "-1" ? "\" : "\u\" else inoremap pumvisible() ? "\" : "\u\" endif " Use K to show documentation in preview window. " Used by coc.nvim nnoremap K :call show_documentation() function! s:show_documentation() if (index(['vim','help'], &filetype) >= 0) execute 'h '.expand('') else call CocAction('doHover') endif endfunction " CoC Status in LightLine " Used by coc.nvim lightline.nvim let g:lightline = { \ 'colorscheme': 'molokai', \ 'active': { \ 'left': [ [ 'mode', 'paste' ], \ [ 'cocstatus', 'readonly', 'filename', 'modified' ] ] \ }, \ 'component_function': { \ 'cocstatus': 'coc#status' \ }, \ } " Use auocmd to force lightline update. " Used by coc.nvim lightline.nvim autocmd User CocStatusChange,CocDiagnosticChange call lightline#update() " Add `:Format` command to format current buffer. " Used by coc.nvim command! -nargs=0 Format :call CocAction('format') " TODO: Pick and Chose the ones I want " Mappings for CoCList nnoremap a :CocList diagnostics nnoremap e :CocList extensions nnoremap c :CocList commands " Plugged Plugins call plug#begin(stdpath('data') . '/plugged') " Activity Tracking " Plug 'ActivityWatch/aw-watcher-vim' " One Dark Theme Plug 'joshdick/onedark.vim' " Monokai Theme Plug 'tomasr/molokai' " Tender Theme Plug 'jacoborus/tender.vim' " Powerline Bar at bottom of screen Plug 'itchyny/lightline.vim' " Autocomplete Plug 'neoclide/coc.nvim', {'branch': 'release'} " Scope Tags Plug 'majutsushi/tagbar' " Rust Support Plug 'rust-lang/rust.vim' " TOML Support Plug 'toml-lang/toml' " Fuzzy Search Plug 'junegunn/fzf' " Multiple Cursors Plug 'terryma/vim-multiple-cursors' " File Browser Plug 'preservim/nerdtree' " NerdTree Icons (Should be last according to docs) Plug 'ryanoasis/vim-devicons' " Better Rust Synatax Highlighting Plug 'arzg/vim-rust-syntax-ext' " Auto-close brackets Plug 'jiangmiao/auto-pairs' call plug#end() " Autosave with rust-fmt (Rust Only) let g:rustfmt_autosave = 1 " Configuration set noshowmode " Not Needed because we have Lightline colorscheme molokai