I was switching vimscript to lua in neovim, and I saw packer.nvim is a famous plugin manager for lua. In this README.md file I saw I can use startup function, but it's not required and I can also use packer.use.

So I required my plugin file in init.lua

and then this is the plugins.lua

local packer = require('packer')
packer.init {
    disable_commands = true
local use = packer.use

use {

after that when I run nvim it is not allowing to use PackerSync

but when I remove disable commands from packer.init, it works fine(if i don't remove packer.init())

but when I remove the function packer.init(), it is not allowing me to use PackerSync

my question is in this below link,wbthomason also used disable_commands = true, and also lvim also used disable_commands, how can it be worked fine?


  • A totally unwelcome advice: do not switch to Lua unless you either know Lua well already or really want to learn it. Otherwise, it's just a waste of the time.
    – Matt
    Oct 8, 2021 at 8:04
  • sorry I didn't knew lua that much. but i heard lua faster than vimscript, that's why i switched to this. any suggestion to learn lua?
    – rafid100
    Oct 10, 2021 at 13:01
  • Language X cannot be faster than language Y, because languages do not run. What Lua has is JIT/VM. But your script won't be able to get anything from it.
    – Matt
    Oct 10, 2021 at 14:07
  • Welcome to Vi and Vim!
    – D. Ben Knoble
    Oct 11, 2021 at 18:51

1 Answer 1


disable_commands = true was disabling PackerInstall, PackerSync, etc., but not the plugin, so I switched to using packer.sync() inside plugins.lua, and it worked fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.