NvChad / NvChad

Blazing fast Neovim config providing solid defaults and a beautiful UI, enhancing your neovim experience.

Home Page:https://nvchad.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NVChad 2.5 custom: where to put custom stuff?

caneta opened this issue · comments

Hi, I've updated NVChad to 2.5 version, following the migration guide.

Everything works as before, but I'm completely lost in how to further customize my setup...what files am I suppose to modify in order to preserve but override the default config?

For instance, for "format on save" feature I've changed the configs/lspconfig.lua with the following

 for _, lsp in ipairs(servers) do
  lspconfig[lsp].setup {
    on_attach = function()
      vim.api.nvim_create_autocmd("BufWritePost", {
        callback = function()
          vim.lsp.buf.format()
        end,
      })
    end,
    capabilities = capabilities,
  }
end

But is that the right place to do it?

Thank you

@caneta nowhere!! ~/.config/nvim is your config now, you can put your stuff anywhere without worrying about custom config syntax :))

pls read https://nvchad.com/news/v2.5_release

It's because I've read that guide that is not clear to me...so my "format on save" configuration is it correct or not? How would you achieve that goal? Maybe I've my .config/nvim folder dirty because of previous NVChad 2.0 installation...

it looks wrong

vim.api.nvim_create_autocmd("BufWritePost", {
        callback = function()
          vim.lsp.buf.format()
        end,
      })
      ```
      
      ig u need just this

i'd use conform.nvim tho. check the starter repo

it is clear

I've used that snippet because you suggest it here. And it works: my point is where to put it...I'm gonna make a clean install otherwise with previous custom config on NVChad 2.0 config, it's a mess...

Thank you for your support!

@caneta if you're on unix then the migrate script should work for you 90% of the time , except for the mappings part

I'm on WSL, so basically Linux: indeed the migration script worked.