|
@@ -6,16 +6,16 @@ call plug#begin('~/.vim/plugged')
|
|
|
|
|
|
Plug 'neovim/nvim-lspconfig'
|
|
Plug 'neovim/nvim-lspconfig'
|
|
|
|
|
|
|
|
+ Plug 'hrsh7th/nvim-cmp'
|
|
Plug 'neovim/nvim-lspconfig'
|
|
Plug 'neovim/nvim-lspconfig'
|
|
Plug 'hrsh7th/cmp-nvim-lsp'
|
|
Plug 'hrsh7th/cmp-nvim-lsp'
|
|
Plug 'hrsh7th/cmp-buffer'
|
|
Plug 'hrsh7th/cmp-buffer'
|
|
Plug 'hrsh7th/cmp-path'
|
|
Plug 'hrsh7th/cmp-path'
|
|
Plug 'hrsh7th/cmp-cmdline'
|
|
Plug 'hrsh7th/cmp-cmdline'
|
|
- Plug 'hrsh7th/nvim-cmp'
|
|
|
|
|
|
|
|
" For vsnip users.
|
|
" For vsnip users.
|
|
- Plug 'hrsh7th/cmp-vsnip'
|
|
|
|
- Plug 'hrsh7th/vim-vsnip'
|
|
|
|
|
|
+ Plug 'saadparwaiz1/cmp_luasnip'
|
|
|
|
+ ""Plug 'hrsh7th/vim-vsnip'
|
|
|
|
|
|
Plug 'chriskempson/base16-vim'
|
|
Plug 'chriskempson/base16-vim'
|
|
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " We recommend updating the parsers on update
|
|
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " We recommend updating the parsers on update
|
|
@@ -81,74 +81,3 @@ nnoremap <leader>fg <cmd>Telescope live_grep<cr>
|
|
nnoremap <leader>fb <cmd>Telescope buffers<cr>
|
|
nnoremap <leader>fb <cmd>Telescope buffers<cr>
|
|
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
|
|
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
|
|
|
|
|
|
-
|
|
|
|
-" nvim-cmp configurations
|
|
|
|
-
|
|
|
|
-lua <<EOF
|
|
|
|
- -- Setup nvim-cmp.
|
|
|
|
- local cmp = require'cmp'
|
|
|
|
-
|
|
|
|
- cmp.setup({
|
|
|
|
- snippet = {
|
|
|
|
- -- REQUIRED - you must specify a snippet engine
|
|
|
|
- expand = function(args)
|
|
|
|
- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
|
|
|
- end,
|
|
|
|
- },
|
|
|
|
- mapping = {
|
|
|
|
- ['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
|
|
|
|
- ['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
|
|
|
|
- ['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
|
|
|
|
- ['<C-y>'] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
|
|
|
- ['<C-e>'] = cmp.mapping({
|
|
|
|
- i = cmp.mapping.abort(),
|
|
|
|
- c = cmp.mapping.close(),
|
|
|
|
- }),
|
|
|
|
- ['<CR>'] = cmp.mapping.confirm({ select = true }),
|
|
|
|
- },
|
|
|
|
- sources = cmp.config.sources({
|
|
|
|
- { name = 'nvim_lsp' },
|
|
|
|
- { name = 'vsnip' }, -- For vsnip users.
|
|
|
|
- }, {
|
|
|
|
- { name = 'buffer' },
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
|
|
|
- cmp.setup.cmdline('/', {
|
|
|
|
- sources = {
|
|
|
|
- { name = 'buffer' }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
|
|
|
- cmp.setup.cmdline(':', {
|
|
|
|
- sources = cmp.config.sources({
|
|
|
|
- { name = 'path' }
|
|
|
|
- }, {
|
|
|
|
- { name = 'cmdline' }
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- -- Setup lspconfig.
|
|
|
|
- local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
|
|
|
- -- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
|
|
|
|
-
|
|
|
|
- local function config(_config)
|
|
|
|
- return vim.tbl_deep_extend("force", {
|
|
|
|
- capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()),
|
|
|
|
- }, _config or {})
|
|
|
|
- end
|
|
|
|
-
|
|
|
|
- require('lspconfig')['gopls'].setup {config()}
|
|
|
|
- require('lspconfig')['rust_analyzer'].setup {config()}
|
|
|
|
- require('lspconfig')['bashls'].setup{config()}
|
|
|
|
- require('lspconfig')['jsonls'].setup{config()}
|
|
|
|
- require('lspconfig')['clangd'].setup{config()}
|
|
|
|
-
|
|
|
|
- require('lspconfig')['jedi_language_server'].setup{config()}
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-EOF
|
|
|
|
-
|
|
|