diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index a732040..a681330 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -139,8 +139,8 @@ input { kb_layout = us kb_variant = kb_model = - kb_options = kb_options = caps:swapescape - # kb_options = = + # kb_options = caps:swapescape + kb_options = kb_rules = follow_mouse = 1 @@ -186,6 +186,9 @@ bind = $mainMod, M, exec, ~/.local/bin/hyprland-monitor-switcher.sh bind = $mainMod SHIFT, L, exec, hyprlock bind = $mainMod, S, exec, hyprshot -m region --clipboard-only +bind = $mainMod, T, exec, ~/.local/bin/toggle-swapescape-hyprland +bind = $mainMod SHIFT, T, exec, ~/.local/bin/toggle-swapescape-hyprland + bind = $mainMod, Return, layoutmsg, swapwithmaster bind = $mainMod, j, layoutmsg, cyclenext bind = $mainMod, k, layoutmsg, cycleprev diff --git a/.config/nvim/lua/plugins/blink.lua b/.config/nvim/lua/plugins/blink.lua index 9b823fe..8dbe780 100644 --- a/.config/nvim/lua/plugins/blink.lua +++ b/.config/nvim/lua/plugins/blink.lua @@ -20,7 +20,6 @@ return { winblend = vim.o.pumblend, scrollbar = true, border = 'single', - max_items = 200, draw = { columns = { { "label", "label_description", gap = 1 }, diff --git a/.config/nvim/lua/plugins/conform.lua b/.config/nvim/lua/plugins/conform.lua index bd11c76..c56b811 100644 --- a/.config/nvim/lua/plugins/conform.lua +++ b/.config/nvim/lua/plugins/conform.lua @@ -10,6 +10,7 @@ return { go = { "goimports", "gofmt" }, javascript = { "prettierd" }, typescript = { "prettierd" }, + typescriptreact = { "prettierd" }, vue = { "prettierd" }, css = { "prettierd" }, html = { "prettierd" }, diff --git a/.config/nvim/lua/plugins/dap.lua b/.config/nvim/lua/plugins/dap.lua new file mode 100644 index 0000000..74570e7 --- /dev/null +++ b/.config/nvim/lua/plugins/dap.lua @@ -0,0 +1,93 @@ +return { + "mfussenegger/nvim-dap", + dependencies = { + "rcarriga/nvim-dap-ui", + "theHamsta/nvim-dap-virtual-text", + }, + config = function() + local dap = require("dap") + local dapui = require('dapui') + + -- Setup DAP UI with explicit configuration + dapui.setup() + + dap.adapters.php = { + type = 'executable', + command = vim.fn.stdpath('data') .. '/mason/bin/php-debug-adapter', + } + + -- Get the correct project paths (make this global so keys can access it) + _G.get_project_paths = function() + local cwd = vim.fn.getcwd() + + -- Check if we're in the project root (where docker-compose.yml is) + if vim.fn.filereadable(cwd .. "/docker-compose.yml") == 1 then + return { + project_root = cwd, + api_path = cwd .. "/app/api", + docker_path = "/var/www" + } + -- Check if we're in the app/api directory + elseif string.match(cwd, "app/api$") then + local project_root = string.gsub(cwd, "/app/api$", "") + return { + project_root = project_root, + api_path = cwd, + docker_path = "/var/www" + } + else + -- Fallback - assume we're somewhere in the project + return { + project_root = cwd, + api_path = cwd, + docker_path = "/var/www" + } + end + end + + local paths = _G.get_project_paths() + + -- PHP configurations + dap.configurations.php = { + { + name = "🚀 Jack Laravel - Listen for Xdebug", + type = "php", + request = "launch", + port = 9003, + pathMappings = { + [paths.docker_path] = paths.api_path, + }, + hostname = "0.0.0.0", + log = true, + xdebugSettings = { + max_children = 512, + max_data = 1024, + max_depth = 4, + }, + }, + { + name = "🌐 Jack Laravel - Web Request Debug", + type = "php", + request = "launch", + port = 9003, + pathMappings = { + ["/var/www"] = paths.api_path, + }, + hostname = "0.0.0.0", + -- Pre-configure for Laravel routes + breakMode = "request", + } + } + end, + keys = { + { "DD", function() require("dap").continue() end, desc = "Start Laravel Debug" }, + { "Ds", function() require("dap").step_over() end, desc = "Step Over" }, + { "Di", function() require("dap").step_into() end, desc = "Step Into" }, + { "Do", function() require("dap").step_out() end, desc = "Step Out" }, -- Fixed: was "Ds" twice + { "bp", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" }, + { "bP", function() require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: ")) end, desc = "Conditional Breakpoint" }, + { "dr", function() require("dap").repl.open() end, desc = "Open REPL" }, + { "dl", function() require("dap").run_last() end, desc = "Run Last" }, + { "du", function() require("dapui").toggle() end, desc = "Toggle DAP UI" }, + }, +} diff --git a/.config/nvim/lua/plugins/demicolon.lua b/.config/nvim/lua/plugins/demicolon.lua new file mode 100644 index 0000000..bf5197e --- /dev/null +++ b/.config/nvim/lua/plugins/demicolon.lua @@ -0,0 +1,8 @@ +return { + 'mawkler/demicolon.nvim', + dependencies = { + 'nvim-treesitter/nvim-treesitter', + 'nvim-treesitter/nvim-treesitter-textobjects', + }, + opts = {} +} diff --git a/.config/nvim/lua/plugins/fugitive.lua b/.config/nvim/lua/plugins/fugitive.lua index 0593c3b..6d86765 100644 --- a/.config/nvim/lua/plugins/fugitive.lua +++ b/.config/nvim/lua/plugins/fugitive.lua @@ -31,7 +31,6 @@ return { -- Additional useful fugitive buffer mappings map("n", "q", "close", "Close fugitive buffer", buf_opts) map("n", "gd", "Gvdiffsplit", "Git diff split", buf_opts) - map("n", "gb", "Git blame", "Git blame", buf_opts) end -- Auto-command for fugitive buffer mappings diff --git a/.config/nvim/lua/plugins/linting.lua b/.config/nvim/lua/plugins/linting.lua index 7d0c7b6..262aba3 100644 --- a/.config/nvim/lua/plugins/linting.lua +++ b/.config/nvim/lua/plugins/linting.lua @@ -54,6 +54,7 @@ return { lint.linters_by_ft = { javascript = { "eslint" }, typescript = { "eslint" }, + typescriptreact = { "eslint" }, vue = { "eslint" }, json = { "jsonlint" }, markdown = { "markdownlint" }, diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua index 1470502..1ebe415 100644 --- a/.config/nvim/lua/plugins/lspconfig.lua +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -3,16 +3,16 @@ return { event = { "BufReadPre", "BufNewFile" }, dependencies = { { "saghen/blink.cmp" }, - { "antosha417/nvim-lsp-file-operations", config = true }, - { "williamboman/mason.nvim", config = true }, - { "williamboman/mason-lspconfig.nvim" }, - { "WhoIsSethDaniel/mason-tool-installer.nvim" }, - { "j-hui/fidget.nvim", opts = {} }, - { "folke/neodev.nvim", opts = {} }, - { 'dmmulroy/ts-error-translator.nvim', opts = {} }, + { "antosha417/nvim-lsp-file-operations", config = true }, + { "williamboman/mason.nvim", config = true }, + { "williamboman/mason-lspconfig.nvim" }, + { "WhoIsSethDaniel/mason-tool-installer.nvim" }, + { "j-hui/fidget.nvim", opts = {} }, + { "folke/neodev.nvim", opts = {} }, + { 'dmmulroy/ts-error-translator.nvim', opts = {} }, + { 'mawkler/refjump.nvim', opts = {}, event = 'LspAttach', }, }, config = function() - local lspconfig = require("lspconfig") local utils = require("lsp.utils") vim.api.nvim_create_autocmd("LspAttach", { @@ -43,7 +43,7 @@ return { }, signs = true, underline = true, - update_in_insert = false, + update_in_insert = true, severity_sort = true, }) @@ -69,10 +69,16 @@ return { end end - -- Setup all servers + -- Setup all servers using the new vim.lsp.config and vim.lsp.enable APIs for server_name, server in pairs(servers) do + -- Merge capabilities server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {}) - lspconfig[server_name].setup(server) + + -- Use vim.lsp.config to define/customize the server configuration + vim.lsp.config(server_name, server) + + -- Use vim.lsp.enable to activate the server for its filetypes + vim.lsp.enable(server_name) end end, } diff --git a/.local/bin/toggle-swapescape-hyprland b/.local/bin/toggle-swapescape-hyprland new file mode 100755 index 0000000..5c35c2a --- /dev/null +++ b/.local/bin/toggle-swapescape-hyprland @@ -0,0 +1,17 @@ +#!/bin/bash + +# Script to toggle caps:swapescape setting in Hyprland +# Save this as ~/.config/hypr/scripts/toggle-caps-escape.sh + +# Check current state +current_setting=$(hyprctl getoption input:kb_options | grep -o "caps:swapescape" || echo "") + +if [ -n "$current_setting" ]; then + # Currently swapped, disable it + hyprctl keyword input:kb_options "" + notify-send "Keyboard Layout" "Caps Lock and Escape returned to normal" -i input-keyboard +else + # Not swapped, enable it + hyprctl keyword input:kb_options "caps:swapescape" + notify-send "Keyboard Layout" "Caps Lock and Escape swapped" -i input-keyboard +fi