Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System-wide nvchad for 2.5 #24

Closed
aleixq opened this issue May 9, 2024 · 12 comments
Closed

System-wide nvchad for 2.5 #24

aleixq opened this issue May 9, 2024 · 12 comments

Comments

@aleixq
Copy link

aleixq commented May 9, 2024

In previous 2.0 I could install nvchad systemwide. to benefit of shared initial configs, mappings... for many users. But I am having troubles with 2.5. Maybe I am lazy, but do you have any idea about how can I get it working again.

I get:

Error detected while processing /etc/xdg/nvim/sysinit.vim[2]../etc/xdg/nvim/NvChad_starter/init.lua:
Failed to run `config` for NvChad

/etc/xdg/nvim/NvChad_starter/init.lua:24: module 'options' not found:
^Ino field package.preload['options']
cache_loader: module options not found
cache_loader_lib: module options not found
^Ino file './options.lua'
^Ino file '/usr/share/luajit-2.1.0-beta3/options.lua'
^Ino file '/usr/local/share/lua/5.1/options.lua'
^Ino file '/usr/local/share/lua/5.1/options/init.lua'
^Ino file '/usr/share/lua/5.1/options.lua'
^Ino file '/usr/share/lua/5.1/options/init.lua'
^Ino file './options.so'
^Ino file '/usr/local/lib/lua/5.1/options.so'
^Ino file '/usr/lib/x86_64-linux-gnu/lua/5.1/options.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'

the tree of /etc/xdg/nvim is:

.
├── NvChad_starter
│   ├── LICENSE
│   ├── init.lua
│   └── lua
│       ├── README.md
│       ├── chadrc.lua
│       ├── configs
│       │   ├── conform.lua
│       │   ├── lazy.lua
│       │   ├── lspconfig.lua
│       │   ├── null-ls.lua
│       │   └── overrides.lua
│       ├── highlights.lua
│       ├── mappings.lua
│       ├── myinit.lua
│       ├── options.lua
│       └── plugins
│           ├── init.lua
│           └── myplugins.lua
├── README.md
└── sysinit.vim

sysinit.vim is:

set runtimepath+=/etc/xdg/nvim/NvChad_starter
source /etc/xdg/nvim/NvChad_starter/init.lua
@aleixq
Copy link
Author

aleixq commented May 9, 2024

Adding in lua/configs/lazy.lua:

  performance = {
    rtp = {
+      reset = false,
      disabled_plugins = {

is a workaround, but I see

Re-sourcing your config is not supported with lazy.nvim
Error detected while processing /etc/xdg/nvim/sysinit.vim[2]../etc/xdg/nvim/NvChad_starter/init.lua:
Invalid spec module: `plugins`
Expected a `table` of specs, but a `boolean` was returned instead

But it seems it works

@siduck
Copy link
Member

siduck commented May 9, 2024

no idea about this, do other nvim configs work?

@aleixq
Copy link
Author

aleixq commented May 10, 2024

Yes, By now everything works but some part(s?) of the theme, e.g. the toggle:

Error detected while processing function TbToggle_theme:                                                                                                                   
line    1:                                                                                                                                                                        
E5108: Error executing lua cannot open /root/.config/nvim/lua/chadrc.lua: No such file or directory                                                                               
stack traceback:                                                                                                                                                                  
        [C]: in function 'dofile'                                                                                                                                                 
        /root/.local/share/nvim/lazy/base46/lua/base46/init.lua:184: in function 'toggle_theme'                                                                                   
        [string ":lua"]:1: in main chunk                                                                                                                                          
Press ENTER or type command to continue

@siduck
Copy link
Member

siduck commented May 10, 2024

chadrc is a must for using nvchad

@aleixq
Copy link
Author

aleixq commented May 10, 2024

Yes,yes, I know it, and in fact is used /etc/xdg/nvim/NvChad_starter/lua/chadrc.lua , but it seems that settings are only read just the first time, as it lets me set the theme for example.
But afterward, /etc/xdg/nvim/NvChad_starter/lua/chadrc.lua is not used anymore. So I cannot change the theme, or use theme_toggle.

@aleixq
Copy link
Author

aleixq commented May 10, 2024

Just to note, that adding /root/.config/nvim/lua/chadrc.lua makes it working as it should. But it will be great to let define it system-wide and read the settings from /etc/xdg/nvim/NvChad_starter/lua/chadrc.lua . Maybe too adapted to my use case...

@siduck
Copy link
Member

siduck commented May 10, 2024

/etc/xdg/nvim/lua/chadrc.lua

that should be the real path, the starter repo is basically ~/.config/nvim i.e a nvim config

@aleixq
Copy link
Author

aleixq commented May 10, 2024

/etc/xdg/nvim/lua/chadrc.lua

that should be the real path, the starter repo is basically ~/.config/nvim i.e a nvim config

Despite this in /etc/xdg/nvim/sysinit.vim ? :

set runtimepath+=/etc/xdg/nvim/NvChad_starter
source /etc/xdg/nvim/NvChad_starter/init.lua

@siduck
Copy link
Member

siduck commented May 10, 2024

i honestly have no idea about this xdg stuff, you should ask in our discord server, someone might help!

@aleixq
Copy link
Author

aleixq commented May 10, 2024

It seems that some other people are having issues with lazy and global config:folke/lazy.nvim#636 . My last major issue was the python provider (I need this for plugin vdebug) that only runs ok the first time. So I think that the issue comes from lazy, and so is not in your field.

Anyway I've switched to nvim-dap and everything runs fine.

Thank's !

@aleixq aleixq closed this as completed May 10, 2024
@siduck
Copy link
Member

siduck commented May 11, 2024

for python provider check NvChad/NvChad#1417

@aleixq
Copy link
Author

aleixq commented May 11, 2024

for python provider check NvChad/NvChad#1417

These lines are there, and checkhealth shows everything fine. In fact, as said before, it works fine the first time that nvim is run (when no ~/.config/nvim ~/.cache/nvim or ~/.local/share/nvim exists yet).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants