Skip to content

Commit 0557dc1

Browse files
Jedrzej OrbikJedrzej Orbik
authored andcommitted
Set up lsp in lsp-zero config call
1 parent f684416 commit 0557dc1

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

stow/common/dot-config/nvim/lua/config_plugins/lsp-zero.lua

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
if vscode then
2-
return
3-
end
4-
5-
local status_ok, lsp_zero = pcall(require, 'lsp-zero')
6-
if not status_ok then
7-
return
8-
end
91
local common = require('common')
2+
local lsp_zero = require('lsp-zero')
103

114
-- List LSP servers that will be automatically installed upon entering filetype for the first time.
125
-- LSP servers will be installed locally via mason at: ~/.local/share/nvim/mason/packages/

stow/common/dot-config/nvim/lua/plugins.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ local plugins = {
602602
},
603603
{
604604
'VonHeikemen/lsp-zero.nvim', branch = 'v4.x',
605+
event = {"BufReadPre", "BufNewFile"},
605606
dependencies = {
606607
-- LSP Support
607608
{'neovim/nvim-lspconfig'},
@@ -630,6 +631,9 @@ local plugins = {
630631
{'jay-babu/mason-null-ls.nvim'},
631632
{'folke/neoconf.nvim', opts = {}}, -- autoload settings.json
632633
},
634+
config = function()
635+
require 'config_plugins.lsp-zero'
636+
end,
633637
cond = not_vscode
634638
},
635639
{

stow/common/dot-config/nvim/lua/settings.lua

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,6 @@ vim.cmd([[
133133
autocmd BufRead,BufNewFile *.envrc set filetype=sh
134134
augroup end
135135
]])
136-
-- lsp config
137-
vim.api.nvim_create_autocmd({"BufReadPre", "BufNewFile"}, {
138-
group = augroup("misc_aucmds"),
139-
callback = function()
140-
require 'config_plugins.lsp-zero'
141-
end,
142-
once = true,
143-
})
144136

145137
-- improve file reloads
146138
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {

0 commit comments

Comments
 (0)