diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-11-13 19:58:10 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-11-13 19:58:10 +0100 |
commit | 3a489c6ebaf8f080bf7e55c868059ed3802a924a (patch) | |
tree | 98e4bb3b9b3e6e33ebdc94b7f34181c215d8fd22 /.config | |
parent | New lsp, coc sucks (diff) | |
download | dotfiles-bsd-3a489c6ebaf8f080bf7e55c868059ed3802a924a.tar.gz dotfiles-bsd-3a489c6ebaf8f080bf7e55c868059ed3802a924a.tar.bz2 dotfiles-bsd-3a489c6ebaf8f080bf7e55c868059ed3802a924a.tar.xz dotfiles-bsd-3a489c6ebaf8f080bf7e55c868059ed3802a924a.tar.zst dotfiles-bsd-3a489c6ebaf8f080bf7e55c868059ed3802a924a.zip |
Perfect vim C/C++ config
Diffstat (limited to '')
-rw-r--r-- | .config/env | 2 | ||||
-rw-r--r-- | .config/nvim/bindings.vim | 1 | ||||
-rw-r--r-- | .config/nvim/init.vim | 4 | ||||
-rw-r--r-- | .config/nvim/plug-config/asyncomplete.vim | 11 | ||||
-rw-r--r-- | .config/nvim/plug-config/signify.vim | 1 | ||||
-rw-r--r-- | .config/nvim/plug-config/vim-lsp.vim | 6 | ||||
-rw-r--r-- | .config/nvim/plug.vim | 4 | ||||
-rw-r--r-- | .config/nvim/settings.vim | 1 |
8 files changed, 24 insertions, 6 deletions
diff --git a/.config/env b/.config/env index 6c4084e..a419844 100644 --- a/.config/env +++ b/.config/env @@ -12,7 +12,7 @@ # ======================== # PATH -export PATH="$HOME"/.local/bin:"$PATH":/usr/local/llvm11/bin +export PATH="$HOME"/.local/bin:"$PATH":/usr/local/llvm10/bin:/usr/local/llvm11/bin # Apps export EDITOR='nvim' diff --git a/.config/nvim/bindings.vim b/.config/nvim/bindings.vim index d6219b9..c6f7b44 100644 --- a/.config/nvim/bindings.vim +++ b/.config/nvim/bindings.vim @@ -54,6 +54,7 @@ nmap <M-9> <Plug>AirlineSelectTab9 nmap <M-0> <Plug>AirlineSelectTab10 inoremap <expr> <C-j> pumvisible() ? "<C-n>" : "<C-j>" inoremap <expr> <C-k> pumvisible() ? "<C-p>" : "<C-k>" +inoremap <expr> <cr> pumvisible() ? asyncomplete#close_popup() : "\<cr>" let g:floaterm_keymap_toggle = '<F1>' let g:floaterm_keymap_prev = '<F11>' let g:floaterm_keymap_next = '<F12>' diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 2315854..b18998b 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -20,7 +20,7 @@ source /home/jozan/.config/nvim/bindings.vim source /home/jozan/.config/nvim/sidebars.vim source /home/jozan/.config/nvim/langs.vim source /home/jozan/.config/nvim/plug-config/airline.vim -source /home/jozan/.config/nvim/plug-config/vim-lsp.vim +source /home/jozan/.config/nvim/plug-config/asyncomplete.vim " source /home/jozan/.config/nvim/plug-config/coc.vim source /home/jozan/.config/nvim/plug-config/floaterm.vim source /home/jozan/.config/nvim/plug-config/nerd-commenter.vim @@ -28,3 +28,5 @@ source /home/jozan/.config/nvim/plug-config/org.vim source /home/jozan/.config/nvim/plug-config/quickscope.vim source /home/jozan/.config/nvim/plug-config/rainbow.vim source /home/jozan/.config/nvim/plug-config/startify.vim +source /home/jozan/.config/nvim/plug-config/signify.vim +source /home/jozan/.config/nvim/plug-config/vim-lsp.vim diff --git a/.config/nvim/plug-config/asyncomplete.vim b/.config/nvim/plug-config/asyncomplete.vim new file mode 100644 index 0000000..60c9cf1 --- /dev/null +++ b/.config/nvim/plug-config/asyncomplete.vim @@ -0,0 +1,11 @@ +autocmd User asyncomplete_setup call asyncomplete#register_source( + \ asyncomplete#sources#clang#get_source_options({ + \ 'config': { + \ 'clang_path': '/usr/bin/cc', + \ 'clang_args': { + \ 'default': ['-I/usr/include'], + \ 'c': ['-std=c89', '-I/usr/include'], + \ 'cpp': ['-std=c++98', '-I/usr/include'] + \ } + \ } + \ })) diff --git a/.config/nvim/plug-config/signify.vim b/.config/nvim/plug-config/signify.vim new file mode 100644 index 0000000..7243fbe --- /dev/null +++ b/.config/nvim/plug-config/signify.vim @@ -0,0 +1 @@ +let g:signify_priority = 9 diff --git a/.config/nvim/plug-config/vim-lsp.vim b/.config/nvim/plug-config/vim-lsp.vim index f416557..4accf36 100644 --- a/.config/nvim/plug-config/vim-lsp.vim +++ b/.config/nvim/plug-config/vim-lsp.vim @@ -1,10 +1,10 @@ -if executable('clangd') +if executable('/usr/local/llvm10/bin/clangd') augroup lsp_clangd autocmd! autocmd User lsp_setup call lsp#register_server({ \ 'name': 'clangd', \ 'cmd': {server_info->['clangd']}, - \ 'whitelist': ['c', 'cpp', 'objc', 'objcpp'], + \ 'whitelist': ['c', 'cpp', 'objc', 'objcpp'] \ }) autocmd FileType c setlocal omnifunc=lsp#complete autocmd FileType cpp setlocal omnifunc=lsp#complete @@ -12,3 +12,5 @@ if executable('clangd') autocmd FileType objcpp setlocal omnifunc=lsp#complete augroup end endif + +let g:lsp_signs_priority = 10 diff --git a/.config/nvim/plug.vim b/.config/nvim/plug.vim index cd22be7..9e9a606 100644 --- a/.config/nvim/plug.vim +++ b/.config/nvim/plug.vim @@ -1,5 +1,4 @@ call plug#begin(system('echo -n "$XDG_DATA_HOME/nvim/plugged"')) -" Plug 'antoinemadec/coc-fzf', {'branch': 'release'} Plug 'ap/vim-css-color' Plug 'brglng/vim-sidebar-manager' Plug 'dag/vim-fish' @@ -16,9 +15,10 @@ Plug 'mg979/vim-visual-multi' Plug 'mhinz/vim-signify' Plug 'mhinz/vim-startify' Plug 'morhetz/gruvbox' -" Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'paretje/nvim-man' Plug 'prabirshrestha/async.vim' +Plug 'prabirshrestha/asyncomplete.vim' +Plug 'keremc/asyncomplete-clang.vim' Plug 'prabirshrestha/vim-lsp' Plug 'preservim/tagbar' Plug 'preservim/nerdcommenter' diff --git a/.config/nvim/settings.vim b/.config/nvim/settings.vim index 160aee9..47241a3 100644 --- a/.config/nvim/settings.vim +++ b/.config/nvim/settings.vim @@ -4,6 +4,7 @@ set cindent set cinoptions=>s,e0,n0,f0,{0,}0,^0,L-1,:s,=s,l1,b0,gs,h0,N0,E0,p0,t0,i0,+s set cinoptions+=c1,C0,/0,(s,us,U0,w0,Ws,k0,m0,M1,)20,*70,#0 set clipboard^=unnamedplus +set completeopt=menuone,noinsert,noselect,preview set cursorline set encoding=utf-8 set go=a |