Auto download packages on first launch

This commit is contained in:
Alexander Rosenberg 2022-11-30 00:21:44 -08:00
parent 777b73b061
commit 4c6627deed
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730
2 changed files with 11 additions and 3 deletions

View File

@ -509,6 +509,8 @@
(use! :neovim/nvim-lspconfig
:after :cmp-nvim-lsp
:config lsp_config_callback)
;; nvim-jdtls
(fn jdtls_config_callback []
(hook! :FileType :java
#(let [root_dir ((. (require :jdtls.setup) :find_root)
@ -524,8 +526,11 @@
:jdtls root_dir) ]}))))
(use! :mfussenegger/nvim-jdtls
:after :nvim-lspconfig
:config jdtls_config_callback))
:config jdtls_config_callback)
;; Sync all packages on first launch
(if _G.zander.first_launch
((. (require :packer) :sync))))
(vim.cmd.packadd "packer.nvim")
(let [packer (require :packer)]
(packer.startup packer_init_callback))

View File

@ -3,10 +3,13 @@ local function bootstrap(pkg, repo)
if vim.fn.isdirectory(plug_dir) ~= 1 then
vim.fn.system({ 'git', 'clone', '--depth', '1', repo, plug_dir })
vim.cmd.packadd(pkg)
return true
end
return false
end
bootstrap('packer.nvim', 'https://github.com/wbthomason/packer.nvim')
_G.zander = {}
_G.zander.first_launch = bootstrap('packer.nvim', 'https://github.com/wbthomason/packer.nvim')
bootstrap('tangerine.nvim', 'https://github.com/udayvir-singh/tangerine.nvim')
require('tangerine').setup({