Comments (7)
That should work. Just have to make sure you place that after lsp-zero's setup function.
from lsp-zero.nvim.
Here is what I have:
return {
'VonHeikemen/lsp-zero.nvim',
branch = 'v2.x',
dependencies = {
{ 'neovim/nvim-lspconfig' },
{
'williamboman/mason.nvim',
build = function()
pcall(vim.cmd, 'MasonUpdate')
end,
},
{ 'williamboman/mason-lspconfig.nvim' }, -- optional
{ 'hrsh7th/nvim-cmp' }, -- required
{ 'hrsh7th/cmp-nvim-lsp' }, -- required
{ 'L3MON4D3/LuaSnip' }, -- required
},
config = function()
local lsp = require('lsp-zero').preset({})
lsp.on_attach(function(client, bufnr)
lsp.default_keymaps({ buffer = bufnr })
end)
local config = require('lspconfig')
config.cssls.setup({})
config.html.setup({})
config.jsonls.setup({})
config.lua_ls.setup(lsp.nvim_lua_ls())
config.ruby_ls.setup({})
config.tailwindcss.setup({})
config.tsserver.setup({})
config.vimls.setup({})
config.volar.setup({})
lsp.setup()
-- don't update diagnostics constantly
vim.diagnostic.update_in_insert = false
-- cmp
local cmp = require('cmp')
cmp.setup({
mapping = {
['<C-e>'] = cmp.mapping.confirm({ select = false }),
},
})
end,
}
-- V3... for whenever we switch
-- return {
-- {
-- 'VonHeikemen/lsp-zero.nvim',
-- branch = 'dev-v3'
-- },
-- { 'williamboman/mason.nvim' },
-- { 'williamboman/mason-lspconfig.nvim' },
--
-- -- lsp support
-- {
-- 'neovim/nvim-lspconfig',
-- dependencies = {
-- { 'hrsh7th/cmp-nvim-lsp' },
-- },
-- },
--
-- -- autocompletion
-- {
-- 'hrsh7th/nvim-cmp',
-- dependencies = {
-- { 'L3MON4D3/LuaSnip' },
-- },
-- },
-- }
from lsp-zero.nvim.
That's very odd. It should work. Can you try this?
cmp.setup({
mapping = {
['<C-e>'] = cmp.mapping(function()
cmp.confirm({select = false})
end),
},
})
from lsp-zero.nvim.
Sadly no dice
from lsp-zero.nvim.
Dude very weird.................. now it works. I swear I tried 4-5 times, restarted and everything. Part of me is wondering if I now configured something else which indirectly fixed it...
from lsp-zero.nvim.
Hmm........ it turns out the following fixed it. It was enabling the enter key...
I reverted it back to test again and it breaks again. Luckily I want both keys to trigger it, but I have no idea why it wont work with alone
local cmp_confirm = cmp.mapping.confirm({ select = false })
cmp.setup({
mapping = {
['<C-e>'] = cmp_confirm,
['<CR>'] = cmp_confirm,
},
from lsp-zero.nvim.
As a side note, i am not a lua expert but i get a warning here from the copy paste docs. I had to change it to a function call to prevent an error.
pcall(function() vim.cmd('MasonUpdate') end)
from lsp-zero.nvim.
Related Issues (20)
- [feature] helper functions for efm language server
- grey foldcolumn when after installing lsp-zero.nvim HOT 2
- Client 1 quit with exit code 1 and signal 15 HOT 4
- What if I don't find my LSP in MASON HOT 3
- Bug: Formatting resets some content of a file
- Cannot add laravel-dev-tools HOT 2
- Highlight symbol under cursor HOT 3
- ThePrimeagen Config doesn't ensure lua lsp install. HOT 6
- add file paths to tutorial examples HOT 9
- Diagnostic signs in Neovim v0.10.0 and `vim.diagnostic.config()` HOT 2
- suggestions overlap with each other HOT 3
- Add 'linewidth' parameter to 'formatting_options' HOT 2
- Bug: use_fallback = true causing single-repeat issues HOT 3
- autocomplete on tab HOT 1
- How to integrate conform.nvim with lsp-zero.nvim HOT 2
- Need help to load friendly-snippets HOT 1
- lsp_zero.cmp_format() hides important information for rust_analyzer HOT 2
- error installing gopls(same thing happend with hls) HOT 2
- error installing hls(haskell server) HOT 1
- Allow setting max width on vim.diagnostics
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lsp-zero.nvim.