Auto download packages on first launch
This commit is contained in:
parent
777b73b061
commit
4c6627deed
9
init.fnl
9
init.fnl
@ -509,6 +509,8 @@
|
|||||||
(use! :neovim/nvim-lspconfig
|
(use! :neovim/nvim-lspconfig
|
||||||
:after :cmp-nvim-lsp
|
:after :cmp-nvim-lsp
|
||||||
:config lsp_config_callback)
|
:config lsp_config_callback)
|
||||||
|
|
||||||
|
;; nvim-jdtls
|
||||||
(fn jdtls_config_callback []
|
(fn jdtls_config_callback []
|
||||||
(hook! :FileType :java
|
(hook! :FileType :java
|
||||||
#(let [root_dir ((. (require :jdtls.setup) :find_root)
|
#(let [root_dir ((. (require :jdtls.setup) :find_root)
|
||||||
@ -524,8 +526,11 @@
|
|||||||
:jdtls root_dir) ]}))))
|
:jdtls root_dir) ]}))))
|
||||||
(use! :mfussenegger/nvim-jdtls
|
(use! :mfussenegger/nvim-jdtls
|
||||||
:after :nvim-lspconfig
|
: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)]
|
(let [packer (require :packer)]
|
||||||
(packer.startup packer_init_callback))
|
(packer.startup packer_init_callback))
|
||||||
|
5
init.lua
5
init.lua
@ -3,10 +3,13 @@ local function bootstrap(pkg, repo)
|
|||||||
if vim.fn.isdirectory(plug_dir) ~= 1 then
|
if vim.fn.isdirectory(plug_dir) ~= 1 then
|
||||||
vim.fn.system({ 'git', 'clone', '--depth', '1', repo, plug_dir })
|
vim.fn.system({ 'git', 'clone', '--depth', '1', repo, plug_dir })
|
||||||
vim.cmd.packadd(pkg)
|
vim.cmd.packadd(pkg)
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
|
return false
|
||||||
end
|
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')
|
bootstrap('tangerine.nvim', 'https://github.com/udayvir-singh/tangerine.nvim')
|
||||||
require('tangerine').setup({
|
require('tangerine').setup({
|
||||||
|
Reference in New Issue
Block a user