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 | |
| parent | 88997bc23d4b854423cc532eb1de6a9bd1faa023 (diff) | |
vim: move packer location to local data dir
Diffstat (limited to '.vim')
| -rw-r--r-- | .vim/init.lua | 10 | ||||
| -rw-r--r-- | .vim/lua/plugins.lua | 16 |
2 files changed, 18 insertions, 8 deletions
diff --git a/.vim/init.lua b/.vim/init.lua index 80c260f..1c01c3a 100644 --- a/.vim/init.lua +++ b/.vim/init.lua @@ -5,10 +5,6 @@ local g = vim.g g.mapleader = ' ' -- <leader> key to <space> g.maplocalleader = '\\' -require('plugins') -require('hardmode') -require('globals') - -- OPTIONS -- {{{ local opt = vim.opt @@ -64,6 +60,10 @@ opt.undolevels = 1000 opt.updatetime = 200 opt.wrap = true +require('globals') +require('plugins') +require('hardmode') + -- configure :grep to use ripgrep if it's available if vim.fn.executable('rg') then vim.opt.grepprg = 'rg --vimgrep --smart-case --hidden' @@ -144,7 +144,7 @@ augroup { }, help_quit = { {'FileType', 'help', [[ nnoremap <buffer><silent> q <cmd>bdel<cr> ]]} - } + }, } -- }}} 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', + } + } }}) |