From 7623c0265cbb034c208755b4db3500761a972117 Mon Sep 17 00:00:00 2001 From: Dan Chadwick Date: Sun, 20 Oct 2024 12:25:10 -0400 Subject: [PATCH] lot of updates. --- init.lua | 53 +++++++++++++++++++++++++++ lazy-lock.json | 47 ++++++++++++++---------- lua/dan/core.lua | 9 +++++ lua/plugins/.DS_Store | Bin 0 -> 6148 bytes lua/plugins/catppuccin.lua | 55 ++++++++++++++++++++++++++++ lua/plugins/commentary.lua | 3 ++ lua/plugins/lsp-config.lua | 5 ++- lua/plugins/lualine.lua | 4 +- lua/plugins/rose-pine.lua | 73 ------------------------------------- lua/plugins/telescope.lua | 6 +++ lua/plugins/treesitter.lua | 2 +- lua/plugins/xdebug.lua | 29 +++++++++++++++ 12 files changed, 189 insertions(+), 97 deletions(-) create mode 100644 lua/plugins/.DS_Store create mode 100644 lua/plugins/catppuccin.lua create mode 100644 lua/plugins/commentary.lua delete mode 100644 lua/plugins/rose-pine.lua create mode 100644 lua/plugins/xdebug.lua diff --git a/init.lua b/init.lua index 6a1833d..9047975 100644 --- a/init.lua +++ b/init.lua @@ -13,4 +13,57 @@ if not vim.loop.fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) require("lazy").setup("plugins") +vim.cmd.colorscheme('catppuccin') +local dap = require('dap') +require('telescope').load_extension('dap') + +dap.adapters.php = { + type = "executable", + command = "node", + args = { os.getenv("HOME") .. "/vscode-php-debug/out/phpDebug.js" } +} + +dap.configurations.php = { + { + type = "php", + request = "launch", + name = "Listen for Xdebug", + port = 9003, + log = true, + } +} + +vim.keymap.set('n', '?', function() dap.continue() end) +vim.keymap.set('n', 'N', function() dap.step_over() end) +vim.keymap.set('n', 'n', function() dap.step_into() end) +vim.keymap.set('n', 'E', function() dap.step_out() end) +vim.keymap.set('n', 'b', function() dap.toggle_breakpoint() end) +vim.keymap.set('n', 'B', function() dap.set_breakpoint() end) +vim.keymap.set('n', 'dr', function() dap.repl.open() end) +vim.keymap.set('n', 'dl', function() dap.run_last() end) +vim.keymap.set({'n', 'v'}, 'dh', function() + require('dap.ui.widgets').hover() +end) +vim.keymap.set({'n', 'v'}, 'dp', function() + require('dap.ui.widgets').preview() +end) +vim.keymap.set('n', 'df', function() + local widgets = require('dap.ui.widgets') + widgets.centered_float(widgets.frames) +end) +vim.keymap.set('n', 'db', function() + local widgets = require('dap.ui.widgets') + widgets.centered_float(widgets.scopes) +end) +dap.listeners.after.event_initialized["dapui_config"] = function() + dapui.open() +end + +dap.listeners.before.event_terminated["dapui_config"] = function() + dapui.close() +end + +dap.listeners.before.event_exited["dapui_config"] = function() + dapui.close() +end diff --git a/lazy-lock.json b/lazy-lock.json index 40816fd..e6107e2 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,23 +1,30 @@ { - "LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" }, - "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, + "alpha-nvim": { "branch": "main", "commit": "bf3c8bb8c02ed3d9644cc5bbc48e2bdc39349cd7" }, + "catppuccin": { "branch": "main", "commit": "7be452ee067978cdc8b2c5f3411f0c71ffa612b9" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" }, - "harpoon": { "branch": "harpoon2", "commit": "a38be6e0dd4c6db66997deab71fc4453ace97f9c" }, - "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, - "lazygit.nvim": { "branch": "main", "commit": "10a5f30536dc2d4abe36d410d83149272ea457fa" }, - "lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "21d33d69a81f6351e5a5f49078b2e4f0075c8e73" }, - "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "f3941c57ec85d7bdb44fa53fd858fd80f159018f" }, - "nui.nvim": { "branch": "main", "commit": "b81333d12f824dbed5eb231c8a4409a290fdd848" }, - "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, - "nvim-lspconfig": { "branch": "master", "commit": "c932a56bf25167b1e88d2a1ebe35bb774b41019a" }, - "nvim-treesitter": { "branch": "master", "commit": "6e2b56cbe75ddf18e6efecee44bc3936d70b0b3e" }, - "nvim-web-devicons": { "branch": "master", "commit": "4adea17610d140a99c313e3f79a9dc01825d59ae" }, - "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, - "rose-pine": { "branch": "main", "commit": "f977eeba34b030b37f93ece2fbd792477606203b" }, + "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, + "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, + "lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" }, + "lazygit.nvim": { "branch": "main", "commit": "56760339a81cd1540d5a72fd9d93010a2677b55d" }, + "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, + "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-dap": { "branch": "master", "commit": "7ff6936010b7222fea2caea0f67ed77f1b7c60dd" }, + "nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "52638640ae309cacdaff785fdbb854437bd1ee5c" }, + "nvim-lspconfig": { "branch": "master", "commit": "d141895d1d9f41048fff201d62a2d6e96d299e32" }, + "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, + "nvim-treesitter": { "branch": "master", "commit": "5a2ff8b7ca5470b1011ed82ef3fdd53139ffc467" }, + "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "telescope-dap.nvim": { "branch": "master", "commit": "8c88d9716c91eaef1cdea13cb9390d8ef447dbfe" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" } -} \ No newline at end of file + "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, + "vim-commentary": { "branch": "master", "commit": "c4b8f52cbb7142ec239494e5a2c4a512f92c4d07" } +} diff --git a/lua/dan/core.lua b/lua/dan/core.lua index a93c9c0..25a6297 100644 --- a/lua/dan/core.lua +++ b/lua/dan/core.lua @@ -13,3 +13,12 @@ vim.cmd("set rnu") vim.cmd("set number relativenumber") vim.cmd("set nu rnu") vim.api.nvim_set_option("clipboard","unnamed") +vim.api.nvim_create_user_command("DiagnosticToggle", function() + local config = vim.diagnostic.config + local vt = config().virtual_text + config { + virtual_text = not vt, + underline = not vt, + signs = not vt, + } +end, { desc = "toggle diagnostic" }) diff --git a/lua/plugins/.DS_Store b/lua/plugins/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0ca', vim.lsp.buf.code_action, {}) diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 3514c18..5095f55 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,7 +1,7 @@ return { 'nvim-lualine/lualine.nvim', - dependencies = { - 'nvim-tree/nvim-web-devicons' + dependencies = { + 'nvim-tree/nvim-web-devicons' }, config = function() require('lualine'). setup({ diff --git a/lua/plugins/rose-pine.lua b/lua/plugins/rose-pine.lua deleted file mode 100644 index de19451..0000000 --- a/lua/plugins/rose-pine.lua +++ /dev/null @@ -1,73 +0,0 @@ - return { - 'rose-pine/neovim', - name = 'rose-pine', - config = function() - require("rose-pine").setup({ - variant = "moon", -- auto, main, moon, or dawn - dark_variant = "main", -- main, moon, or dawn - dim_inactive_windows = false, - extend_background_behind_borders = true, - - enable = { - terminal = true, - legacy_highlights = true, -- Improve compatibility for previous versions of Neovim - migrations = true, -- Handle deprecated options automatically - }, - - styles = { - bold = false, - italic = false, - transparency = false, - }, - - groups = { - border = "muted", - link = "iris", - panel = "surface", - - error = "love", - hint = "iris", - info = "foam", - note = "pine", - todo = "rose", - warn = "gold", - - git_add = "foam", - git_change = "rose", - git_delete = "love", - git_dirty = "rose", - git_ignore = "muted", - git_merge = "iris", - git_rename = "pine", - git_stage = "iris", - git_text = "rose", - git_untracked = "subtle", - - h1 = "iris", - h2 = "foam", - h3 = "rose", - h4 = "gold", - h5 = "pine", - h6 = "foam", - }, - - highlight_groups = { - -- Comment = { fg = "foam" }, - -- VertSplit = { fg = "muted", bg = "muted" }, - }, - - before_highlight = function(group, highlight, palette) - -- Disable all undercurls - -- if highlight.undercurl then - -- highlight.undercurl = false - -- end - -- - -- Change palette colour -- if highlight.fg == palette.pine then - -- highlight.fg = palette.foam - -- end - end, - }) - vim.cmd("colorscheme rose-pine") - end - } - diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 05a7568..495232a 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -29,5 +29,11 @@ return { -- load_extension, somewhere after setup function: require("telescope").load_extension("ui-select") end + }, + { + "nvim-telescope/telescope-dap.nvim", + config = function() + require('telescope').load_extension('dap') + end } } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index da75628..9689540 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -4,7 +4,7 @@ return { config = function() local configs = require("nvim-treesitter.configs") configs.setup({ - ensure_installed = { "php", "lua", "vim", "javascript", "html", "yaml" }, + ensure_installed = { "php", "lua", "vim", "javascript", "html", "yaml", "twig" }, sync_install = false, highlight = { enable = true }, indent = { enable = true }, diff --git a/lua/plugins/xdebug.lua b/lua/plugins/xdebug.lua new file mode 100644 index 0000000..afb4dc1 --- /dev/null +++ b/lua/plugins/xdebug.lua @@ -0,0 +1,29 @@ +return { + { + 'mfussenegger/nvim-dap', + }, + { + "jay-babu/mason-nvim-dap.nvim", + config = function() + require("mason-nvim-dap").setup({ + ensure_installed = { "php-debug-adapter" } + }) + end + }, + { + 'theHamsta/nvim-dap-virtual-text', + config = function() + require("nvim-dap-virtual-text").setup() + end + }, + { + "rcarriga/nvim-dap-ui", + dependencies = { + "mfussenegger/nvim-dap", + "nvim-neotest/nvim-nio" + }, + config = function() + require("dapui").setup() + end + } +}