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
Need Feedback for using starter template config for v2.5( Freedom from custom config ) #2706
Comments
I'm excited to try it. The only challenging part seems to be the updating process, but if you can create a custom command for it, it would be amazing. Thank you, Sid for your amazing work. 😊 |
That's hard and maybe impossible for now. |
I personally think that the current system is fine, as I think that plugin and ftplugin can be written around with vim.g for plugin and filetype specific plugins loading with their own custom mapping, If I didnt already have my own config I would be 100% down for this change, I am just being lazy. Then again I dont know much about the merits of ftplugin and plugin, so it is possible that there is a use to those directories that I do not know. I was going to say that this loses its plugin and play, but I read more and I think that while this problem is solved it seems to cause another problem(unless I am wrong again) in that it requires you to fork it to really have your own config, and then you have to deal with updating. Ideally you would support both configs somehow but that is too much work I believe. Overall though I think that this is going to be a net positive change, once the kinks are worked out(if any). |
This gave me more flexibility to customize NvChad and maybe I can use the custom config I built myself and just install the NvChad as a plugin 😅 |
kinda sketchy for newbies. Users should just use what a normal config uses for ftplugin etc and not go for such overriding qwirks for that custom config abstraction |
I dont think so @ARBoyGo . Just clone the starter repo and then but i think we can make a script for this? @Alexis12119 |
Yes. The current state of NvChad configs in v2 isn't very good. They aren't beginner-friendly. This would make it easier to use NvChad as now you can use the same old Nvim config rather than this maze we have in v2. I think y'all could take it even a step forward and make the plugins not depend on each other so much, to be able to use the NvChad status bar and whatever other GUI plugins. I think it would require custom color schemes to be implemented and not the current base46 system, but that's just a thought, |
UI plugin is dependent on base46. Both can be used if |
So, would v3.0 be sunsetted as v2.5 did all the things that v3.0 promised? |
@KorigamiK v2.5 isnt a big release as it doesnt have much features. v3.0 will be a big one (Although most changes will come from ui/base46 ) |
One little glitch I found is loading order. When mapping is loaded, LSP related mapping is not loaded. So if I want to delete LSP mapping it will result a no mapping found error. |
@moooooo16 thats just for buffer local mappings so lsp / gitsigns mappings are loaded on attached buffers only. So to delete or override those mappings u gotta make a wrapper on_attach func which loads default onattach + your mapping code |
@siduck That worked, thanks! Also I really wanna say this entire thing is awesome! |
Already use v2.5, quite nice. One minor question(maybe unrelated with starter template), say that if I want to disable clangd LSP server autostart, I can config it in lua/config/lspconfig.lua: lspconfig.clangd.setup {
autostart = false,
-- ......
} But lua-lsp-server is already confined in NvChad plugin, if I want to do the same thing as clangd, I have to override the config, is this the only way? |
@LimingFang you'll have to override the config, yes. lspconfig will use yours one |
I have C-c set to ":wq!" (also for insert and visual modes) in lua/mappings.lua, but it still copies instead of saving and exiting |
show me your code, it works fine here -_- simplescreenrecorder-2024-04-05_07.55.18.mp4 |
i just did migrate.sh, nothing else. this is the entire mappings.lua require "nvchad.mappings"
---@type MappingsTable
local M = {}
M.general = {
n = {
[";"] = { ":", "enter command mode", opts = { nowait = true } },
["<C-c>"] = { ":wq!<cr>" },
["<C-s>"] = { ":w!<cr>" },
["j"] = { "gj" },
["k"] = { "gk" },
["<2-LeftMouse>"] = { "<LeftMouse>" },
["<LeftMouse>"] = { "<Nop>" },
},
v = {
[">"] = { ">gv", "indent" },
["<C-c>"] = { "<ESC>:wq!<cr>" },
["<C-s>"] = { "<ESC>:w!<cr>" },
["<2-LeftMouse>"] = { "<LeftMouse>" },
["<LeftMouse>"] = { "<Nop>" },
},
i = {
["<C-c>"] = { "<ESC>:wq!<cr>" },
["<C-s>"] = { "<ESC>:w!<cr>" },
["<2-LeftMouse>"] = { "<LeftMouse>" },
["<LeftMouse>"] = { "<Nop>" },
},
}
-- more keybinds!
return M |
@treeshateorcs u should know that the old mapping stuff is removed, in v2.5 your mapping syntax can be anything, so just loop over your table and use vim.keymap.set , and pls remove return M too in nvchad v2.5 it has config structure to that of general nvim configs so no custom config abstractions, now y'all will actually learn how neovim configs work, and please read all of nvchad.com too |
okay, will do. thank you! |
Hi, i have a question about how to override plugin configs. Take "nvim-cmp" as an example. In nvchad plugin nvchad/configs/cmp.lua, it configs nvim-cmp's completion source like this: sources = {
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "nvim_lua" },
{ name = "path" },
}, And in nvchad/plugins/init.lua, it loads like this: {
-- .....
opts = function()
return require "nvchad.configs.cmp"
end,
config = function(_, opts)
require("cmp").setup(opts)
end,
} If i only want nvim_lsp as cmp source, i try to define configs/cmp.lua in my lua configs: local options = require("niched.configs.cmp")
options.source = {
{ name = "nvim_lsp" },
}
return options And in plugins/init.lua: {
"hrsh7th/nvim-cmp",
opts = function()
require "configs.cmp"
end,
config = function(_, opts)
require("cmp").setup(opts)
end,
}, But it doesn't work?🤔 |
@siduck Thanks for pointing out! I corrected the typo and changed the |
i'll test this tomorrow, how are u verifying if it works? cmpstatus command? @LimingFang also seek help in our discord server! ( check nvchad.com footer for link ) , we shouldnt be discussing in this thread lol |
@siduck one last replay! Finally it worked |
Hi guys, Configs like lazyvim, astrovim4 have this starter config in which you import their main repos itself as plugins and use it as your config. https://github.com/LazyVim/starter
I like the idea, with this change you will be able to track your configs 100% in git and actually have a config that adheres to standard nvim config structure rather than abstracted custom config stuff.
Also Currently dirs like
after, syntax, ftplugin
etc which are outside of custom dir git-ignored. So you can only track custom config which is bad for users who use those dirs which are outside of custom dir i.e/after ftplugin etc
So what do you think of having a starter config, in which you can just import modules from nvchad repo and use nvchad repo as plugin so you can just import its mappings/options/plugins etc
This change removes the custom config abstraction too btw. Take a look at how simple is this :
Check these repos for actual configs.
https://github.com/NvChad/NvChad/tree/test
https://github.com/siduck/dotfiles/tree/master/nv3 ( My custom config migrated using starter template )
Pros
after ftplugin syntax
etcCons
tcd
to cd in the nvim src code.I think a script could be made to automate the migration! 🤔 https://gist.github.com/siduck/048bed2e7570569e6b327b35d1715404
simplescreenrecorder-2024-03-07_19.14.05.mp4
If you like this, then give 👍 or 👎
The text was updated successfully, but these errors were encountered: