Configure Neovim Xdebug debugging
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
email = tracer@24unix.net
|
||||
[core]
|
||||
autocrlf = input
|
||||
excludesFile = /Users/tracer/.gitignore_global
|
||||
[init]
|
||||
defaultBranch = master
|
||||
[push]
|
||||
|
||||
+136
-247
@@ -1,283 +1,172 @@
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
local ensure_packer = function()
|
||||
local fn = vim.fn
|
||||
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
||||
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path })
|
||||
vim.cmd([[packadd packer.nvim]])
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
local packer_bootstrap = ensure_packer()
|
||||
|
||||
require("packer").reset()
|
||||
vim.g.polyglot_disabled = { "autoindent" }
|
||||
|
||||
require("packer").init({
|
||||
compile_path = vim.fn.stdpath("data") .. "/site/plugin/packer_compiled.lua",
|
||||
display = {
|
||||
open_fn = function()
|
||||
return require("packer.util").float({ border = "solid" })
|
||||
end,
|
||||
},
|
||||
local gh = function(repo)
|
||||
return "https://github.com/" .. repo
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd("PackChanged", {
|
||||
callback = function(event)
|
||||
local name = event.data.spec.name
|
||||
local kind = event.data.kind
|
||||
|
||||
if kind ~= "install" and kind ~= "update" then
|
||||
return
|
||||
end
|
||||
|
||||
if name == "telescope-fzf-native.nvim" then
|
||||
vim.system({ "make" }, { cwd = event.data.path }):wait()
|
||||
end
|
||||
|
||||
if name == "nvim-treesitter" then
|
||||
if not event.data.active then
|
||||
vim.cmd.packadd("nvim-treesitter")
|
||||
end
|
||||
|
||||
require("nvim-treesitter.install").update({ with_sync = true })
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
require("packer").startup(function(use)
|
||||
use("wbthomason/packer.nvim")
|
||||
|
||||
-- My plugins here
|
||||
vim.pack.add({
|
||||
-- Commenting support.
|
||||
use("tpope/vim-commentary")
|
||||
gh("tpope/vim-commentary"),
|
||||
-- Add, change, and delete surrounding text.
|
||||
use("tpope/vim-surround")
|
||||
gh("tpope/vim-surround"),
|
||||
-- Useful commands like :Rename and :SudoWrite.
|
||||
use("tpope/vim-eunuch")
|
||||
gh("tpope/vim-eunuch"),
|
||||
-- Pairs of handy bracket mappings, like [b and ]b.
|
||||
use("tpope/vim-unimpaired")
|
||||
gh("tpope/vim-unimpaired"),
|
||||
-- Indent autodetection with editorconfig support.
|
||||
use("tpope/vim-sleuth")
|
||||
gh("tpope/vim-sleuth"),
|
||||
-- Allow plugins to enable repeating of commands.
|
||||
use("tpope/vim-repeat")
|
||||
gh("tpope/vim-repeat"),
|
||||
-- One Dark theme.
|
||||
use({
|
||||
"jessarcher/onedark.nvim",
|
||||
config = function()
|
||||
vim.cmd.colorscheme("onedark")
|
||||
|
||||
local normalfloat_hl = vim.api.nvim_get_hl(0, { name = "NormalFloat", link = false })
|
||||
if normalfloat_hl.bg then
|
||||
vim.api.nvim_set_hl(0, "FloatBorder", {
|
||||
fg = normalfloat_hl.bg,
|
||||
bg = normalfloat_hl.bg,
|
||||
})
|
||||
end
|
||||
|
||||
local cursorline_hl = vim.api.nvim_get_hl(0, { name = "CursorLine", link = false })
|
||||
if cursorline_hl.bg then
|
||||
vim.api.nvim_set_hl(0, "CursorLineBg", {
|
||||
fg = cursorline_hl.bg,
|
||||
bg = cursorline_hl.bg,
|
||||
})
|
||||
end
|
||||
|
||||
vim.api.nvim_set_hl(0, "NvimTreeIndentMarker", { fg = "#30323E" })
|
||||
|
||||
local statusline_hl = vim.api.nvim_get_hl(0, { name = "StatusLine", link = false })
|
||||
vim.api.nvim_set_hl(0, "StatusLineNonText", {
|
||||
fg = "#5C6370",
|
||||
bg = statusline_hl.bg,
|
||||
})
|
||||
|
||||
vim.api.nvim_set_hl(0, "IndentBlanklineChar", { fg = "#2F313C" })
|
||||
end,
|
||||
})
|
||||
gh("jessarcher/onedark.nvim"),
|
||||
-- Add more languages.
|
||||
use("sheerun/vim-polyglot")
|
||||
gh("sheerun/vim-polyglot"),
|
||||
-- Navigate seamlessly between Vim windows and Tmux panes.
|
||||
use("christoomey/vim-tmux-navigator")
|
||||
gh("christoomey/vim-tmux-navigator"),
|
||||
-- Jump to the last location when opening a file.
|
||||
use("farmergreg/vim-lastplace")
|
||||
gh("farmergreg/vim-lastplace"),
|
||||
-- Enable * searching with visually selected text.
|
||||
use("nelstrom/vim-visual-star-search")
|
||||
gh("nelstrom/vim-visual-star-search"),
|
||||
-- Automatically create parent dirs when saving.
|
||||
use("jessarcher/vim-heritage")
|
||||
gh("jessarcher/vim-heritage"),
|
||||
-- Text objects for HTML attributes.
|
||||
use({
|
||||
"whatyouhide/vim-textobj-xmlattr",
|
||||
requires = "kana/vim-textobj-user",
|
||||
})
|
||||
gh("kana/vim-textobj-user"),
|
||||
gh("whatyouhide/vim-textobj-xmlattr"),
|
||||
-- Automatically set the working directory to the project root.
|
||||
use({
|
||||
"airblade/vim-rooter",
|
||||
setup = function()
|
||||
-- Instead of this running every time we open a file, we'll just run it once when Vim starts.
|
||||
vim.g.rooter_manual_only = 1
|
||||
end,
|
||||
config = function()
|
||||
vim.cmd("Rooter")
|
||||
end,
|
||||
})
|
||||
gh("airblade/vim-rooter"),
|
||||
-- Automatically add closing brackets, quotes, etc.
|
||||
use({
|
||||
"windwp/nvim-autopairs",
|
||||
config = function()
|
||||
require("nvim-autopairs").setup()
|
||||
end,
|
||||
})
|
||||
-- Add smooth scrolling to avoid jarring jumps
|
||||
use({
|
||||
"karb94/neoscroll.nvim",
|
||||
config = function()
|
||||
require("neoscroll").setup()
|
||||
end,
|
||||
})
|
||||
-- All closing buffers without closing the split window.
|
||||
use({
|
||||
"famiu/bufdelete.nvim",
|
||||
config = function()
|
||||
vim.keymap.set("n", "<Leader>q", ":Bdelete<CR>")
|
||||
end,
|
||||
})
|
||||
gh("windwp/nvim-autopairs"),
|
||||
-- Add smooth scrolling to avoid jarring jumps.
|
||||
gh("karb94/neoscroll.nvim"),
|
||||
-- Close buffers without closing the split window.
|
||||
gh("famiu/bufdelete.nvim"),
|
||||
-- Split arrays and methods onto multiple lines, or join them back up.
|
||||
use({
|
||||
"AndrewRadev/splitjoin.vim",
|
||||
config = function()
|
||||
vim.g.splitjoin_html_attributes_bracket_on_new_line = 1
|
||||
vim.g.splitjoin_trailing_comma = 1
|
||||
vim.g.splitjoin_php_method_chain_full = 1
|
||||
end,
|
||||
})
|
||||
gh("AndrewRadev/splitjoin.vim"),
|
||||
-- Automatically fix indentation when pasting code.
|
||||
use({
|
||||
"sickill/vim-pasta",
|
||||
config = function()
|
||||
vim.g.pasta_disabled_filetypes = { "fugitive" }
|
||||
end,
|
||||
})
|
||||
gh("sickill/vim-pasta"),
|
||||
-- Git integration.
|
||||
use({
|
||||
"lewis6991/gitsigns.nvim",
|
||||
config = function()
|
||||
require("gitsigns").setup({ current_line_blame = true })
|
||||
|
||||
vim.keymap.set("n", "]h", ":Gitsigns next_hunk<CR>")
|
||||
vim.keymap.set("n", "[h", ":Gitsigns prev_hunk<CR>")
|
||||
vim.keymap.set("n", "gs", ":Gitsigns stage_hunk<CR>")
|
||||
vim.keymap.set("n", "gS", ":Gitsigns undo_stage_hunk<CR>")
|
||||
vim.keymap.set("n", "gp", ":Gitsigns preview_hunk<CR>")
|
||||
vim.keymap.set("n", "gb", ":Gitsigns blame_line<CR>")
|
||||
end,
|
||||
})
|
||||
-- Git commands.
|
||||
use({
|
||||
"tpope/vim-fugitive",
|
||||
requires = "tpope/vim-rhubarb",
|
||||
config = function()
|
||||
require("tracer.plugins.fugitive").setup()
|
||||
end,
|
||||
})
|
||||
gh("lewis6991/gitsigns.nvim"),
|
||||
gh("tpope/vim-fugitive"),
|
||||
gh("tpope/vim-rhubarb"),
|
||||
-- Improved syntax highlighting.
|
||||
use({
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
run = function()
|
||||
require("nvim-treesitter.install").update({ with_sync = true })
|
||||
end,
|
||||
requires = {
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
},
|
||||
config = function()
|
||||
pcall(require, "tracer.plugins.treesitter")
|
||||
end,
|
||||
})
|
||||
gh("nvim-treesitter/nvim-treesitter"),
|
||||
gh("JoosepAlviste/nvim-ts-context-commentstring"),
|
||||
gh("nvim-treesitter/nvim-treesitter-textobjects"),
|
||||
-- Language Server Protocol.
|
||||
use({
|
||||
"neovim/nvim-lspconfig",
|
||||
requires = {
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"b0o/schemastore.nvim",
|
||||
},
|
||||
config = function()
|
||||
pcall(require, "tracer.plugins.lspconfig")
|
||||
end,
|
||||
})
|
||||
|
||||
-- Completion
|
||||
use({
|
||||
"hrsh7th/nvim-cmp",
|
||||
requires = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-nvim-lsp-signature-help",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"onsails/lspkind.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("tracer.plugins.cmp")
|
||||
end,
|
||||
})
|
||||
|
||||
gh("neovim/nvim-lspconfig"),
|
||||
gh("williamboman/mason.nvim"),
|
||||
gh("williamboman/mason-lspconfig.nvim"),
|
||||
gh("b0o/schemastore.nvim"),
|
||||
-- Debugging.
|
||||
gh("mfussenegger/nvim-dap"),
|
||||
gh("nvim-neotest/nvim-nio"),
|
||||
gh("rcarriga/nvim-dap-ui"),
|
||||
-- Completion.
|
||||
gh("hrsh7th/nvim-cmp"),
|
||||
gh("hrsh7th/cmp-nvim-lsp"),
|
||||
gh("hrsh7th/cmp-nvim-lsp-signature-help"),
|
||||
gh("hrsh7th/cmp-buffer"),
|
||||
gh("hrsh7th/cmp-path"),
|
||||
gh("L3MON4D3/LuaSnip"),
|
||||
gh("saadparwaiz1/cmp_luasnip"),
|
||||
gh("onsails/lspkind.nvim"),
|
||||
-- Show available keymaps as you type prefixes.
|
||||
use({
|
||||
"folke/which-key.nvim",
|
||||
config = function()
|
||||
require("tracer.plugins.which-key")
|
||||
end,
|
||||
gh("folke/which-key.nvim"),
|
||||
-- Startup dashboard.
|
||||
gh("nvimdev/dashboard-nvim"),
|
||||
-- Fuzzy finder.
|
||||
gh("nvim-lua/plenary.nvim"),
|
||||
gh("nvim-tree/nvim-web-devicons"),
|
||||
gh("nvim-telescope/telescope.nvim"),
|
||||
gh("nvim-telescope/telescope-live-grep-args.nvim"),
|
||||
gh("nvim-telescope/telescope-fzf-native.nvim"),
|
||||
-- Status line, buffer tabs, and file tree.
|
||||
gh("nvim-lualine/lualine.nvim"),
|
||||
gh("akinsho/bufferline.nvim"),
|
||||
gh("nvim-tree/nvim-tree.lua"),
|
||||
}, { confirm = false, load = true })
|
||||
|
||||
vim.cmd.colorscheme("onedark")
|
||||
|
||||
local normalfloat_hl = vim.api.nvim_get_hl(0, { name = "NormalFloat", link = false })
|
||||
if normalfloat_hl.bg then
|
||||
vim.api.nvim_set_hl(0, "FloatBorder", {
|
||||
fg = normalfloat_hl.bg,
|
||||
bg = normalfloat_hl.bg,
|
||||
})
|
||||
end
|
||||
|
||||
-- Startup dashboard
|
||||
use({
|
||||
"nvimdev/dashboard-nvim",
|
||||
event = "VimEnter",
|
||||
requires = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
require("tracer.plugins.dashboard")
|
||||
end,
|
||||
local cursorline_hl = vim.api.nvim_get_hl(0, { name = "CursorLine", link = false })
|
||||
if cursorline_hl.bg then
|
||||
vim.api.nvim_set_hl(0, "CursorLineBg", {
|
||||
fg = cursorline_hl.bg,
|
||||
bg = cursorline_hl.bg,
|
||||
})
|
||||
end
|
||||
|
||||
-- Fuzzy finder
|
||||
use({
|
||||
"nvim-telescope/telescope.nvim",
|
||||
requires = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"nvim-telescope/telescope-live-grep-args.nvim",
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", run = "make" },
|
||||
},
|
||||
config = function()
|
||||
require("tracer.plugins.telescope")
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_set_hl(0, "NvimTreeIndentMarker", { fg = "#30323E" })
|
||||
|
||||
-- A status line.
|
||||
use({
|
||||
"nvim-lualine/lualine.nvim",
|
||||
requires = "nvim-tree/nvim-web-devicons",
|
||||
config = function()
|
||||
require("tracer.plugins.lualine")
|
||||
end,
|
||||
})
|
||||
local statusline_hl = vim.api.nvim_get_hl(0, { name = "StatusLine", link = false })
|
||||
vim.api.nvim_set_hl(0, "StatusLineNonText", {
|
||||
fg = "#5C6370",
|
||||
bg = statusline_hl.bg,
|
||||
})
|
||||
|
||||
-- Display buffers as tabs.
|
||||
use({
|
||||
"akinsho/bufferline.nvim",
|
||||
requires = "nvim-tree/nvim-web-devicons",
|
||||
after = "onedark.nvim",
|
||||
config = function()
|
||||
require("tracer.plugins.bufferline")
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_set_hl(0, "IndentBlanklineChar", { fg = "#2F313C" })
|
||||
|
||||
-- File tree sidebar for project-style navigation.
|
||||
use({
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
requires = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
require("tracer.plugins.nvim-tree")
|
||||
end,
|
||||
})
|
||||
vim.g.rooter_manual_only = 1
|
||||
vim.cmd("Rooter")
|
||||
|
||||
-- Automatically set up your configuration after cloning packer.nvim
|
||||
-- Put this at the end after all plugins
|
||||
if packer_bootstrap then
|
||||
require("packer").sync()
|
||||
end
|
||||
end)
|
||||
require("nvim-autopairs").setup()
|
||||
require("neoscroll").setup()
|
||||
vim.keymap.set("n", "<Leader>q", ":Bdelete<CR>")
|
||||
|
||||
vim.cmd([[
|
||||
augroup packer_user_config
|
||||
autocmd!
|
||||
autocmd BufWritePost plugins.lua source <afile> | PackerSync
|
||||
augroup end
|
||||
]])
|
||||
vim.g.splitjoin_html_attributes_bracket_on_new_line = 1
|
||||
vim.g.splitjoin_trailing_comma = 1
|
||||
vim.g.splitjoin_php_method_chain_full = 1
|
||||
vim.g.pasta_disabled_filetypes = { "fugitive" }
|
||||
|
||||
require("gitsigns").setup({ current_line_blame = true })
|
||||
vim.keymap.set("n", "]h", ":Gitsigns next_hunk<CR>")
|
||||
vim.keymap.set("n", "[h", ":Gitsigns prev_hunk<CR>")
|
||||
vim.keymap.set("n", "gs", ":Gitsigns stage_hunk<CR>")
|
||||
vim.keymap.set("n", "gS", ":Gitsigns undo_stage_hunk<CR>")
|
||||
vim.keymap.set("n", "gp", ":Gitsigns preview_hunk<CR>")
|
||||
vim.keymap.set("n", "gb", ":Gitsigns blame_line<CR>")
|
||||
|
||||
require("tracer.plugins.fugitive").setup()
|
||||
pcall(require, "tracer.plugins.treesitter")
|
||||
pcall(require, "tracer.plugins.lspconfig")
|
||||
require("tracer.plugins.cmp")
|
||||
require("tracer.plugins.which-key")
|
||||
require("tracer.plugins.dashboard")
|
||||
require("tracer.plugins.telescope")
|
||||
require("tracer.plugins.lualine")
|
||||
require("tracer.plugins.bufferline")
|
||||
require("tracer.plugins.nvim-tree")
|
||||
require("tracer.plugins.dap")
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
|
||||
dapui.setup()
|
||||
|
||||
-- Provided by Mason's `php-debug-adapter` package. The adapter implements the
|
||||
-- bridge between nvim-dap and Xdebug; VS Code itself is never involved.
|
||||
dap.adapters.php = {
|
||||
type = "executable",
|
||||
command = "php-debug-adapter",
|
||||
}
|
||||
|
||||
dap.configurations.php = {
|
||||
{
|
||||
type = "php",
|
||||
request = "launch",
|
||||
name = "Listen for Xdebug",
|
||||
port = 9003,
|
||||
-- For Docker/remote PHP, add a mapping such as:
|
||||
-- pathMappings = { ["/var/www/html"] = "${workspaceFolder}" },
|
||||
},
|
||||
}
|
||||
|
||||
dap.listeners.after.event_initialized["dapui_config"] = dapui.open
|
||||
dap.listeners.before.event_terminated["dapui_config"] = dapui.close
|
||||
dap.listeners.before.event_exited["dapui_config"] = dapui.close
|
||||
|
||||
vim.fn.sign_define("DapBreakpoint", { text = "●", texthl = "DiagnosticSignError" })
|
||||
vim.fn.sign_define("DapStopped", { text = "▶", texthl = "DiagnosticSignInfo", linehl = "Visual" })
|
||||
|
||||
local map = function(lhs, rhs, desc)
|
||||
vim.keymap.set("n", lhs, rhs, { desc = desc })
|
||||
end
|
||||
|
||||
map("<leader>dc", dap.continue, "Debug: continue")
|
||||
map("<leader>db", dap.toggle_breakpoint, "Debug: toggle breakpoint")
|
||||
map("<leader>dB", function()
|
||||
dap.set_breakpoint(vim.fn.input("Breakpoint condition: "))
|
||||
end, "Debug: conditional breakpoint")
|
||||
map("<leader>do", dap.step_over, "Debug: step over")
|
||||
map("<leader>di", dap.step_into, "Debug: step into")
|
||||
map("<leader>dO", dap.step_out, "Debug: step out")
|
||||
map("<leader>dt", dap.terminate, "Debug: terminate")
|
||||
map("<leader>dr", dap.repl.toggle, "Debug: toggle REPL")
|
||||
map("<leader>du", dapui.toggle, "Debug: toggle UI")
|
||||
@@ -13,7 +13,7 @@ dashboard.setup({
|
||||
{
|
||||
desc = " Update",
|
||||
group = "@property",
|
||||
action = "PackerSync",
|
||||
action = "lua vim.pack.update()",
|
||||
key = "u",
|
||||
},
|
||||
{
|
||||
|
||||
@@ -0,0 +1,208 @@
|
||||
{
|
||||
"plugins": {
|
||||
"LuaSnip": {
|
||||
"rev": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24",
|
||||
"src": "https://github.com/L3MON4D3/LuaSnip"
|
||||
},
|
||||
"bufdelete.nvim": {
|
||||
"rev": "f6bcea78afb3060b198125256f897040538bcb81",
|
||||
"src": "https://github.com/famiu/bufdelete.nvim"
|
||||
},
|
||||
"bufferline.nvim": {
|
||||
"rev": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3",
|
||||
"src": "https://github.com/akinsho/bufferline.nvim"
|
||||
},
|
||||
"cmp-buffer": {
|
||||
"rev": "b74fab3656eea9de20a9b8116afa3cfc4ec09657",
|
||||
"src": "https://github.com/hrsh7th/cmp-buffer"
|
||||
},
|
||||
"cmp-nvim-lsp": {
|
||||
"rev": "cbc7b02bb99fae35cb42f514762b89b5126651ef",
|
||||
"src": "https://github.com/hrsh7th/cmp-nvim-lsp"
|
||||
},
|
||||
"cmp-nvim-lsp-signature-help": {
|
||||
"rev": "fd3e882e56956675c620898bf1ffcf4fcbe7ec84",
|
||||
"src": "https://github.com/hrsh7th/cmp-nvim-lsp-signature-help"
|
||||
},
|
||||
"cmp-path": {
|
||||
"rev": "c642487086dbd9a93160e1679a1327be111cbc25",
|
||||
"src": "https://github.com/hrsh7th/cmp-path"
|
||||
},
|
||||
"cmp_luasnip": {
|
||||
"rev": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90",
|
||||
"src": "https://github.com/saadparwaiz1/cmp_luasnip"
|
||||
},
|
||||
"dashboard-nvim": {
|
||||
"rev": "f787e3462c2ee2b6117b17c1aa4ddf66cb6f57fe",
|
||||
"src": "https://github.com/nvimdev/dashboard-nvim"
|
||||
},
|
||||
"gitsigns.nvim": {
|
||||
"rev": "5be654f2232c10ddcad19c1607a67b6b4b78fc29",
|
||||
"src": "https://github.com/lewis6991/gitsigns.nvim"
|
||||
},
|
||||
"lspkind.nvim": {
|
||||
"rev": "c7274c48137396526b59d86232eabcdc7fed8a32",
|
||||
"src": "https://github.com/onsails/lspkind.nvim"
|
||||
},
|
||||
"lualine.nvim": {
|
||||
"rev": "221ce6b2d999187044529f49da6554a92f740a96",
|
||||
"src": "https://github.com/nvim-lualine/lualine.nvim"
|
||||
},
|
||||
"mason-lspconfig.nvim": {
|
||||
"rev": "9d28935aa95fa6c1dc7c4d6747f101a72a8a4bec",
|
||||
"src": "https://github.com/williamboman/mason-lspconfig.nvim"
|
||||
},
|
||||
"mason.nvim": {
|
||||
"rev": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d",
|
||||
"src": "https://github.com/williamboman/mason.nvim"
|
||||
},
|
||||
"neoscroll.nvim": {
|
||||
"rev": "c8d29979cb0cb3a2437a8e0ae683fd82f340d3b8",
|
||||
"src": "https://github.com/karb94/neoscroll.nvim"
|
||||
},
|
||||
"nvim-autopairs": {
|
||||
"rev": "430522f95fe4fb7c511ec64f8c1a90cc6a66c05c",
|
||||
"src": "https://github.com/windwp/nvim-autopairs"
|
||||
},
|
||||
"nvim-cmp": {
|
||||
"rev": "2ffe79f1f021def8dd1fcd81deb16f1bb0d989f3",
|
||||
"src": "https://github.com/hrsh7th/nvim-cmp"
|
||||
},
|
||||
"nvim-dap": {
|
||||
"rev": "c9a0738e45f1bd41d792a126941348dce661cf9b",
|
||||
"src": "https://github.com/mfussenegger/nvim-dap"
|
||||
},
|
||||
"nvim-dap-ui": {
|
||||
"rev": "cc9dd33aade7f20bae414d0cba163bc60d4d4b43",
|
||||
"src": "https://github.com/rcarriga/nvim-dap-ui"
|
||||
},
|
||||
"nvim-lspconfig": {
|
||||
"rev": "10e9995a8638ad8f72898de3003ef8c686fe6a52",
|
||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
"nvim-nio": {
|
||||
"rev": "edcc181a875301dd21840189aa2f2f9ad69fc172",
|
||||
"src": "https://github.com/nvim-neotest/nvim-nio"
|
||||
},
|
||||
"nvim-tree.lua": {
|
||||
"rev": "b2aadda94b107480c48e548d6db51c6840b7b33c",
|
||||
"src": "https://github.com/nvim-tree/nvim-tree.lua"
|
||||
},
|
||||
"nvim-treesitter": {
|
||||
"rev": "8b98b4470eb326f1c7b50dae79f8c963568e5720",
|
||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
"nvim-treesitter-textobjects": {
|
||||
"rev": "898ee307df58f854d11cd7edd06472574d48014e",
|
||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter-textobjects"
|
||||
},
|
||||
"nvim-ts-context-commentstring": {
|
||||
"rev": "6141a40173c6efa98242dc951ed4b6f892c97027",
|
||||
"src": "https://github.com/JoosepAlviste/nvim-ts-context-commentstring"
|
||||
},
|
||||
"nvim-web-devicons": {
|
||||
"rev": "2ae6958df7ced50baac5035cec0c15799eedfbf7",
|
||||
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
"onedark.nvim": {
|
||||
"rev": "49f5c94be68f6b00d333b1c8bdfb5329d899b734",
|
||||
"src": "https://github.com/jessarcher/onedark.nvim"
|
||||
},
|
||||
"plenary.nvim": {
|
||||
"rev": "74b06c6c75e4eeb3108ec01852001636d85a932b",
|
||||
"src": "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
"schemastore.nvim": {
|
||||
"rev": "73e89eb3e536a4dd8f991c963bd37189520c9919",
|
||||
"src": "https://github.com/b0o/schemastore.nvim"
|
||||
},
|
||||
"splitjoin.vim": {
|
||||
"rev": "b26971a7fdc7ca645b766459e3ed7949300c404f",
|
||||
"src": "https://github.com/AndrewRadev/splitjoin.vim"
|
||||
},
|
||||
"telescope-fzf-native.nvim": {
|
||||
"rev": "b25b749b9db64d375d782094e2b9dce53ad53a40",
|
||||
"src": "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
|
||||
},
|
||||
"telescope-live-grep-args.nvim": {
|
||||
"rev": "53e9df55b3651dd7cf77e172f1e8c9a17407acca",
|
||||
"src": "https://github.com/nvim-telescope/telescope-live-grep-args.nvim"
|
||||
},
|
||||
"telescope.nvim": {
|
||||
"rev": "40aedd8a68c78a656a10a8d62d80c54af59420fb",
|
||||
"src": "https://github.com/nvim-telescope/telescope.nvim"
|
||||
},
|
||||
"vim-commentary": {
|
||||
"rev": "64a654ef4a20db1727938338310209b6a63f60c9",
|
||||
"src": "https://github.com/tpope/vim-commentary"
|
||||
},
|
||||
"vim-eunuch": {
|
||||
"rev": "929490937745cd96130d3e7948f762f0aa403314",
|
||||
"src": "https://github.com/tpope/vim-eunuch"
|
||||
},
|
||||
"vim-fugitive": {
|
||||
"rev": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0",
|
||||
"src": "https://github.com/tpope/vim-fugitive"
|
||||
},
|
||||
"vim-heritage": {
|
||||
"rev": "574baeb0679681a710adce5110a0d8b2ae1c2637",
|
||||
"src": "https://github.com/jessarcher/vim-heritage"
|
||||
},
|
||||
"vim-lastplace": {
|
||||
"rev": "e58cb0df716d3c88605ae49db5c4741db8b48aa9",
|
||||
"src": "https://github.com/farmergreg/vim-lastplace"
|
||||
},
|
||||
"vim-pasta": {
|
||||
"rev": "2b786703eef9f82ae7a56f3de4ee43e1e5efaaa5",
|
||||
"src": "https://github.com/sickill/vim-pasta"
|
||||
},
|
||||
"vim-polyglot": {
|
||||
"rev": "f061eddb7cdcc614c8406847b2bfb53099832a4e",
|
||||
"src": "https://github.com/sheerun/vim-polyglot"
|
||||
},
|
||||
"vim-repeat": {
|
||||
"rev": "65846025c15494983dafe5e3b46c8f88ab2e9635",
|
||||
"src": "https://github.com/tpope/vim-repeat"
|
||||
},
|
||||
"vim-rhubarb": {
|
||||
"rev": "5496d7c94581c4c9ad7430357449bb57fc59f501",
|
||||
"src": "https://github.com/tpope/vim-rhubarb"
|
||||
},
|
||||
"vim-rooter": {
|
||||
"rev": "51402fb77c4d6ae94994e37dc7ca13bec8f4afcc",
|
||||
"src": "https://github.com/airblade/vim-rooter"
|
||||
},
|
||||
"vim-sleuth": {
|
||||
"rev": "be69bff86754b1aa5adcbb527d7fcd1635a84080",
|
||||
"src": "https://github.com/tpope/vim-sleuth"
|
||||
},
|
||||
"vim-surround": {
|
||||
"rev": "3d188ed2113431cf8dac77be61b842acb64433d9",
|
||||
"src": "https://github.com/tpope/vim-surround"
|
||||
},
|
||||
"vim-textobj-user": {
|
||||
"rev": "41a675ddbeefd6a93664a4dc52f302fe3086a933",
|
||||
"src": "https://github.com/kana/vim-textobj-user"
|
||||
},
|
||||
"vim-textobj-xmlattr": {
|
||||
"rev": "f08f3d2761c94d1bef2f28f10bc14bcd537f2679",
|
||||
"src": "https://github.com/whatyouhide/vim-textobj-xmlattr"
|
||||
},
|
||||
"vim-tmux-navigator": {
|
||||
"rev": "e41c431a0c7b7388ae7ba341f01a0d217eb3a432",
|
||||
"src": "https://github.com/christoomey/vim-tmux-navigator"
|
||||
},
|
||||
"vim-unimpaired": {
|
||||
"rev": "db65482581a28e4ccf355be297f1864a4e66985c",
|
||||
"src": "https://github.com/tpope/vim-unimpaired"
|
||||
},
|
||||
"vim-visual-star-search": {
|
||||
"rev": "37259722f45996733fd309add61385a4ad88bdb9",
|
||||
"src": "https://github.com/nelstrom/vim-visual-star-search"
|
||||
},
|
||||
"which-key.nvim": {
|
||||
"rev": "3aab2147e74890957785941f0c1ad87d0a44c15a",
|
||||
"src": "https://github.com/folke/which-key.nvim"
|
||||
}
|
||||
}
|
||||
}
|
||||
+14
-1
@@ -11,6 +11,15 @@ setw -g mode-keys vi
|
||||
# Improve colors
|
||||
set -g default-terminal "tmux-256color"
|
||||
set -as terminal-features ",xterm-256color:RGB"
|
||||
set -as terminal-features ",xterm-kitty:RGB"
|
||||
set -g allow-passthrough on
|
||||
|
||||
# Keep more scrollback in each pane.
|
||||
set -g history-limit 10000
|
||||
|
||||
# Preserve undercurl and undercurl colors for editors like Neovim.
|
||||
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'
|
||||
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'
|
||||
|
||||
# remove ESC delay
|
||||
set -s escape-time 0
|
||||
@@ -18,6 +27,11 @@ set -s escape-time 0
|
||||
# Status line
|
||||
#set-option -g status-style "fg=#000000,bg=#FF6600"
|
||||
set -g status-style fg=#000000,bg=#FF6600
|
||||
set -g status-left-length 100
|
||||
set -g status-right-length 100
|
||||
set -g window-status-format "#{window_index}:#{pane_current_command}#{window_flags} "
|
||||
set -g window-status-current-format "#{window_index}:#{pane_current_command}#{window_flags} "
|
||||
set -g window-status-activity-style none
|
||||
|
||||
# Start window and pane numbering at 1
|
||||
set -g base-index 1
|
||||
@@ -39,7 +53,6 @@ set -g status-position bottom
|
||||
#set -g status-fg white # white text
|
||||
|
||||
# Left side: session name and window list
|
||||
set -g status-left-length 30
|
||||
set -g status-left "#[fg=green]#S #[default]"
|
||||
|
||||
# Toggle mouse with Prefix + m
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
# Xdebug in Neovim
|
||||
|
||||
Neovim uses `nvim-dap` as the debug client, `nvim-dap-ui` for the debug panes,
|
||||
and Mason's `php-debug-adapter` to translate between DAP and Xdebug's DBGp
|
||||
protocol. VS Code is not required; the adapter's upstream project happens to be
|
||||
named `vscode-php-debug`.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The Neovim configuration installs the DAP plugins and Mason's
|
||||
`php-debug-adapter` supplies the executable. Install and enable Xdebug for the
|
||||
PHP runtime that serves the application, then configure it with at least:
|
||||
|
||||
```ini
|
||||
xdebug.mode=debug
|
||||
xdebug.start_with_request=trigger
|
||||
xdebug.client_port=9003
|
||||
```
|
||||
|
||||
For PHP running in Docker or on another machine, configure `xdebug.client_host`
|
||||
so it can reach the host running Neovim. Add `pathMappings` to
|
||||
`nvim/lua/tracer/plugins/dap.lua` when the PHP container's project path differs
|
||||
from the local project path, for example:
|
||||
|
||||
```lua
|
||||
pathMappings = { ["/var/www/html"] = "${workspaceFolder}" },
|
||||
```
|
||||
|
||||
## Workflow
|
||||
|
||||
Open the PHP file, set a breakpoint, and press `<leader>dc`; choose **Listen for
|
||||
Xdebug**. Trigger the request or command being debugged. The DAP UI opens when
|
||||
Xdebug connects and closes when the session ends.
|
||||
|
||||
| Key | Action |
|
||||
| --- | --- |
|
||||
| `<leader>dc` | Start or continue |
|
||||
| `<leader>db` | Toggle breakpoint |
|
||||
| `<leader>dB` | Set conditional breakpoint |
|
||||
| `<leader>do` / `<leader>di` / `<leader>dO` | Step over / into / out |
|
||||
| `<leader>dt` | Terminate session |
|
||||
| `<leader>dr` / `<leader>du` | Toggle REPL / UI |
|
||||
Reference in New Issue
Block a user