Having packer install auto

master
Dustin Swan 2 years ago
parent 3d5dd8d467
commit a2ffa8b3bc
Signed by: dustinswan
GPG Key ID: AB49BD6B2B3A6377

@ -17,6 +17,18 @@ vim.opt.cursorline = true
vim.api.nvim_create_autocmd("FileType", { pattern = { "org" }, command = "setlocal nowrap" }) vim.api.nvim_create_autocmd("FileType", { pattern = { "org" }, command = "setlocal nowrap" })
local ensure_packer = function()
local fn = vim.fn
local install_path = 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})
vim.cmd [[packadd packer.nvim]]
return true
end
return false
end
local packer_bootstrap = ensure_packer()
require('packer').startup(function(use) require('packer').startup(function(use)
use 'wbthomason/packer.nvim' use 'wbthomason/packer.nvim'
use 'tpope/vim-surround' use 'tpope/vim-surround'
@ -248,6 +260,10 @@ require('packer').startup(function(use)
require("trouble").setup() require("trouble").setup()
end end
} }
if packer_bootstrap then
require('packer').sync()
end
end) end)
local wk = require("which-key") local wk = require("which-key")

Loading…
Cancel
Save