diff options
| author | Robert Günzler <r@gnzler.io> | 2021-12-07 13:51:29 +0100 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2021-12-07 14:00:26 +0100 |
| commit | a29490ae2611f59cb17c118d92ebb136e966d88a (patch) | |
| tree | a34dfb80547e768b09aab886884799b25ce65ba6 /.vim/lua/plugins.lua | |
| parent | 88997bc23d4b854423cc532eb1de6a9bd1faa023 (diff) | |
vim: move packer location to local data dir
Diffstat (limited to '.vim/lua/plugins.lua')
| -rw-r--r-- | .vim/lua/plugins.lua | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/.vim/lua/plugins.lua b/.vim/lua/plugins.lua index 07a431b..824cfb4 100644 --- a/.vim/lua/plugins.lua +++ b/.vim/lua/plugins.lua @@ -5,9 +5,10 @@ local g = vim.g -- force packer into a system directory -local sysdata = vim.fn.stdpath('data_dirs')[1] +-- local datadir = vim.fn.stdpath('data_dirs')[1] +local datadir = vim.fn.stdpath('data') -local install_path = sysdata .. '/site/pack/packer/start/packer.nvim' +local install_path = require('packer.util').join_paths(datadir, '/site/pack/packer/start/packer.nvim') if vim.fn.empty(vim.fn.glob(install_path)) > 0 then vim.fn.system({ 'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path }) vim.api.nvim_command 'packadd packer.nvim' @@ -38,6 +39,9 @@ local function disable_distribution_plugins() -- {{{ g.loaded_netrwFileHandlers = 1 end -- }}} +-- we change the packer.compile_path below, so we need to require it here... +require('packer_compiled') + return require('packer').startup({function() -- disable built-in plugins disable_distribution_plugins() @@ -744,5 +748,11 @@ return require('packer').startup({function() end, config = { - package_root = require('packer.util').join_paths(sysdata, 'site', 'pack'), + package_root = require('packer.util').join_paths(datadir, 'site/pack'), + compile_path = require('packer.util').join_paths(vim.fn.stdpath('config'), 'lua/packer_compiled.lua'), + git = { + subcommands = { + update = 'pull --ff-only --progress --rebase=true', + } + } }}) |