Created
October 13, 2021 21:37
-
-
Save crater2150/256d81bf766144e4158176e632bb8ac8 to your computer and use it in GitHub Desktop.
minimal config for bug repro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
call plug#begin(expand('<sfile>:p:h') . '/plugged') | |
Plug 'neovim/nvim-lspconfig' | |
Plug 'hrsh7th/cmp-nvim-lsp' | |
Plug 'hrsh7th/cmp-buffer' | |
Plug 'hrsh7th/nvim-cmp' | |
Plug 'nvim-lua/plenary.nvim' | |
Plug 'scalameta/nvim-metals' | |
" For vsnip user. | |
Plug 'hrsh7th/cmp-vsnip' | |
Plug 'hrsh7th/vim-vsnip' | |
" For luasnip user. | |
" Plug 'L3MON4D3/LuaSnip' | |
" Plug 'saadparwaiz1/cmp_luasnip' | |
" For ultisnips user. | |
" Plug 'SirVer/ultisnips' | |
" Plug 'quangnguyen30192/cmp-nvim-ultisnips' | |
call plug#end() | |
set completeopt=menu,menuone,noselect | |
lua <<EOF | |
-- Setup nvim-cmp. | |
local cmp = require'cmp' | |
cmp.setup({ | |
snippet = { | |
expand = function(args) | |
-- For `vsnip` user. | |
vim.fn["vsnip#anonymous"](args.body) | |
-- For `luasnip` user. | |
-- require('luasnip').lsp_expand(args.body) | |
-- For `ultisnips` user. | |
-- vim.fn["UltiSnips#Anon"](args.body) | |
end, | |
}, | |
mapping = { | |
['<C-d>'] = cmp.mapping.scroll_docs(-4), | |
['<C-f>'] = cmp.mapping.scroll_docs(4), | |
['<C-Space>'] = cmp.mapping.complete(), | |
['<C-e>'] = cmp.mapping.close(), | |
['<CR>'] = cmp.mapping.confirm({ select = true }), | |
}, | |
sources = { | |
{ name = 'nvim_lsp' }, | |
-- For vsnip user. | |
{ name = 'vsnip' }, | |
-- For luasnip user. | |
-- { name = 'luasnip' }, | |
-- For ultisnips user. | |
-- { name = 'ultisnips' }, | |
{ name = 'buffer' }, | |
} | |
}) | |
-- Setup lsp. | |
metals_config = require("metals").bare_config | |
metals_config.init_options.statusBarProvider = "on" | |
metals_config.settings = { showImplicitArguments = true } | |
metals_config.on_attach = on_attach | |
metals_config.capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) | |
EOF | |
augroup lsp | |
au! | |
au FileType scala,sbt lua require("metals").initialize_or_attach({}) | |
augroup end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment