diff options
| author | Bond_009 <bond.009@outlook.com> | 2021-08-06 23:59:34 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2021-08-06 23:59:34 +0200 |
| commit | f0a3b628c874a27b8fa4420fcaad60e463f1a96b (patch) | |
| tree | 99fa871950edae3625a814fbb7f48ad674ef26df | |
| parent | 146ab56175969a3412c1ad8dfae47e7c03e65abb (diff) | |
Use neovim LSP client
| -rwxr-xr-x | neovim/.config/nvim/init.vim | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/neovim/.config/nvim/init.vim b/neovim/.config/nvim/init.vim index d58badf..b148460 100755 --- a/neovim/.config/nvim/init.vim +++ b/neovim/.config/nvim/init.vim @@ -19,15 +19,12 @@ Plug 'rust-lang/rust.vim' Plug 'cespare/vim-toml' " Autocomplete -Plug 'roxma/nvim-yarp' -Plug 'ncm2/ncm2' -Plug 'ncm2/ncm2-bufword' -Plug 'ncm2/ncm2-tmux' -Plug 'ncm2/ncm2-path' +Plug 'neovim/nvim-lspconfig' +Plug 'hrsh7th/nvim-compe' " Fuzzy finder Plug 'airblade/vim-rooter' -Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } +Plug 'junegunn/fzf.vim' " Initialize plugin system call plug#end() @@ -66,20 +63,36 @@ set cindent " Keybinds map <C-f> / +map <C-g> : map <C-s> :w<Cr> -" Open file keybind -map <C-p> :Files<Cr> " Permanent undo set undodir=~/.vimdid set undofile -" ncm2 settings -autocmd BufEnter * call ncm2#enable_for_buffer() -set completeopt=noinsert,menuone,noselect -" tab to select -" and don't hijack my enter key -inoremap <expr><Tab> (pumvisible()?(empty(v:completed_item)?"\<C-n>":"\<C-y>"):"\<Tab>") -inoremap <expr><CR> (pumvisible()?(empty(v:completed_item)?"\<CR>\<CR>":"\<C-y>"):"\<CR>") +" autocomplete +" menuone: popup even when there's only one match +" noinsert: Do not insert text until a selection is made +" noselect: Do not select, force user to select one from the menu +set completeopt=menuone,noinsert,noselect +let g:compe = {} +let g:compe.source = {} +let g:compe.source.path = v:true +let g:compe.source.buffer = v:true +let g:compe.source.nvim_lsp = v:true + +inoremap <silent><expr> <C-Space> compe#complete() +inoremap <silent><expr> <CR> compe#confirm('<CR>') +inoremap <silent><expr> <Tab> compe#confirm('<Tab>') + +lua require'lspconfig'.pyright.setup{} +lua require'lspconfig'.clangd.setup{} +lua require'lspconfig'.rust_analyzer.setup{} + +" fzf settings +" Open file keybind +map <C-p> :GFiles<Cr> +" Disable preview window +let g:fzf_preview_window = [] let g:tex_flavor = 'latex' |
