-- Project specific settings local M = {} -- Helper to create mappings local helpers = require 'helpers' local map = helpers.map -- Get the last folder name from a path local function project_name_from_cwd(cwd) return vim.fn.fnamemodify(cwd, ':t') end -- Define per-project configuration here. -- Keys are folder names (last segment of your cwd). local PROJECTS = { -- Example: a repo folder ['runcats'] = function(dir) -- local dump_buf = vim.api.nvim_create_buf(false, true) -- vim.api.nvim_set_option_value('bufhidden', 'hide', { buf = dump_buf }) -- vim.api.nvim_set_option_value('modifiable', false, { buf = dump_buf }) -- -- vim.fn.jobstart('cd server && sail artisan dump-server', { -- term = true, -- }) -- map('dd', function() -- local height = math.ceil(vim.o.lines * 0.8) -- local width = math.ceil(vim.o.columns * 0.8) -- vim.api.nvim_open_win(dump_buf, true, { -- style = 'minimal', -- relative = 'editor', -- width = width, -- height = height, -- row = math.ceil((vim.o.lines - height) / 2), -- col = math.ceil((vim.o.columns - width) / 2), -- border = 'single', -- }) -- -- vim.cmd.startinsert() -- end, { desc = 'Open the dump-server window' }) map( 'psl', ':cexpr system("cd server && vendor/bin/phpstan analyse --no-progress --error-format=raw --memory-limit=2G -vv") ', { desc = 'Run lint' } ) map('pcl', ':cexpr system("cd client && tsc --allowJs --removeComments --noEmit") ', { desc = 'Run lint' }) map('db', function() helpers.open_term { cmd = 'lazysql mysql://root@localhost:3306/runcats' } end, { desc = 'Open database manager' }) map('E', ':e .env', { desc = 'Edit .env file' }) map('s ', '!cd server && ', { desc = 'Run command in server directory' }, 'c') map('c ', '!cd client && ', { desc = 'Run command in client directory' }, 'c') map('sl ', '!cd server && vendor/bin/sail ', { desc = 'Run sail command' }, 'c') map('art ', '!cd server && php artisan ', { desc = 'Run artisan command' }, 'c') map('sart ', '!cd server && vendor/bin/sail artisan ', { desc = 'Run artisan command with sail' }, 'c') map('cmp ', '!cd server && composer ', { desc = 'Run composer script' }, 'c') map('yrn ', '!cd client && yarn ', { desc = 'Run yarn script' }, 'c') map('ts ', '!cd server && php artisan typescript:transform --format', { desc = 'Compile typescript' }, 'c') map('