Initial nvim config.
This commit is contained in:
parent
e915531d83
commit
c26d67450b
19 changed files with 279 additions and 0 deletions
33
.config/nvim/lua/utils.lua
Normal file
33
.config/nvim/lua/utils.lua
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
local M = {}
|
||||
|
||||
function M.init_lazy()
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable",
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
end
|
||||
|
||||
function load_server(lspconfig, server)
|
||||
server_name = server[1]
|
||||
table.remove(server, 1)
|
||||
lspconfig[server_name].setup(server)
|
||||
end
|
||||
|
||||
function M.load_servers(servers)
|
||||
lspconfig = require("lspconfig")
|
||||
for _, server in ipairs(servers) do
|
||||
load_server(lspconfig, server)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
Loading…
Add table
Add a link
Reference in a new issue