GithubHelp home page GithubHelp logo

Comments (4)

VonHeikemen avatar VonHeikemen commented on May 18, 2024 2

completion was not exposed. But since 81e3d1f you can overwrite it if you want.

This should work now.

local lsp = require('lsp-zero')
lsp.preset('recommended')

lsp.setup_nvim_cmp({
  completion = { autocomplete = false }
})

lsp.setup()

from lsp-zero.nvim.

Aaronik avatar Aaronik commented on May 18, 2024

Thank you for your lightening fast response!

I've updated your plugin in my setup (Using plug, so I ran :PlugUpdate). I saw that lsp-zero was updated. I also went to the ~/.vim/plugged/lsp-zero folder and checked the git history, and the 81e3d1f commit was there, in addition to a couple more.

I have a series of lsp calls in my lua config: lsp.set_preferences(...), lsp.on_attach(...), lsp.setup_nvim_cmp(...). Here is the relevant config:

local lspz = require('lsp-zero')

lspz.set_preferences({
  suggest_lsp_servers = true,
  setup_servers_on_start = true,
  set_lsp_keymaps = false, -- Toggled b/c the defaults are alright but not great for me.
  configure_diagnostics = true,
  cmp_capabilities = true,
  manage_nvim_cmp = true,
  call_servers = 'local',
  sign_icons = {
    error = '',
    warn = '',
    hint = '',
    info = ''
  }
})

lspz.on_attach(function()
  local noremap = {noremap = true}
  local map = function(...) vim.api.nvim_buf_set_keymap(0, ...) end

  map('n', '<leader>je', '<cmd>lua vim.lsp.buf.rename()<cr>', noremap)
  map('n', '<leader>jk', '<cmd>lua vim.lsp.buf.hover()<cr>', noremap)
  map('n', '<leader>jd', '<cmd>lua vim.lsp.buf.definition()<cr>', noremap)
  map('n', '<leader>jD', '<cmd>lua vim.lsp.buf.declaration()<cr>', noremap)
  map('n', '<leader>jt', '<cmd>lua vim.lsp.buf.type_definition()<cr>', noremap)
  map('n', '<leader>ji', '<cmd>lua vim.lsp.buf.implementation()<cr>', noremap)
  map('n', '<leader>jr', '<cmd>lua vim.lsp.buf.references()<cr>', noremap)
  map('n', '<leader>js', '<cmd>lua vim.lsp.buf.signature_help()<cr>', noremap)
  map('n', '<leader>ja', '<cmd>lua vim.lsp.buf.code_action()<cr>', noremap)
  map('n', '<leader>jf', '<cmd>lua LspZeroFormat<cr>', noremap)
  map('n', '<leader>jw', '<cmd>lua vim.diagnostic.open_float()<cr>', noremap)
  map('n', '<C-l>', '<cmd>lua vim.diagnostic.goto_prev()<cr>', noremap)
  map('n', '<C-h>', '<cmd>lua vim.diagnostic.goto_next()<cr>', noremap)
end)

lspz.setup_nvim_cmp({
  completion = { autocomplete = false }
})

lspz.setup()

However I'm still seeing autocompletion. Am I doing anything obviously wrong?

from lsp-zero.nvim.

VonHeikemen avatar VonHeikemen commented on May 18, 2024

It works for me.

Could it be another plugin or old configuration code still around?

Side note: <leader>jf is not going to work. LspZeroFormat is a vim command not a lua function. You should bind it to <cmd>lua vim.lsp.buf.formatting()<cr>.

from lsp-zero.nvim.

Aaronik avatar Aaronik commented on May 18, 2024

Ah oh nice, thank you for the heads up about jf, you're right that totally will not work.

I'm not really sure, I'll keep looking into it and if I find an answer I'll come back and post. Thanks for your help!

UPDATE: User error all the way. In figuring out where I was going to house my rc/init scripts and just generally getting it all working, I forgot to make a sym link to a file and was editing one in the wrong directory. Works now like a charm.

from lsp-zero.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.