99< meta name ="keywords " content ="">
1010< meta name ="description " content ="
1111Part 1: Setting Up NVChad
12+
13+ Note: I am using Arch Linux. So, use terminal commands according to your Distro.
1214Step 1: Removing any previous configuration
1315
1416Linux/MacOS Users
@@ -218,6 +220,8 @@ <h1 class="post-title entry-hint-parent">
218220
219221 < div class ="post-content "> < hr >
220222< h2 id ="part-1-setting-up-nvchad "> Part 1: Setting Up NVChad< a hidden class ="anchor " aria-hidden ="true " href ="#part-1-setting-up-nvchad "> #</ a > </ h2 >
223+ < blockquote >
224+ < p > Note: I am using Arch Linux. So, use terminal commands according to your Distro.</ p > </ blockquote >
221225< h3 id ="step-1-removing-any-previous-configuration "> Step 1: Removing any previous configuration< a hidden class ="anchor " aria-hidden ="true " href ="#step-1-removing-any-previous-configuration "> #</ a > </ h3 >
222226< ol >
223227< li > Linux/MacOS Users</ li >
@@ -321,16 +325,25 @@ <h3 id="step-2-installing-nvchad">Step 2: Installing NVChad<a hidden class="anch
321325</ span > </ span > < span style ="display:flex; "> < span > { import < span style ="color:#f92672 "> =</ span > < span style ="color:#e6db74 "> "plugins"</ span > },
322326</ span > </ span > < span style ="display:flex; "> < span > }, lazy_config)
323327</ span > </ span > </ code > </ pre > </ div > < ol start ="2 ">
324- < li > For C/C++ development, ensure clangd is installed and configured:
328+ < li > Before moving further make sure that you have installed < code > npm</ code > server on your system. If not, then download it using:</ li >
329+ </ ol >
330+ < div class ="highlight "> < pre tabindex ="0 " style ="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4; "> < code class ="language-lua " data-lang ="lua "> < span style ="display:flex; "> < span > sudo pacman < span style ="color:#f92672 "> -</ span > S nodejs npm
331+ </ span > </ span > </ code > </ pre > </ div > < div class ="highlight "> < pre tabindex ="0 " style ="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4; "> < code class ="language-lua " data-lang ="lua "> < span style ="display:flex; "> < span > sudo npm install < span style ="color:#f92672 "> -</ span > g pyright
332+ </ span > </ span > </ code > </ pre > </ div > < ol start ="3 ">
333+ < li > For C/C++ and Python development, ensure clangd and pyright is installed and configured:
325334Add the following piece of code to init.lua after the ending of above mentioned code:</ li >
326335</ ol >
327336< div class ="highlight "> < pre tabindex ="0 " style ="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4; "> < code class ="language-lua " data-lang ="lua "> < span style ="display:flex; "> < span > < span style ="color:#75715e "> --clangd server setup</ span >
328337</ span > </ span > < span style ="display:flex; "> < span > < span style ="color:#66d9ef "> local</ span > lspconfig < span style ="color:#f92672 "> =</ span > require(< span style ="color:#e6db74 "> 'lspconfig'</ span > )
329- </ span > </ span > < span style ="display:flex; "> < span > lspconfig.clangd.setup({
338+ </ span > </ span > < span style ="display:flex; "> < span > lspconfig.clangd.setup({ < span style =" color:#75715e " > --For C/C++ </ span >
330339</ span > </ span > < span style ="display:flex; "> < span > cmd < span style ="color:#f92672 "> =</ span > { < span style ="color:#e6db74 "> "clangd"</ span > }, < span style ="color:#75715e "> -- Ensure this points to the system-installed clangd</ span >
331340</ span > </ span > < span style ="display:flex; "> < span > < span style ="color:#75715e "> -- Additional configuration options can be added here</ span >
332341</ span > </ span > < span style ="display:flex; "> < span > })
333- </ span > </ span > </ code > </ pre > </ div > < ol start ="3 ">
342+ </ span > </ span > < span style ="display:flex; "> < span > lspconfig.pyright.setup({ < span style ="color:#75715e "> --For Python</ span >
343+ </ span > </ span > < span style ="display:flex; "> < span > autoSearchPaths < span style ="color:#f92672 "> =</ span > < span style ="color:#66d9ef "> true</ span > ,
344+ </ span > </ span > < span style ="display:flex; "> < span > diagnosticMode < span style ="color:#f92672 "> =</ span > < span style ="color:#e6db74 "> "workplace"</ span > , < span style ="color:#75715e "> --you can also set it to "openFilesOnly" to check errors in only oepned files</ span >
345+ </ span > </ span > < span style ="display:flex; "> < span > })
346+ </ span > </ span > </ code > </ pre > </ div > < ol start ="4 ">
334347< li > < code > Edit lazy.lua</ code > file to enable plugins and comment the lines after disabled_plugins lines like mentioned below:</ li >
335348</ ol >
336349< blockquote >
@@ -368,13 +381,15 @@ <h3 id="step-2-installing-nvchad">Step 2: Installing NVChad<a hidden class="anch
368381</ span > </ span > < span style ="display:flex; "> < span > },
369382</ span > </ span > < span style ="display:flex; "> < span > },
370383</ span > </ span > < span style ="display:flex; "> < span > },
371- </ span > </ span > </ code > </ pre > </ div > < ol start ="4 ">
372- < li > Open nvim and install lsp for any language, I am doing for C/C++:</ li >
384+ </ span > </ span > </ code > </ pre > </ div > < ol start ="5 ">
385+ < li > Open nvim and install lsp for any language, I am doing for C/C++ and Python :</ li >
373386</ ol >
374387< div class ="highlight "> < pre tabindex ="0 " style ="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4; "> < code class ="language-python " data-lang ="python "> < span style ="display:flex; "> < span > :MasonInstall clangd
388+ </ span > </ span > < span style ="display:flex; "> < span > :MasonIntall python< span style ="color:#f92672 "> -</ span > lsp< span style ="color:#f92672 "> -</ span > server
389+ </ span > </ span > < span style ="display:flex; "> < span > :MasonInstall pyright
375390</ span > </ span > </ code > </ pre > </ div > < blockquote >
376391< p > In MasonInstall menu, Press U to update and arrow key to scroll and find your required lsp</ p > </ blockquote >
377- < ol start ="5 ">
392+ < ol start ="6 ">
378393< li > Update packages using:</ li >
379394</ ol >
380395< div class ="highlight "> < pre tabindex ="0 " style ="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4; "> < code class ="language-lua " data-lang ="lua "> < span style ="display:flex; "> < span > :Lazy update
@@ -423,6 +438,13 @@ <h3 id="step-2-save-into-your-zsh-or-bash-file">Step 2: Save into your zsh or ba
423438< p > Address: /home/username/.config/nvim/init.lua</ p > </ blockquote >
424439< p > Locate the following piece of code into init.lua file:</ p >
425440< div class ="highlight "> < pre tabindex ="0 " style ="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4; "> < code class ="language-lua " data-lang ="lua "> < span style ="display:flex; "> < span > {
441+ </ span > </ span > < span style ="display:flex; "> < span > < span style ="color:#e6db74 "> "NvChad/NvChad"</ span > ,
442+ </ span > </ span > < span style ="display:flex; "> < span > lazy < span style ="color:#f92672 "> =</ span > < span style ="color:#66d9ef "> false</ span > ,
443+ </ span > </ span > < span style ="display:flex; "> < span > branch < span style ="color:#f92672 "> =</ span > < span style ="color:#e6db74 "> "v2.5"</ span > ,
444+ </ span > </ span > < span style ="display:flex; "> < span > import < span style ="color:#f92672 "> =</ span > < span style ="color:#e6db74 "> "nvchad.plugins"</ span > ,
445+ </ span > </ span > < span style ="display:flex; "> < span > },
446+ </ span > </ span > </ code > </ pre > </ div > < p > Then, add the following beautiful text just after it:</ p >
447+ < div class ="highlight "> < pre tabindex ="0 " style ="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4; "> < code class ="language-lua " data-lang ="lua "> < span style ="display:flex; "> < span > {
426448</ span > </ span > < span style ="display:flex; "> < span > < span style ="color:#e6db74 "> "jackMort/ChatGPT.nvim"</ span > ,
427449</ span > </ span > < span style ="display:flex; "> < span > event < span style ="color:#f92672 "> =</ span > < span style ="color:#e6db74 "> "VeryLazy"</ span > ,
428450</ span > </ span > < span style ="display:flex; "> < span > dependencies < span style ="color:#f92672 "> =</ span > {
@@ -431,8 +453,7 @@ <h3 id="step-2-save-into-your-zsh-or-bash-file">Step 2: Save into your zsh or ba
431453</ span > </ span > < span style ="display:flex; "> < span > < span style ="color:#e6db74 "> "nvim-telescope/telescope.nvim"</ span > ,
432454</ span > </ span > < span style ="display:flex; "> < span > < span style ="color:#e6db74 "> "folke/trouble.nvim"</ span > ,
433455</ span > </ span > < span style ="display:flex; "> < span > },
434- </ span > </ span > </ code > </ pre > </ div > < p > Then, add the following beautiful text just after it:</ p >
435- < div class ="highlight "> < pre tabindex ="0 " style ="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4; "> < code class ="language-lua " data-lang ="lua "> < span style ="display:flex; "> < span > config < span style ="color:#f92672 "> =</ span > < span style ="color:#66d9ef "> function</ span > ()
456+ </ span > </ span > < span style ="display:flex; "> < span > config < span style ="color:#f92672 "> =</ span > < span style ="color:#66d9ef "> function</ span > ()
436457</ span > </ span > < span style ="display:flex; "> < span > require(< span style ="color:#e6db74 "> "chatgpt"</ span > ).setup({
437458</ span > </ span > < span style ="display:flex; "> < span > < span style ="color:#75715e "> -- Your ChatGPT.nvim configuration</ span >
438459</ span > </ span > < span style ="display:flex; "> < span > api_key_cmd < span style ="color:#f92672 "> =</ span > < span style ="color:#e6db74 "> "echo $OPENAI_API_KEY"</ span > ,
0 commit comments