]> git.frustrated-labs.net Git - dotfiles.git/commitdiff
add lua lsp
authorAlexander Goussas <[email protected]>
Fri, 28 Feb 2025 04:02:43 +0000 (23:02 -0500)
committerAlexander Goussas <[email protected]>
Fri, 28 Feb 2025 04:02:43 +0000 (23:02 -0500)
nvim/.config/nvim/init.lua
nvim/.config/nvim/lazy-lock.json

index f044312e6d830ba1f582b8b311e6a34f118b586e..a4dd8befcfc3e92d3f904782786eb416d7bb60a1 100644 (file)
@@ -22,7 +22,7 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
   if vim.v.shell_error ~= 0 then
     vim.api.nvim_echo({
       { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
-      { out, "WarningMsg" },
+      { out,                            "WarningMsg" },
       { "\nPress any key to exit..." },
     }, true, {})
     vim.fn.getchar()
@@ -46,13 +46,13 @@ require("lazy").setup({
       "nbouscal/vim-stylish-haskell"
     },
     {
-      'nvim-telescope/telescope.nvim', 
+      'nvim-telescope/telescope.nvim',
       tag = '0.1.8',
       branch = '0.1.x',
-      dependencies = { 
+      dependencies = {
         'nvim-lua/plenary.nvim',
       },
-      config = function() 
+      config = function()
         local telescope = require('telescope')
         local builtin = require('telescope.builtin')
         vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
@@ -74,20 +74,20 @@ require("lazy").setup({
     {
       'lunacookies/vim-colors-xcode',
       config = function()
-        vim.cmd[[colorscheme xcodehc]]
+        vim.cmd [[colorscheme xcodehc]]
       end
     },
     {
       'yorickpeterse/nvim-grey',
       config = function()
-        vim.cmd[[colorscheme grey]]
+        vim.cmd [[colorscheme grey]]
       end
     },
     {
-      "miikanissi/modus-themes.nvim", 
+      "miikanissi/modus-themes.nvim",
       priority = 1000,
       config = function()
-        vim.cmd[[colorscheme modus_operandi]]
+        vim.cmd [[colorscheme modus_operandi]]
       end
     },
     {
@@ -100,7 +100,7 @@ require("lazy").setup({
         })
       end
     },
-    { 
+    {
       'lewis6991/gitsigns.nvim',
       config = function()
         require('gitsigns').setup({
@@ -131,6 +131,25 @@ require("lazy").setup({
 
         lspconfig.gleam.setup({})
 
+        lspconfig.sumneko_lua.setup({
+          settings = {
+            Lua = {
+              runtime = {
+                version = 'LuaJIT',
+              },
+              diagnostics = {
+                globals = { 'vim' },
+              },
+              workspace = {
+                library = vim.api.nvim_get_runtime_file("", true),
+              },
+              telemetry = {
+                enable = false,
+              },
+            },
+          },
+        })
+
         -- brew install rust-analyzer
         lspconfig.rust_analyzer.setup({})
 
@@ -148,7 +167,7 @@ require("lazy").setup({
               vim.api.nvim_create_autocmd('BufWritePre', {
                 buffer = args.buf,
                 callback = function()
-                  vim.lsp.buf.format({bufnr = args.buf, id = client.id})
+                  vim.lsp.buf.format({ bufnr = args.buf, id = client.id })
                 end,
               })
             end
@@ -158,10 +177,10 @@ require("lazy").setup({
             vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, { buffer = args.buf })
             vim.keymap.set('n', '<leader>rr', vim.lsp.buf.references, { buffer = args.buf })
             vim.keymap.set(
-            'n', 
-            '<leader>tih', 
-            function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) end, 
-            { buffer = args.buf })
+              'n',
+              '<leader>tih',
+              function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) end,
+              { buffer = args.buf })
           end,
         })
       end
@@ -173,7 +192,7 @@ require("lazy").setup({
         "MunifTanjim/nui.nvim",
         "rcarriga/nvim-notify",
       },
-      config = function() 
+      config = function()
         require('notify').setup({
           timeout = 1000,
           max_width = 40,
@@ -182,6 +201,20 @@ require("lazy").setup({
         })
       end
     },
-    { 'github/copilot.vim' }
+    { 'github/copilot.vim' },
+    {
+      "CopilotC-Nvim/CopilotChat.nvim",
+      dependencies = {
+        { "github/copilot.vim" },                       -- or zbirenbaum/copilot.lua
+        { "nvim-lua/plenary.nvim", branch = "master" }, -- for curl, log and async functions
+      },
+      build = "make tiktoken",                          -- Only on MacOS or Linux
+      opts = {
+        window = {
+          layout = 'vertical',
+          width = 0.3,
+        }
+      },
+    }
   },
 })
index 3a645174e50849890c10ba84ebe7610fc8ad4df9..675350ee4af6b9b3e89b5e63748cc2c756df2eb3 100644 (file)
@@ -1,4 +1,5 @@
 {
+  "CopilotChat.nvim": { "branch": "main", "commit": "f8d47ce9adace3c1fe9fa7737bc1fde861bb8317" },
   "copilot.vim": { "branch": "release", "commit": "cd7f01009fb7b30e22840cadc4faad88b05c6eef" },
   "ghcid": { "branch": "master", "commit": "b7dc5c4ee640b6c8137ecfd0a2b50df278015221" },
   "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },