diff options
| author | jdhao <jdhao@hotmail.com> | 2021-07-08 22:47:12 +0800 |
|---|---|---|
| committer | jdhao <jdhao@hotmail.com> | 2021-07-08 22:47:12 +0800 |
| commit | 3b25260be0a713ed260a33cc5d158a2da60afafb (patch) | |
| tree | 2f53c45e7be1658396927fbcacb4bfa3cd994392 /lua | |
| parent | c4c23cec83707867ef9dcb0dfde060cce2345bd0 (diff) | |
Update packer.nvim settings
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/plugins.lua | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/lua/plugins.lua b/lua/plugins.lua index 01947bf..25cccdb 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -1,14 +1,26 @@ -vim.cmd [[packadd packer.nvim]] local execute = vim.api.nvim_command local fn = vim.fn -local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' +local packer_install_dir = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' -if fn.empty(fn.glob(install_path)) > 0 then - fn.system({'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path}) - execute 'packadd packer.nvim' +local plug_url_format = '' +if vim.g.is_linux > 0 then + plug_url_format = 'https://hub.fastgit.org/%s' +else + plug_url_format = 'https://github.com/%s' end +local packer_repo = string.format(plug_url_format, 'wbthomason/packer.nvim') +local install_cmd = string.format('10split |term git clone --depth=1 %s %s', packer_repo, packer_install_dir) + +if fn.empty(fn.glob(packer_install_dir)) > 0 then + vim.api.nvim_echo({{'Installing packer.nvim', 'Type'}}, true, {}) + execute(install_cmd) + execute 'packadd packer.nvim' +end + +vim.cmd [[packadd packer.nvim]] + require('packer').startup( { function(use) @@ -81,10 +93,11 @@ require('packer').startup( use 'shaunsingh/nord.nvim' -- colorful status line and theme - use {'vim-airline/vim-airline', event = 'VimEnter'} + use {'vim-airline/vim-airline', event = 'VimEnter', after = 'vim-airline-themes'} use {'vim-airline/vim-airline-themes', event = 'VimEnter'} - use {'mhinz/vim-startify', event = 'VimEnter'} + -- fancy start screen + use {'mhinz/vim-startify', event = 'VimEnter'} use {'lukas-reineke/indent-blankline.nvim'} -- Highlight URLs inside vim @@ -265,5 +278,15 @@ require('packer').startup( end, config = { max_jobs = 16, + git = { + default_url_format = plug_url_format + } } }) + +vim.api.nvim_exec([[ + augroup packer_auto_compile + autocmd! + autocmd BufWritePost plugins.lua unsilent echomsg 'Packer.nvim settings recompiled!' | PackerCompile + augroup END +]], false) |
