" Use 24-bit (true-color) mode in Vim/Neovim when outside tmux. " If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support " (see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.) if (has("nvim")) " For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 > let $NVIM_TUI_ENABLE_TRUE_COLOR=1 endif " For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 > " Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd > " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 > if (has("termguicolors")) set termguicolors endif " Shortcuts nnoremap o :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': 'one', \ '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') " Blue Theme Plug 'wadackel/vim-dogrun' " Indent Detection Plug 'tpope/vim-sleuth' " One Dark Theme Plug 'rakr/vim-one' " Activity Tracking " Plug 'ActivityWatch/aw-watcher-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' " Auto-close brackets Plug 'jiangmiao/auto-pairs' " NerdTree Icons (Should be last according to docs) Plug 'ryanoasis/vim-devicons' call plug#end() " Call RusftFmt on write to buffer let g:rustfmt_autosave = 1 " Configuration set noshowmode " Lightline requires we turn this off colorscheme one syntax enable " Custom Shortcuts nnoremap o :NERDTreeToggle nnoremap s :TagbarToggle