-
Notifications
You must be signed in to change notification settings - Fork 1
/
neovim
53 lines (44 loc) · 1.48 KB
/
neovim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
call plug#begin()
" Plug 'jparise/vim-graphql'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'mattn/emmet-vim'
Plug 'maxmellon/vim-jsx-pretty'
Plug 'mileszs/ack.vim'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'preservim/nerdtree'
Plug 'tpope/vim-abolish'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
call plug#end()
set expandtab
set tabstop=2
set shiftwidth=2
set colorcolumn=80,100
" https://github.com/neoclide/coc.nvim
set hidden
set nobackup
set nowritebackup
" https://github.com/neoclide/coc.nvim/issues/549#issuecomment-473999207
set noswapfile
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
" delays and poor user experience.
set updatetime=300
" Don't pass messages to |ins-completion-menu|.
set shortmess+=c
" https://vim.fandom.com/wiki/Set_working_directory_to_the_current_file
" set autochdir
" Highlight the symbol and its references when holding the cursor.
autocmd CursorHold * silent call CocActionAsync('highlight')
" Remove any trailing whitespaces
autocmd BufWritePre * if ! &bin | silent! %s/\s\+$//ge | endif
autocmd FileType gitcommit set colorcolumn=72
map <C-n> :NERDTreeToggle<CR>
" https://superuser.com/a/567013
" map <C-n> :NERDTreeToggle %<CR>
" https://stackoverflow.com/questions/7239192
let NERDTreeQuitOnOpen=1
nnoremap <silent> \|\| <Plug>(coc-diagnostic-prev)
nnoremap <silent> \\ <Plug>(coc-diagnostic-next)
nnoremap <silent> <leader>f :GFiles<CR>
nnoremap <silent> <leader>d :Gdiffsplit!<CR>