2024-11-11 12:05:28 -05:00
|
|
|
-- Pull in core keybindings --
|
2024-03-03 18:01:30 -05:00
|
|
|
require("dan.core")
|
2024-11-11 12:05:28 -05:00
|
|
|
|
2024-03-03 18:01:30 -05:00
|
|
|
-- Lazy VIM --
|
|
|
|
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
|
|
|
|
if not vim.loop.fs_stat(lazypath) then
|
|
|
|
|
vim.fn.system({
|
|
|
|
|
"git",
|
|
|
|
|
"clone",
|
|
|
|
|
"--filter=blob:none",
|
|
|
|
|
"https://github.com/folke/lazy.nvim.git",
|
|
|
|
|
"--branch=stable", -- latest stable release
|
|
|
|
|
lazypath,
|
|
|
|
|
})
|
|
|
|
|
end
|
|
|
|
|
vim.opt.rtp:prepend(lazypath)
|
|
|
|
|
require("lazy").setup("plugins")
|
2024-11-11 12:05:28 -05:00
|
|
|
|
|
|
|
|
-- SET NEOVIM THEME --
|
2025-04-20 16:11:38 -04:00
|
|
|
vim.cmd "let g:everforest_background = 'hard'"
|
|
|
|
|
vim.cmd.colorscheme('everforest')
|
2024-11-11 12:05:28 -05:00
|
|
|
|
|
|
|
|
-- XDEBUG --
|
2024-10-20 12:25:10 -04:00
|
|
|
local dap = require('dap')
|
|
|
|
|
require('telescope').load_extension('dap')
|
|
|
|
|
dap.adapters.php = {
|
2024-10-29 08:46:19 -04:00
|
|
|
type = "executable",
|
|
|
|
|
command = "node",
|
|
|
|
|
args = { os.getenv("HOME") .. "/vscode-php-debug/out/phpDebug.js" }
|
2024-10-20 12:25:10 -04:00
|
|
|
}
|
|
|
|
|
dap.configurations.php = {
|
2024-10-29 08:46:19 -04:00
|
|
|
{
|
|
|
|
|
type = "php",
|
|
|
|
|
request = "launch",
|
|
|
|
|
name = "Listen for Xdebug",
|
|
|
|
|
port = 9003,
|
|
|
|
|
log = true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name = "listen for Xdebug docker",
|
|
|
|
|
type = "php",
|
|
|
|
|
request = "launch",
|
|
|
|
|
port = 9003,
|
2025-03-30 22:21:49 -04:00
|
|
|
log = true,
|
2024-10-29 08:46:19 -04:00
|
|
|
-- this is where your file is in the container
|
|
|
|
|
pathMappings = {
|
|
|
|
|
["/var/www/html/web"] = "${workspaceFolder}"
|
2024-10-20 12:25:10 -04:00
|
|
|
}
|
2024-10-29 08:46:19 -04:00
|
|
|
}
|
2024-10-20 12:25:10 -04:00
|
|
|
}
|
2025-04-12 14:51:42 -04:00
|
|
|
|
|
|
|
|
-- vim.cmd [[
|
|
|
|
|
-- highlight Normal guibg=none
|
|
|
|
|
-- highlight NonText guibg=none
|
|
|
|
|
-- highlight Normal ctermbg=none
|
|
|
|
|
-- highlight NonText ctermbg=none
|
|
|
|
|
-- ]]
|
|
|
|
|
|
2025-03-30 22:21:49 -04:00
|
|
|
vim.fn.sign_define('DapBreakpoint',{ text ='🟥', texthl ='', linehl ='', numhl =''})
|
|
|
|
|
vim.fn.sign_define('DapStopped',{ text ='▶️', texthl ='', linehl ='', numhl =''})
|
2024-10-20 12:25:10 -04:00
|
|
|
vim.keymap.set('n', '<leader>?', function() dap.continue() end)
|
|
|
|
|
vim.keymap.set('n', '<leader>N', function() dap.step_over() end)
|
|
|
|
|
vim.keymap.set('n', '<leader>n', function() dap.step_into() end)
|
|
|
|
|
vim.keymap.set('n', '<leader>E', function() dap.step_out() end)
|
|
|
|
|
vim.keymap.set('n', '<leader>b', function() dap.toggle_breakpoint() end)
|
|
|
|
|
vim.keymap.set('n', '<leader>B', function() dap.set_breakpoint() end)
|
|
|
|
|
vim.keymap.set('n', '<leader>dr', function() dap.repl.open() end)
|
|
|
|
|
vim.keymap.set('n', '<leader>dl', function() dap.run_last() end)
|
|
|
|
|
vim.keymap.set('n', '<leader>db', function()
|
|
|
|
|
local widgets = require('dap.ui.widgets')
|
|
|
|
|
widgets.centered_float(widgets.scopes)
|
|
|
|
|
end)
|
2024-03-03 18:01:30 -05:00
|
|
|
|
2024-11-12 08:08:18 -05:00
|
|
|
local lspconfig = require 'lspconfig'
|
|
|
|
|
local configs = require 'lspconfig.configs'
|
|
|
|
|
if not configs.drupal then
|
|
|
|
|
configs.drupal = {
|
|
|
|
|
default_config = {
|
|
|
|
|
cmd = {'drupal-lsp'},
|
|
|
|
|
filetypes = { 'php'},
|
|
|
|
|
root_dir = function(fname)
|
|
|
|
|
return lspconfig.util.root_pattern('composer.json', '.git')(fname)
|
|
|
|
|
end
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
lspconfig.drupal.setup{autostart = true }
|