junegunn / vim-plug

:hibiscus: Minimalist Vim Plugin Manager
https://junegunn.github.io/vim-plug/
MIT License
33.7k stars 1.9k forks source link

"Error detected while processing", '=' expected near 'plug' #1241

Closed VenroyDEV closed 4 months ago

VenroyDEV commented 1 year ago

Explain the problem here ...

"Error detected while processing /home/vnr/.config/nvim/init.lua: E5112: Error while creating lua chunk: /home/vnr/.config/nvim/init.lua:1: '=' expected near 'plug' Press ENTER or type command to continue "


call plug#begin('~/.local/share/nvim/site/autoload/plugged')

Plug 'manzeloth/live-server'

call plug#end()

require "core"

local custom_init_path = vim.api.nvim_get_runtime_file("lua/custom/init.lua", false)[1]

if custom_init_path then
  dofile(custom_init_path)
end

require("core.utils").load_mappings()

local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"

-- bootstrap lazy.nvim!
if not vim.loop.fs_stat(lazypath) then
  require("core.bootstrap").gen_chadrc_template()
  require("core.bootstrap").lazy(lazypath)
end

dofile(vim.g.base46_cache .. "defaults")
vim.opt.rtp:prepend(lazypath)
require "plugins"
:version                                                                                            
NVIM v0.9.0
Build type: Release
LuaJIT 2.1.0-beta3

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"
Sebbito commented 1 year ago

I get the same problem and it seems like a syntax issue since lua doesn't have a builtin called call and thinks that it is a variable (i believe).

It seems like there just is no support for lua configuration files. Guess I'll have to use packer

robertr1229 commented 1 year ago

You're using an lua file for nvim per the install guide the file should be init.vim

junegunn commented 4 months ago

https://github.com/junegunn/vim-plug?tab=readme-ov-file#example-lua-configuration-for-neovim