init.lua icon indicating copy to clipboard operation
init.lua copied to clipboard

W112: mutating non-standard global variable 'vim'

Open MayukhSobo opened this issue 3 years ago • 3 comments

I am having problem. I am getting this error. If I have a file called init.lua in ~/.config/nvim/ and if I add few basic configs like

vim.g.mapleader = " "
vim.opt.nu = true
vim.opt.relativenumber = true
vim.opt.termguicolors = true

and so on...

I am not seeing the effect. Probably because of this warning. But this is a warning right? It should no affect anyway right? Moreover how to handle this warning?

Note: I am trying to gradually build the neovim configs.

MayukhSobo avatar Dec 20 '22 12:12 MayukhSobo

Give us more details, I try to reproduce but work for me. Whats version of neovim? rtp its equals Prime show?

daltondiaz avatar Dec 21 '22 00:12 daltondiaz

@daltondiaz If I do nvim --version I get the following

NVIM v0.8.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by [email protected]

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.8.1/share/nvim"

Run :checkhealth for more info

MayukhSobo avatar Dec 21 '22 05:12 MayukhSobo

@MayukhSobo I really don't know what happen with your environment. When I started to follow the video from scratch I remove all installations of vim/neovim because I have some errors. I'm using the same version of LuaJIT but the version of v0.9.0-dev from neovim

Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-IDfFpR/neovim-0.9.0~ubuntu1+git202212160020-ef9517469-333b5866f=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/build/neovim-IDfFpR/neovim-0.9.0~ubuntu1+git202212160020-ef9517469-333b5866f/build/cmake.config -I/build/neovim-IDfFpR/neovim-0.9.0~ubuntu1+git202212160020-ef9517469-333b5866f/src -I/build/neovim-IDfFpR/neovim-0.9.0~ubuntu1+git202212160020-ef9517469-333b5866f/.deps/usr/include -I/usr/include -I/build/neovim-IDfFpR/neovim-0.9.0~ubuntu1+git202212160020-ef9517469-333b5866f/build/src/nvim/auto -I/build/neovim-IDfFpR/neovim-0.9.0~ubuntu1+git202212160020-ef9517469-333b5866f/build/include
Compiled by buildd@lcy02-amd64-027

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

daltondiaz avatar Dec 23 '22 20:12 daltondiaz