From ca71ec51679b28916d5594676b1f842b19a6cdf0 Mon Sep 17 00:00:00 2001 From: Tim Blume Date: Thu, 4 Apr 2024 00:07:52 +0200 Subject: [PATCH] foo --- lazy-lock.json | 33 +++++++++++++++ lua/chadrc.lua | 2 +- lua/configs/dap-config.lua | 26 ++++++++++++ lua/configs/lspconfig.lua | 2 +- lua/configs/neodev.lua | 18 +++++++++ lua/plugins/init.lua | 83 ++++++++++++++++++++++++-------------- 6 files changed, 132 insertions(+), 32 deletions(-) create mode 100644 lazy-lock.json create mode 100644 lua/configs/dap-config.lua create mode 100644 lua/configs/neodev.lua diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..1468d2f --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,33 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "LuaSnip": { "branch": "master", "commit": "825a61bad1d60d917a7962d73cf3c683f4e0407e" }, + "NvChad": { "branch": "v2.5", "commit": "6833c60694a626615911e379d201dd723511546d" }, + "base46": { "branch": "v2.5", "commit": "adb64a6ae70f8c61c5ab8892f07d29dafd4d47ad" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "conform.nvim": { "branch": "master", "commit": "9d5ba06d6ee7418c674f498634617416d15b6239" }, + "copilot.vim": { "branch": "release", "commit": "9484e35cf222e9360e05450622a884f95c662c4c" }, + "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, + "gitsigns.nvim": { "branch": "main", "commit": "4a1bc2ef16d495150897b1d3a11eb3d3eecfef0a" }, + "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, + "lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" }, + "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, + "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" }, + "nvim-autopairs": { "branch": "master", "commit": "dbfc1c34bed415906395db8303c71039b3a3ffb4" }, + "nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, + "nvim-dap": { "branch": "master", "commit": "405df1dcc2e395ab5173a9c3d00e03942c023074" }, + "nvim-dap-ui": { "branch": "master", "commit": "edfa93f60b189e5952c016eee262d0685d838450" }, + "nvim-lspconfig": { "branch": "master", "commit": "96e5711040df23583591391ce49e556b8cd248d8" }, + "nvim-nio": { "branch": "master", "commit": "173f285eebb410199273fa178aa517fd2d7edd80" }, + "nvim-tree.lua": { "branch": "master", "commit": "d8d3a1590a05b2d8b5eb26e2ed1c6052b1b47a77" }, + "nvim-treesitter": { "branch": "master", "commit": "cc0e29727a9651e27869b7444e835c44fb1e7b4c" }, + "nvim-web-devicons": { "branch": "master", "commit": "3ee60deaa539360518eaab93a6c701fe9f4d82ef" }, + "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, + "telescope.nvim": { "branch": "master", "commit": "4626aaa2bcfdacf55fd6d44b430e2df81b2403ff" }, + "ui": { "branch": "v2.5", "commit": "e1af69426b3c4b55c88bd1c81790c1c73b30bfa8" }, + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } +} \ No newline at end of file diff --git a/lua/chadrc.lua b/lua/chadrc.lua index 1d841e9..d9fdb02 100644 --- a/lua/chadrc.lua +++ b/lua/chadrc.lua @@ -5,7 +5,7 @@ local M = {} M.ui = { - theme = "onedark", + theme = "github_dark", -- hl_override = { -- Comment = { italic = true }, diff --git a/lua/configs/dap-config.lua b/lua/configs/dap-config.lua new file mode 100644 index 0000000..8732ca9 --- /dev/null +++ b/lua/configs/dap-config.lua @@ -0,0 +1,26 @@ +require("dap").adapters.lldb = { + type = "executable", + command = "/usr/bin/lldb-vscode", -- adjust as needed + name = "lldb", +} + +local lldb = { + name = "Launch lldb", + type = "lldb", -- matches the adapter + request = "launch", -- could also attach to a currently running process + program = function() + return vim.fn.input( + "Path to executable: ", + vim.fn.getcwd() .. "/", + "file" + ) + end, + cwd = "${workspaceFolder}", + stopOnEntry = false, + args = {}, + runInTerminal = false, +} + +require('dap').configurations.rust = { + lldb -- different debuggers or more configurations can be used here +} diff --git a/lua/configs/lspconfig.lua b/lua/configs/lspconfig.lua index a73657a..3fa15b5 100644 --- a/lua/configs/lspconfig.lua +++ b/lua/configs/lspconfig.lua @@ -4,7 +4,7 @@ local on_init = require("nvchad.configs.lspconfig").on_init local capabilities = require("nvchad.configs.lspconfig").capabilities local lspconfig = require "lspconfig" -local servers = { "html", "cssls" } +local servers = { "html", "cssls", "cmake", "clangd" } -- lsps with default config for _, lsp in ipairs(servers) do diff --git a/lua/configs/neodev.lua b/lua/configs/neodev.lua new file mode 100644 index 0000000..cf8e6bb --- /dev/null +++ b/lua/configs/neodev.lua @@ -0,0 +1,18 @@ +-- IMPORTANT: make sure to setup neodev BEFORE lspconfig +require("neodev").setup({ + library = { plugins = { "nvim-dap-ui" }, types = true } +}) + +-- then setup your lsp server as usual +local lspconfig = require('lspconfig') + +-- example to setup lua_ls and enable call snippets +lspconfig.lua_ls.setup({ + settings = { + Lua = { + completion = { + callSnippet = "Replace" + } + } + } +}) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index e62d896..87562b4 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -1,38 +1,61 @@ return { { "stevearc/conform.nvim", - -- event = 'BufWritePre', -- uncomment for format on save + event = 'BufWritePre', -- uncomment for format on save config = function() require "configs.conform" end, }, - - -- These are some examples, uncomment them if you want to see them work! - -- { - -- "neovim/nvim-lspconfig", - -- config = function() - -- require("nvchad.configs.lspconfig").defaults() - -- require "configs.lspconfig" - -- end, - -- }, - -- - -- { - -- "williamboman/mason.nvim", - -- opts = { - -- ensure_installed = { - -- "lua-language-server", "stylua", - -- "html-lsp", "css-lsp" , "prettier" - -- }, - -- }, - -- }, - -- - -- { - -- "nvim-treesitter/nvim-treesitter", - -- opts = { - -- ensure_installed = { - -- "vim", "lua", "vimdoc", - -- "html", "css" - -- }, - -- }, - -- }, + { + "github/copilot.vim", + lazy = false, + config = function () + vim.g.copilot_no_tab_map = true + vim.g.copilot_assume_mapped = true + vim.api.nvim_set_keymap("i", "", 'copilot#Accept("")', {silent = true, expr = true}) + end, + }, + { + "neovim/nvim-lspconfig", + config = function() + require "configs.neodev" + require("nvchad.configs.lspconfig").defaults() + require "configs.lspconfig" + end, + }, + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "lua-language-server", "stylua", + "html-lsp", "css-lsp" , "prettier", + "cmake-language-server", "clangd" + }, + }, + }, + { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "vim", "lua", "vimdoc", + "html", "css", "cmake", "c", "cpp", "zig", "rust" + }, + }, + }, + { + "mfussenegger/nvim-dap", + config = function() + require "configs.dap-config" + end, + }, + { + "rcarriga/nvim-dap-ui", + dependencies = { + "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" + } + }, + { + "folke/neodev.nvim", + opts = {} + } }