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 " Shortcuts
map <C-o> :NERDTreeToggle<CR> 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. " Required for operations modifying multiple buffers like rename.
" Used by coc.nvim
set hidden set hidden
let g:LanguageClient_serverCommands = { " Set more space for displaying messages
\ 'rust': ['rust-analyzer'] " 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>"
" Confirm Selection " Add `:Format` command to format current buffer.
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>" " Used by coc.nvim
command! -nargs=0 Format :call CocAction('format')
" 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 " Plugged Plugins
call plug#begin(stdpath('data') . '/plugged') call plug#begin(stdpath('data') . '/plugged')
" Delimiter Autocompletion
Plug 'raimondi/delimitmate'
" One Dark Theme " One Dark Theme
Plug 'joshdick/onedark.vim' Plug 'joshdick/onedark.vim'
@ -35,26 +93,20 @@ Plug 'tomasr/molokai'
" Tender Theme " Tender Theme
Plug 'jacoborus/tender.vim' Plug 'jacoborus/tender.vim'
" Not too sure if this extension is necessary tbh
Plug 'sheerun/vim-polyglot'
" Powerline Bar at bottom of screen " Powerline Bar at bottom of screen
Plug 'itchyny/lightline.vim' Plug 'itchyny/lightline.vim'
" Autocomplete
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" Scope Tags " Scope Tags
Plug 'majutsushi/tagbar' Plug 'majutsushi/tagbar'
" Syntax
Plug 'vim-syntastic/syntastic'
" Rust Support " Rust Support
Plug 'rust-lang/rust.vim' Plug 'rust-lang/rust.vim'
" Language Server Protocol Support " TOML Support
Plug 'autozimu/LanguageClient-neovim', { 'branch': 'next', 'do': 'bash install.sh', } Plug 'toml-lang/toml'
" Autocomplete
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
" Fuzzy Search " Fuzzy Search
Plug 'junegunn/fzf' Plug 'junegunn/fzf'
@ -76,19 +128,6 @@ call plug#end()
" Autosave with rust-fmt (Rust Only) " Autosave with rust-fmt (Rust Only)
let g:rustfmt_autosave = 1 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 " Configuration
set noshowmode " Not Needed because we have Lightline set noshowmode " Not Needed because we have Lightline
colorscheme molokai colorscheme molokai