Skip to content

Instantly share code, notes, and snippets.

@TimUntersberger
Created October 2, 2019 22:09
Show Gist options
  • Save TimUntersberger/2bc437beb45d31abf9e0a28fbe2ba19d to your computer and use it in GitHub Desktop.
Save TimUntersberger/2bc437beb45d31abf9e0a28fbe2ba19d to your computer and use it in GitHub Desktop.
call plug#begin(stdpath('data') . '/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'dracula/vim', { 'as': 'dracula' }
call plug#end()
syntax on
colorscheme dracula
set hidden
set nobackup
set nowritebackup
set noswapfile
set nowrap
set autochdir
set number
set tabstop=2
set softtabstop=2
let mapleader=" "
function! s:upload_config()
let s:exists = system('[ -d "~/dotfiles" ]')
if s:exists == 0
echo "dotfiles repo missing in following path '~/dotfiles'"
echo "cloning repo..."
silent execute '!cd ~ && git clone [email protected]:TimUntersberger/dotfiles.git'
echo "done"
endif
silent execute '!cd ~/dotfiles && git commit -am "Update init.vim" && git push && echo "uploaded config"'
endfunction
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
endif
endfunction
command! EditConfig :e ~/.config/nvim/init.vim
command! EC :EditConfig
command! ReloadConfig :so ~/.config/nvim/init.vim
command! RC :ReloadConfig
command! UploadConfig :call <SID>upload_config()
command! UC :UploadConfig
inoremap <silent><expr> <c-space> coc#refresh()
nmap <silent> gp <Plug>(coc-diagnostic-prev)
nmap <silent> gn <Plug>(coc-diagnostic-next)
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gt <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
nnoremap <silent> gh :call <SID>show_documentation()<CR>
nmap <leader>rn <Plug>(coc-rename)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment