lot of updates.

This commit is contained in:
Dan Chadwick 2024-10-20 12:25:10 -04:00
parent 914f9ea767
commit 7623c0265c
12 changed files with 189 additions and 97 deletions

View File

@ -13,4 +13,57 @@ if not vim.loop.fs_stat(lazypath) then
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins") 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', '<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', 'v'}, '<leader>dh', function()
require('dap.ui.widgets').hover()
end)
vim.keymap.set({'n', 'v'}, '<leader>dp', function()
require('dap.ui.widgets').preview()
end)
vim.keymap.set('n', '<leader>df', function()
local widgets = require('dap.ui.widgets')
widgets.centered_float(widgets.frames)
end)
vim.keymap.set('n', '<leader>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

View File

@ -1,23 +1,30 @@
{ {
"LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" }, "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" },
"alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, "alpha-nvim": { "branch": "main", "commit": "bf3c8bb8c02ed3d9644cc5bbc48e2bdc39349cd7" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "catppuccin": { "branch": "main", "commit": "7be452ee067978cdc8b2c5f3411f0c71ffa612b9" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" }, "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
"harpoon": { "branch": "harpoon2", "commit": "a38be6e0dd4c6db66997deab71fc4453ace97f9c" }, "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" },
"lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, "lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" },
"lazygit.nvim": { "branch": "main", "commit": "10a5f30536dc2d4abe36d410d83149272ea457fa" }, "lazygit.nvim": { "branch": "main", "commit": "56760339a81cd1540d5a72fd9d93010a2677b55d" },
"lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "21d33d69a81f6351e5a5f49078b2e4f0075c8e73" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" },
"mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "f3941c57ec85d7bdb44fa53fd858fd80f159018f" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"nui.nvim": { "branch": "main", "commit": "b81333d12f824dbed5eb231c8a4409a290fdd848" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" },
"nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" },
"nvim-lspconfig": { "branch": "master", "commit": "c932a56bf25167b1e88d2a1ebe35bb774b41019a" }, "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
"nvim-treesitter": { "branch": "master", "commit": "6e2b56cbe75ddf18e6efecee44bc3936d70b0b3e" }, "nvim-dap": { "branch": "master", "commit": "7ff6936010b7222fea2caea0f67ed77f1b7c60dd" },
"nvim-web-devicons": { "branch": "master", "commit": "4adea17610d140a99c313e3f79a9dc01825d59ae" }, "nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" },
"plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "52638640ae309cacdaff785fdbb854437bd1ee5c" },
"rose-pine": { "branch": "main", "commit": "f977eeba34b030b37f93ece2fbd792477606203b" }, "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-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" } "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
} "vim-commentary": { "branch": "master", "commit": "c4b8f52cbb7142ec239494e5a2c4a512f92c4d07" }
}

View File

@ -13,3 +13,12 @@ vim.cmd("set rnu")
vim.cmd("set number relativenumber") vim.cmd("set number relativenumber")
vim.cmd("set nu rnu") vim.cmd("set nu rnu")
vim.api.nvim_set_option("clipboard","unnamed") 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" })

BIN
lua/plugins/.DS_Store vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,55 @@
return {
'catppuccin/nvim',
priority = 1000,
name = "catppuccin",
config = function()
require("catppuccin").setup({
flavour = "macchiato", -- latte, frappe, macchiato, mocha
background = { -- :h background
light = "latte",
dark = "mocha",
},
transparent_background = false, -- disables setting the background color.
show_end_of_buffer = false, -- shows the '~' characters after the end of buffers
term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`)
dim_inactive = {
enabled = false, -- dims the background color of inactive window
shade = "dark",
percentage = 0.15, -- percentage of the shade to apply to the inactive window
},
no_italic = false, -- Force no italic
no_bold = false, -- Force no bold
no_underline = false, -- Force no underline
styles = { -- Handles the styles of general hi groups (see `:h highlight-args`):
comments = { "italic" }, -- Change the style of comments
conditionals = { "italic" },
loops = {},
functions = {},
keywords = {},
strings = {},
variables = {},
numbers = {},
booleans = {},
properties = {},
types = {},
operators = {},
-- miscs = {}, -- Uncomment to turn off hard-coded styles
},
color_overrides = {},
custom_highlights = {},
default_integrations = true,
integrations = {
cmp = true,
gitsigns = true,
nvimtree = true,
treesitter = true,
notify = false,
mini = {
enabled = true,
indentscope_color = "",
},
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
},
})
end
}

View File

@ -0,0 +1,3 @@
return {
"tpope/vim-commentary"
}

View File

@ -9,7 +9,7 @@ return {
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
config = function() config = function()
require("mason-lspconfig").setup({ require("mason-lspconfig").setup({
ensure_installed = { "lua_ls", "phpactor" } ensure_installed = { "lua_ls", "phpactor", "rust_analyzer" }
}) })
end end
}, },
@ -24,6 +24,9 @@ return {
lspconfig.phpactor.setup({ lspconfig.phpactor.setup({
capabilities = capabilities capabilities = capabilities
}) })
lspconfig.rust_analyzer.setup({
capabilities = capabilities
})
vim.keymap.set("n", 'K', vim.lsp.buf.hover, {}) vim.keymap.set("n", 'K', vim.lsp.buf.hover, {})
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {}) vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
vim.keymap.set({ 'n' }, '<leader>ca', vim.lsp.buf.code_action, {}) vim.keymap.set({ 'n' }, '<leader>ca', vim.lsp.buf.code_action, {})

View File

@ -1,7 +1,7 @@
return { return {
'nvim-lualine/lualine.nvim', 'nvim-lualine/lualine.nvim',
dependencies = { dependencies = {
'nvim-tree/nvim-web-devicons' 'nvim-tree/nvim-web-devicons'
}, },
config = function() config = function()
require('lualine'). setup({ require('lualine'). setup({

View File

@ -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
}

View File

@ -29,5 +29,11 @@ return {
-- load_extension, somewhere after setup function: -- load_extension, somewhere after setup function:
require("telescope").load_extension("ui-select") require("telescope").load_extension("ui-select")
end end
},
{
"nvim-telescope/telescope-dap.nvim",
config = function()
require('telescope').load_extension('dap')
end
} }
} }

View File

@ -4,7 +4,7 @@ return {
config = function() config = function()
local configs = require("nvim-treesitter.configs") local configs = require("nvim-treesitter.configs")
configs.setup({ configs.setup({
ensure_installed = { "php", "lua", "vim", "javascript", "html", "yaml" }, ensure_installed = { "php", "lua", "vim", "javascript", "html", "yaml", "twig" },
sync_install = false, sync_install = false,
highlight = { enable = true }, highlight = { enable = true },
indent = { enable = true }, indent = { enable = true },

29
lua/plugins/xdebug.lua Normal file
View File

@ -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
}
}