Skip to content

Instantly share code, notes, and snippets.

@VonHeikemen
Last active February 27, 2024 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VonHeikemen/2c4aef2c405694c84e03a1462fedf987 to your computer and use it in GitHub Desktop.
Save VonHeikemen/2c4aef2c405694c84e03a1462fedf987 to your computer and use it in GitHub Desktop.
Minimal configuration of lsp-zero used in the demo https://asciinema.org/a/636643 (doesn't include colorscheme)
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
-- Auto-install lazy.nvim if not present
if not vim.loop.fs_stat(lazypath) then
print('Installing lazy.nvim....')
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
lazypath,
})
print('Done.')
end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup({
{'VonHeikemen/lsp-zero.nvim', branch = 'v3.x'},
{'neovim/nvim-lspconfig'},
{'hrsh7th/cmp-nvim-lsp'},
{'hrsh7th/nvim-cmp'},
{'L3MON4D3/LuaSnip'},
})
require('lsp-zero')
require('lspconfig').intelephense.setup({})
--- NOTE:
--- intelphense needs to be installed in your system.
--- you need nodejs. and then do: npm install -g intelephense
---
--- with this setup the only keybindings you'll get are the
--- ones neovim enables by default:
---
--- <Ctrl-]> : go to definition (use <Ctrl-t> to go back)
--- gq : formats code in visual mode.
--- K : (in neovim v0.10) shows documentation of symbol
---
--- the autocompletion menu uses neovim's default keybindings
---
--- <Ctrl-y> : confirms completion
--- <Ctrl-e> : cancel completion
--- <Down> : navigate to next item on the list
--- <Up> : navigate to previous item on the list
--- <Ctrl-n> : Go to next item, or trigger completion menu
--- <Ctrl-p> : Go to previous item, or trigger completion menu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment