Git Product home page Git Product logo

Comments (81)

pocco81 avatar pocco81 commented on May 21, 2024 3

I'd suggest having a centralized config file with a global var to take vals from, like so:

nvchad_globals.lua

local globs = {}


globs.indentation = 4
globs.statusline = "galaxyline"
globs.wrap_lines = false
globs.treesitter.ensure_installed = "all"
-- and the rest....

return globs

and then call them where and when needed:

some_config_file.lua

if (require("path.to.nvchad_globals")["statusline"] == "galaxyline") then
    require("galaxyline")
else
    print("NVChad: Unsupported statusline. Sorry...")
end

Furthermore, @ceylog , I personally don't think it's the best idea to have nvchad as your config and then pulling from the repo to "update it". For example: if in nvchad @siduck76 decides to set the indentation to 4 but you have it set to 2 in your local config then there will be a conflict. This is not a program but an awesome config, which means that the settings are relative to the users' needs.

A "workflow" that makes more sense is to fork the repo and set this repo as an "upstream" while you modify the config in your fork's main branch (or any other) and then when ground-breaking changes are done here (e.g. adding support for an LSP) you could fetch from upstream into a local branch and then cherry-pick what you need.

But again, that's my opinion...

from nvchad.

javacafe01 avatar javacafe01 commented on May 21, 2024 3

or we can go all out like spacevim 😆

from nvchad.

pocco81 avatar pocco81 commented on May 21, 2024 2

I have achieved this in my personal config. It's still a work in progress because yesterday I switched to NvChad for convenience, so not everything is within that file, yet...

from nvchad.

siduck avatar siduck commented on May 21, 2024 2

@G-Rowell thanks for your work! I'll think about adding global option after 1.0v release so keep it on hold for a while :v

from nvchad.

Akianonymus avatar Akianonymus commented on May 21, 2024 2

Commenting here too for reference ( same comment in pr 168 )

How about adding a custom.sample.lua to repo, not custom.lua

But, we will originally use custom.lua only. A check will be added if custom.lua is present for error handling

custom.sample.lua will contain all the configuration which are change able without breaking with core nvchad setup.

By all configuration, i mean vim options( enable dashboard or not ), mappings, etc

The sample custom config will contain the values which are set in nvchad by default.

So, even if user renames custom.sample.lua to custom.lua, should get default configs and then they can start messing with it .

from nvchad.

siduck avatar siduck commented on May 21, 2024 2

Commenting here too for reference ( sample comment in pr 168 )

How about adding a custom.sample.lua to repo, not custom.lua

But, we will originally use custom.lua only. A check will be added if custom.lua is present for error handling

custom.sample.lua will contain all the configuration which are change able without breaking with core nvchad setup.

By all configuration, i mean vim options( enable dashboard or not ), mappings, etc

The sample custom config will contain the values which are set in nvchad by default.

So, even if user renames custom.sample.lua to custom.lua, should get default configs and then they can start messing with it .

sounds cool! NvChad will be kinda initially complete after 1.0v so we'll add the custom.lua after it!

from nvchad.

Anonysus69 avatar Anonysus69 commented on May 21, 2024 2

Shouldn't this be closed.user config is implemented and we can update.pocco is working on something to update.but we can do updates now using git pull and nvim +Packersync

from nvchad.

siduck avatar siduck commented on May 21, 2024 2

Shouldn't this be closed.user config is implemented and we can update.pocco is working on something to update.but we can do updates now using git pull and nvim +Packersync

yes I'll close this when the update command is added to new docs ( site ) , Aki is working on a updater.lua so gotta wait

from nvchad.

siduck avatar siduck commented on May 21, 2024 1

@ceylog Im still learning neovim and lua so it'll take some time , For now just check every commit I make. adding changes manually wouldnt be that hard.

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024 1

That is what I was trying to say.

from nvchad.

siduck avatar siduck commented on May 21, 2024 1

I'd suggest having a centralized config file with a global var to take vals from, like so:

nvchad_globals.lua

local globs = {}


globs.indentation = 4
globs.statusline = "galaxyline"
globs.wrap_lines = false
globs.treesitter.ensure_installed = "all"
-- and the rest....

return globs

and then call them where and when needed:

some_config_file.lua

if (require("path.to.nvchad_globals")["statusline"] == "galaxyline") then
    require("galaxyline")
else
    print("NVChad: Unsupported statusline. Sorry...")
end

Furthermore, @ceylog , I personally don't think it's the best idea to have nvchad as your config and then pulling from the repo to "update it". For example: if in nvchad @siduck76 decides to set the indentation to 4 but you have it set to 2 in your local config then there will be a conflict. This is not a program but an awesome config, which means that the settings are relative to the users' needs.

A "workflow" that makes more sense is to fork the repo and set this repo as an "upstream" while you modify the config in your fork's main branch (or any other) and then when ground-breaking changes are done here (e.g. adding support for an LSP) you could fetch from upstream into a local branch and then cherry-pick what you need.

But again, that's my opinion...

this might make the config more complex and bloated , for now I think updating NvChad via commits would be right until it gets stable.

from nvchad.

siduck avatar siduck commented on May 21, 2024 1

I never wanted to have a global config.lua for nvchad , thought it added unneeded complexity and bloat but seeing your config gives me some hope :D

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024

what do you mean by custom configuration options.

from nvchad.

isquack avatar isquack commented on May 21, 2024

Whaddaya mean.
There is more than a dozen config files for customizing it and it's well organized.
You should probably edit those files rather than creating your own.
You have the option to source your config files if you created separate ones.

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024

Ok will work on that.

from nvchad.

ceylog avatar ceylog commented on May 21, 2024

@ceylog Im still learning neovim and lua so it'll take some time , For now just check every commit I make. adding changes manually wouldnt be that hard.

Great.😄

from nvchad.

Vanderscycle avatar Vanderscycle commented on May 21, 2024

I do understand @ceylog issue, I am running an older version of the repo that I modified to my liking. I noticed that packer transforms all .lua files into a folder/lua.lua which makes the usage of rsync impossible.

A potential solution, although not pretty, is separating all .lua files in the folder/lua.lua as it was a few months ago.

Of note, when I am creating a pr I fork the most up-to-date state of hte repo.

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024

@pocco81 that is a really great idea to make a branch and all. but I ain't the owner man.

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024

@pocco81 if you would like to add that checkout my fork here. And maybe create a Pull Request ;)

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024

Is this still an issue as @siduck76 made his statement

from nvchad.

siduck avatar siduck commented on May 21, 2024

@ashincoder yes , I'll think about this till next month. I'll see what I can do something while still letting NvChad bloat free and suckless.

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024

@ceylog I have made global config support in StarVim

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024

@pocco81 is this what you meant here StarVim

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024

Why isn't anyone replying to this issue. @siduck76 you can check StarVim here and see what I have implemented to setup a global config

from nvchad.

siduck avatar siduck commented on May 21, 2024

Why isn't anyone replying to this issue. @siduck76 you can check StarVim here and see what I have implemented to setup a global config

Cuz this thing feels complex :c

from nvchad.

siduck avatar siduck commented on May 21, 2024

idk if adding it will make the config bloated xd

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024

What do you mean by bloated 🤔

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024

bloated means overfill and extended.

from nvchad.

siduck avatar siduck commented on May 21, 2024

i saw starvim's config.lua , it looked too long so got scared

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024

Long does'nt mean scary does it. You just have read through all the things then you will understand. StarVim should get a star 😄

from nvchad.

siduck avatar siduck commented on May 21, 2024

Long does'nt mean scary does it. You just have read through all the things then you will understand. StarVim should get a star

if you showed an easy way for global config then I'd consider having it! config looks much cleaner without it tho ngl

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024

I don't think there is a easy way. You have to describe every option to global so that the user can change according to his taste.

from nvchad.

siduck avatar siduck commented on May 21, 2024

I don't think there is a easy way. You have to describe every option to global so that the user can change according to his taste.

what files are related to config.lua?

I think adding these 60~ lines could be nice , the rest lang stuff isnt needed

https://github.com/ashincoder/StarVim/blob/dev/lua/config.lua#L60

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024

They are for changing the formatter. I will remove the linter cause they don't do anythin as I have tested

from nvchad.

siduck avatar siduck commented on May 21, 2024

They are for changing the formatter. I will remove the linter cause they don't do anythin as I have tested

ohh so the global config is only config.lua? i thought we need to define more stuff in other files

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024

For the user config sv-config.lua file is there

from nvchad.

Vanderscycle avatar Vanderscycle commented on May 21, 2024

I have achieved this in my personal config. It's still a work in progress because yesterday I switched to NvChad for convenience, so not everything is within that file, yet...

Ohhh, That's a good idea

from nvchad.

siduck avatar siduck commented on May 21, 2024

I have achieved this in my personal config. It's still a work in progress because yesterday I switched to NvChad for convenience, so not everything is within that file, yet...

dang thats a lot :l

from nvchad.

pocco81 avatar pocco81 commented on May 21, 2024

I mean, you don't need to have all of that. I personally like to have my stuff centralized, but if you wanted to you could just have a centralized config for autocommands, highlights, mappings and abbreviations, which are things most users would like to configure themselves. In here and here you'll find the modules that do that in my config.

from nvchad.

pocco81 avatar pocco81 commented on May 21, 2024

dang thats a lot :l

It's the same as what you'd normally have in nvchad, but in just one place, for convenience :]

from nvchad.

siduck avatar siduck commented on May 21, 2024

centralizing highlights would be a huge pain , NvChad already has such stuff in highlights.lua .

from nvchad.

Akianonymus avatar Akianonymus commented on May 21, 2024

@siduck76 Theming in general is a pain in nvchad, first all it should be imported as a colorscheme that neovim recognises.

from nvchad.

0xGodspeed avatar 0xGodspeed commented on May 21, 2024

I also agree there should be a separate file for user configs. It makes easier to update NvChad for those who fork it. If changes are made to the other config files there are conflicts during updates. It's not that manually updating from the commits is a lot of work but I guess it would just be more convenient to have something like that.

from nvchad.

siduck avatar siduck commented on May 21, 2024

@siduck76 Theming in general is a pain in nvchad, first all it should be imported as a colorscheme that neovim recognises.

I have thought about it but won't implement it , also nvchad already has 4 chad themes. Tools a lot of time to make em . Since their original themes don't look that good I had to change many colors for syntax highlighting and 26~ colors for rest of the highlights. If I added the highlight stuff in theme base16 theme plugin itself then it gets hard for the user to write his own highlights so better add the user highlights and those user highlights shall get commented in the theme plugin like vertsplit highlight etc so stuff won't highlight twice.

from nvchad.

Akianonymus avatar Akianonymus commented on May 21, 2024

@siduck76 Theming in general is a pain in nvchad, first all it should be imported as a colorscheme that neovim recognises.

I have thought about it but won't implement it , also nvchad already has 4 chad themes. Tools a lot of time to make em . Since their original themes don't look that good I had to change many colors for syntax highlighting and 26~ colors for rest of the highlights. If I added the highlight stuff in theme base16 theme plugin itself then it gets hard for the user to write his own highlights so better add the user highlights and those user highlights shall get commented in the theme plugin like vertsplit highlight etc so stuff won't highlight twice.

I don't understand, how are these reasons relavant to making a colorscheme recognised by nvim ? 🤔

from nvchad.

siduck avatar siduck commented on May 21, 2024

Doesn't nvim recognize base16 plugin?

from nvchad.

Akianonymus avatar Akianonymus commented on May 21, 2024

Doesn't nvim recognize base16 plugin?

Try :Telescope colorscheme

That's what i was talking about

from nvchad.

siduck avatar siduck commented on May 21, 2024

Doesn't nvim recognize base16 plugin?

Try :Telescope colorscheme

That's what i was talking about

Ohh that stuff , why not make the theme switcher with telescope? Like letting it execute certain stuffs for changing nvchad bsse16 and nvchad global theme

from nvchad.

Akianonymus avatar Akianonymus commented on May 21, 2024

Doesn't nvim recognize base16 plugin?

Try :Telescope colorscheme
That's what i was talking about

Ohh that stuff , why not make the theme switcher with telescope? Like letting it execute certain stuffs for changing nvchad bsse16 and nvchad global theme

Ohh, you mean a custom implementation which will show just our themes

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024

Will that be that easy. You may have to write a function to implement it

from nvchad.

siduck avatar siduck commented on May 21, 2024

Will that be that easy. You may have to write a function to implement it

PR's are welcome :D

from nvchad.

siduck avatar siduck commented on May 21, 2024

Im noob with telescope so it'd be hard for me at the moment xd

from nvchad.

siduck avatar siduck commented on May 21, 2024

also the telescope window should have all 4 nvchad themes

selecting a theme and pressing enter on it should execute :

  • change vim.g.nvchad_theme first
  • require the highlights.lua file

from nvchad.

Akianonymus avatar Akianonymus commented on May 21, 2024

also the telescope window should have all 4 nvchad themes

selecting a theme and pressing enter on it should execute :

  • change vim.g.nvchad_theme first
  • require the highlights.lua file

requiring the highlights won't be enough, you have to reload bufferline and statusline before too

from nvchad.

siduck avatar siduck commented on May 21, 2024

also the telescope window should have all 4 nvchad themes
selecting a theme and pressing enter on it should execute :

  • change vim.g.nvchad_theme first
  • require the highlights.lua file

requiring the highlights won't be enough, you have to reload bufferline and statusline before too

oh shit yes and even webdevicons too

from nvchad.

Akianonymus avatar Akianonymus commented on May 21, 2024

also the telescope window should have all 4 nvchad themes
selecting a theme and pressing enter on it should execute :

  • change vim.g.nvchad_theme first
  • require the highlights.lua file

requiring the highlights won't be enough, you have to reload bufferline and statusline before too

oh shit yes and even webdevicons too

or source $MYVIMRC

probably will work

from nvchad.

G-Rowell avatar G-Rowell commented on May 21, 2024

I mean,
a fair few neovim & plugin settings can be overwritten by a user config file?

Eg:
Normal NvChad setup & config structure
THE LAST thing that is done is source custom.lua (require custom.setup())
custom.lua is an NvChad provided file in which config is overridden to the users preferred

Eg:
NvChad sets tabs to 4 spaces,
NvChad sources the custom.lua - setup(),
custom.lua - setup() sets tabs to 2 spaces

from nvchad.

G-Rowell avatar G-Rowell commented on May 21, 2024

I don't know if this approach is perfect, but it could well work,
as it keeps all the NvChad settings,

and the user only has in their config file their preferences (only have to include specific settings they want to change?)

from nvchad.

G-Rowell avatar G-Rowell commented on May 21, 2024

Very easy to implement:
make custom.lua, give it the boilerplate lua format & some comments,
add custom.lua to .gitignore,
add the call to custom.lua - config() in init.lua
commit.

Means that this custom.lua stays in the repo, but the gitignore means it's touched by git when contributors work on pull requests? (so keeps users in NvChad, while keeping their own configs)

from nvchad.

G-Rowell avatar G-Rowell commented on May 21, 2024

Implemented a working prototype:

#168

Hopefully I'm not being too naive with this?
This also doesn't extend towards custom colour configs, not sure how that would interact with my PR

from nvchad.

G-Rowell avatar G-Rowell commented on May 21, 2024

Could also have a branch to test this functionality,
so that it can plug right into 1.0v?

It could be a way to ease some load off of @siduck76, have two people be responsible for the branch/custom config,
then before merge to main have siduck check off?

Dunno, either way I'm chill

from nvchad.

siduck avatar siduck commented on May 21, 2024

Could also have a branch to test this functionality,
so that it can plug right into 1.0v?

It could be a way to ease some load off of @siduck76, have two people be responsible for the branch/custom config,
then before merge to main have siduck check off?

Dunno, either way I'm chill

yeah sounds good! Im going to release 1.0v at this month's ending so gotta wait! you can create a theme switcher in the meantime , next month I'll add a a different branch for the global config stuff :)

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024

So who are you going to assign that branch to

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024

Next month :0 ! I mean @G-Rowell idea was goood :)

from nvchad.

G-Rowell avatar G-Rowell commented on May 21, 2024

Next month :0 ! I mean @G-Rowell idea was goood :)

Freaking zoomers with no patience 😝

from nvchad.

siduck avatar siduck commented on May 21, 2024

Next month :0 ! I mean @G-Rowell idea was goood :)

yeah I have college these days so such huge changes like global config would need some tinkering! so next month lul .

from nvchad.

siduck avatar siduck commented on May 21, 2024

So who are you going to assign that branch to

Didnt think about assigning for now , anyone can add PR for global config in that different branch

from nvchad.

siduck avatar siduck commented on May 21, 2024

@Akianonymus join the gitter community master!

from nvchad.

Akianonymus avatar Akianonymus commented on May 21, 2024

@Akianonymus join the gitter community master!

Ooh, we have gitter community, will join

( just saw in readme )

from nvchad.

JustSage avatar JustSage commented on May 21, 2024

There's an issue with vim.g.theme being recognized in icons.lua ...
It works in highlights.lua , but returns nil in icons.lua .. a very odd behavior :/

from nvchad.

siduck avatar siduck commented on May 21, 2024

There's an issue with vim.g.theme being recognized in icons.lua ...
It works in highlights.lua , but returns nil in icons.lua .. a very odd behavior :/

Use latest nvchad

from nvchad.

pocco81 avatar pocco81 commented on May 21, 2024

So I've achieved full config capacity from one single file and also better modularization (structured like one unix systems boot), better lsp conf, better utils, etc... but that is not relevant to this issue in my personal fork. Take a look:

demo.mp4

Unfortunately my personal fork is very very different from nvchad, and because of that I can't PR this. I'm just posting this here in case somebody wanted to kind of know how a system structured like such would work. And also, @siduck76, in case you were wondering, it doesn't affect my startup time:

image

from nvchad.

siduck avatar siduck commented on May 21, 2024

I think we can soon implement this after 1.0v or before 1.0 itself xD.

but one thing Im sure , I wont add highlights and theme color tables in the global config at all!

from nvchad.

siduck avatar siduck commented on May 21, 2024

also stuffs like this wont be added :

image

since they're not present in nvchad's config itself xD. would be nice not to add each and every nvim's default options

from nvchad.

pocco81 avatar pocco81 commented on May 21, 2024

As I said, this is my personal config so that's why I have so many settings and stuff (which (if I'm not wrong) are not the defaults).

Also, there are some things like, for instance, autocommands that depend on plugins that should not be in the main config file but in the plugins' conf (for obvious reasons)

With that said, I'd be more than happy to help in the development of this feature :)

from nvchad.

siduck avatar siduck commented on May 21, 2024

As I said, this is my personal config so that's why I have so many settings and stuff (which (if I'm not wrong) are not the defaults).

Also, there are some things like, for instance, autocommands that depend on plugins that should not be in the main config file but in the plugins' conf (for obvious reasons)

With that said, I'd be more than happy to help in the development of this feature :)

yeah cool :)

from nvchad.

siduck avatar siduck commented on May 21, 2024

@ceylog 0efa21c

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024

@siduck76 do u think on adding orgmode.nvim

from nvchad.

siduck avatar siduck commented on May 21, 2024

@siduck76 do u think on adding orgmode.nvim

yes in 2.0v

from nvchad.

ashincoder avatar ashincoder commented on May 21, 2024

ok

from nvchad.

siduck avatar siduck commented on May 21, 2024

https://nvchad.netlify.app/docs/getting%20started/setup/#update

from nvchad.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.