|
|
|
@ -4,6 +4,40 @@ source ~/.vimrc |
|
|
|
|
|
|
|
|
|
|
|
lua << EOF |
|
|
|
lua << EOF |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Setup nvim-cmp. |
|
|
|
|
|
|
|
vim.opt.completeopt = {"menu", "menuone", "noselect"} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local cmp = require'cmp' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmp.setup({ |
|
|
|
|
|
|
|
snippet = { |
|
|
|
|
|
|
|
expand = function(args) |
|
|
|
|
|
|
|
require('luasnip').lsp_expand(args.body) -- For `luasnip` 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.enable, -- 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 }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
sources = cmp.config.sources({ |
|
|
|
|
|
|
|
{ name = 'nvim_lsp' }, |
|
|
|
|
|
|
|
{ name = 'luasnip' }, -- For luasnip users. |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
{ name = 'buffer' }, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Setup lspconfig: capabilities is passed to lspconfig.$server.setup |
|
|
|
|
|
|
|
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) |
|
|
|
|
|
|
|
|
|
|
|
-- Set LSP keymappings in on_attach (i.e. only in buffers with LSP active) |
|
|
|
-- Set LSP keymappings in on_attach (i.e. only in buffers with LSP active) |
|
|
|
local on_attach = function(client, bufnr) |
|
|
|
local on_attach = function(client, bufnr) |
|
|
|
opts = { noremap=true, silent=true } |
|
|
|
opts = { noremap=true, silent=true } |
|
|
|
@ -25,6 +59,7 @@ require'lspconfig'.julials.setup({ |
|
|
|
util.path.dirname(fname) |
|
|
|
util.path.dirname(fname) |
|
|
|
end, |
|
|
|
end, |
|
|
|
on_attach = on_attach, |
|
|
|
on_attach = on_attach, |
|
|
|
|
|
|
|
capabilities = capabilities, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
EOF |
|
|
|
EOF |
|
|
|
|