Update nvim config

This commit is contained in:
Rekai Musuka 2020-08-17 22:12:49 -05:00
parent 155efcd272
commit 68c5878afa
1 changed files with 78 additions and 39 deletions

View File

@ -1,31 +1,89 @@
" Shortcuts
map <C-o> :NERDTreeToggle<CR>
map <F8> :TagbarToggle<CR>
nnoremap <silent><nowait> <space>s :TagbarToggle<CR>
" Remove Highlight
nnoremap <esc><esc> :let @/=""<cr>
" Required for operations modifying multiple buffers like rename.
" Used by coc.nvim
set hidden
let g:LanguageClient_serverCommands = {
\ 'rust': ['rust-analyzer']
\ }
" 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 <silent><expr> <c-space> coc#refresh()
" Use tab for trigger completion with characters ahead and navigate.
" Used by coc.nvim
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current
" position.
" Used by coc.nvim
if exists('*complete_info')
inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
else
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
endif
" Use K to show documentation in preview window.
" Used by coc.nvim
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
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()
" Navigate Completion List
inoremap <silent><expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <silent><expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
" Add `:Format` command to format current buffer.
" Used by coc.nvim
command! -nargs=0 Format :call CocAction('format')
" Confirm Selection
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" TODO: Pick and Chose the ones I want
" Mappings for CoCList
nnoremap <silent><nowait> <space>a :<C-u>CocList diagnostics<cr>
nnoremap <silent><nowait> <space>e :<C-u>CocList extensions<cr>
nnoremap <silent><nowait> <space>c :<C-u>CocList commands<cr>
" LanguageClient Options
nnoremap <F5> :call LanguageClient_contextMenu()<CR>
" Plugged Plugins
call plug#begin(stdpath('data') . '/plugged')
" Delimiter Autocompletion
Plug 'raimondi/delimitmate'
" One Dark Theme
Plug 'joshdick/onedark.vim'
@ -35,26 +93,20 @@ Plug 'tomasr/molokai'
" Tender Theme
Plug 'jacoborus/tender.vim'
" Not too sure if this extension is necessary tbh
Plug 'sheerun/vim-polyglot'
" Powerline Bar at bottom of screen
Plug 'itchyny/lightline.vim'
" Autocomplete
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" Scope Tags
Plug 'majutsushi/tagbar'
" Syntax
Plug 'vim-syntastic/syntastic'
" Rust Support
Plug 'rust-lang/rust.vim'
" Language Server Protocol Support
Plug 'autozimu/LanguageClient-neovim', { 'branch': 'next', 'do': 'bash install.sh', }
" Autocomplete
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
" TOML Support
Plug 'toml-lang/toml'
" Fuzzy Search
Plug 'junegunn/fzf'
@ -76,19 +128,6 @@ call plug#end()
" Autosave with rust-fmt (Rust Only)
let g:rustfmt_autosave = 1
" Enable Autocomplete
let g:deoplete#enable_at_startup = 1
" Install Tender for Lightline
let g:lightline = { 'colorscheme': 'molokai' }
" Let The LSP Client know which Language servers to use
let g:LanguageClient_serverCommands = {
\ 'rust': ['rust-analyzer']
\ }
" Configuration
set noshowmode " Not Needed because we have Lightline
colorscheme molokai