Update vim config

master
Hektor Misplon 2020-05-13 17:08:38 +00:00
parent 3d78f2365d
commit b5aaba0b3e
1 changed files with 34 additions and 32 deletions

66
.vimrc
View File

@ -49,10 +49,10 @@ nnoremap sk <c-w>k
nnoremap sl <c-w>l nnoremap sl <c-w>l
" split resize " split resize
nnoremap sH <C-w>< nnoremap sH <C-w>8<
nnoremap sJ <C-w>- nnoremap sJ <C-w>8-
nnoremap sK <C-w>+ nnoremap sK <C-w>8+
nnoremap sL <C-w>> nnoremap sL <C-w>8>
" file tree " file tree
nnoremap sb :Lex<CR> nnoremap sb :Lex<CR>
@ -91,34 +91,6 @@ nnoremap <leader>ec :vsplit $MYVIMRC<cr>
" source current file " source current file
nnoremap <leader>so :so %<cr> nnoremap <leader>so :so %<cr>
" coc
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
noremap <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
" <c-space> triggers completion
inoremap <silent><expr> <c-@> coc#refresh()
" code action on cursor position
nmap <leader>do <Plug>(coc-codeaction)
" apply code action to selected region
" xmap <leader>a <Plug>(coc-codeaction-selected)
" nmap <leader>a <Plug>(coc-codeaction-selected)
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
" :Prettier command to prettify file
command! -nargs=0 Prettier :CocCommand prettier.formatFile
" plugins ______________________________ " plugins ______________________________
call plug#begin() call plug#begin()
@ -130,6 +102,7 @@ Plug 'junegunn/fzf.vim'
Plug 'pangloss/vim-javascript', { 'for': ['javascript', 'javascript.jsx'] } Plug 'pangloss/vim-javascript', { 'for': ['javascript', 'javascript.jsx'] }
Plug 'leafgarland/typescript-vim', { 'for': ['typescript', 'typescript.tsx'] } Plug 'leafgarland/typescript-vim', { 'for': ['typescript', 'typescript.tsx'] }
Plug 'peitalin/vim-jsx-typescript', { 'for': ['typescript.tsx'] } Plug 'peitalin/vim-jsx-typescript', { 'for': ['typescript.tsx'] }
Plug 'evanleck/vim-svelte'
Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'neoclide/coc.nvim', {'branch': 'release'}
let g:coc_global_extensions = [ let g:coc_global_extensions = [
@ -176,6 +149,10 @@ let g:javascript_plugin_flow = 1 " flow syntax highlighting
let g:javascript_conceal_function = "ƒ" let g:javascript_conceal_function = "ƒ"
let g:javascript_conceal_return = "⇚"" let g:javascript_conceal_return = "⇚""
" svelte
let g:svelte_indent_script = 0
let g:svelte_indent_style = 0
" SuperCollider " SuperCollider
au BufEnter,BufWinEnter,BufNewFile,BufRead *.sc,*.scd set filetype=supercollider au BufEnter,BufWinEnter,BufNewFile,BufRead *.sc,*.scd set filetype=supercollider
au Filetype supercollider packadd scvim au Filetype supercollider packadd scvim
@ -185,7 +162,32 @@ let g:tidal_default_config = {"socket_name": "default", "target_pane": "tidal:1.
" plugin keybindings ___________________ " plugin keybindings ___________________
" coc autocompletion
inoremap <silent><expr> <C-j>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><C-k> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" <TAB> confirm completion
inoremap <expr> <TAB> pumvisible() ? "\<cr>" : "\<C-g>u\<CR>"
" code action on cursor position
nmap <leader>do <Plug>(coc-codeaction)
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
" :Prettier command to prettify file
command! -nargs=0 Prettier :CocCommand prettier.formatFile
nnoremap <c-p> :FZF<cr> nnoremap <c-p> :FZF<cr>
nnoremap <leader>p :FZF<cr>
nnoremap <leader>b :Buffers<cr> nnoremap <leader>b :Buffers<cr>
nnoremap <leader>h :History<cr> nnoremap <leader>h :History<cr>
let g:fzf_action = { let g:fzf_action = {