From edd74337a9c851673da4a04bdc8c145d26c30a6b Mon Sep 17 00:00:00 2001 From: jdhao Date: Sat, 24 Jul 2021 12:45:54 +0800 Subject: [PATCH] Use vim.cmd instead of vim.api.nvim_exec --- lua/plugins.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lua/plugins.lua b/lua/plugins.lua index dafb5be..571a2fb 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -1,4 +1,3 @@ -local execute = vim.api.nvim_command local fn = vim.fn local packer_install_dir = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' @@ -16,8 +15,8 @@ local install_cmd = string.format('10split |term git clone --depth=1 %s %s', pac -- Auto-install packer in case it hasn't been installed. if fn.glob(packer_install_dir) == '' then vim.api.nvim_echo({{'Installing packer.nvim', 'Type'}}, true, {}) - execute(install_cmd) - execute 'packadd packer.nvim' + vim.cmd(install_cmd) + vim.cmd('packadd packer.nvim') end vim.cmd [[packadd packer.nvim]] @@ -284,9 +283,9 @@ require('packer').startup( } }) -vim.api.nvim_exec([[ +vim.cmd([[ augroup packer_auto_compile autocmd! autocmd BufWritePost */nvim/lua/plugins.lua source | PackerCompile augroup END -]], false) +]])