| @ -0,0 +1,37 @@ | |||
| # Kanagawa Wave Alacritty Colors | |||
| [colors.primary] | |||
| background = '#1f1f28' | |||
| foreground = '#dcd7ba' | |||
| [colors.normal] | |||
| black = '#090618' | |||
| red = '#c34043' | |||
| green = '#76946a' | |||
| yellow = '#c0a36e' | |||
| blue = '#7e9cd8' | |||
| magenta = '#957fb8' | |||
| cyan = '#6a9589' | |||
| white = '#c8c093' | |||
| [colors.bright] | |||
| black = '#727169' | |||
| red = '#e82424' | |||
| green = '#98bb6c' | |||
| yellow = '#e6c384' | |||
| blue = '#7fb4ca' | |||
| magenta = '#938aa9' | |||
| cyan = '#7aa89f' | |||
| white = '#dcd7ba' | |||
| [colors.selection] | |||
| background = '#2d4f67' | |||
| foreground = '#c8c093' | |||
| [[colors.indexed_colors]] | |||
| index = 16 | |||
| color = '#ffa066' | |||
| [[colors.indexed_colors]] | |||
| index = 17 | |||
| color = '#ff5d62' | |||
| @ -1,7 +0,0 @@ | |||
| column_width = 160 | |||
| line_endings = "Unix" | |||
| indent_type = "Spaces" | |||
| indent_width = 2 | |||
| quote_style = "ForceDouble" | |||
| no_call_parentheses = false | |||
| collapse_simple_statement = "Always" | |||
| @ -1,9 +0,0 @@ | |||
| (directive) @function | |||
| (directive_start) @function | |||
| (directive_end) @function | |||
| (comment) @comment | |||
| ((parameter) @include (#set! "priority" 110)) | |||
| ((php_only) @include (#set! "priority" 110)) | |||
| ((bracket_start) @function (#set! "priority" 120)) | |||
| ((bracket_end) @function (#set! "priority" 120)) | |||
| (keyword) @function | |||
| @ -1,4 +0,0 @@ | |||
| ((text) @injection.content | |||
| (#not-has-ancestor? @injection.content "envoy") | |||
| (#set! injection.combined) | |||
| (#set! injection.language php)) | |||
| @ -1,2 +1,6 @@ | |||
| require('core') | |||
| require('lazy-plugin-manager') | |||
| require('core.options') | |||
| require('core.remaps') | |||
| require('core.autocmd') | |||
| require('core.commands') | |||
| require('plugins') | |||
| @ -1,35 +1,50 @@ | |||
| local function ToggleTabs() | |||
| local options = { "tabstop", "softtabstop", "shiftwidth" } | |||
| for _, option in ipairs(options) do | |||
| local current_value = vim.opt[option]:get() | |||
| vim.opt[option] = (current_value == 4) and 2 or 4 | |||
| end | |||
| end | |||
| vim.api.nvim_create_user_command("ToggleTabs", ToggleTabs, { nargs = 0 }) | |||
| vim.api.nvim_create_user_command("ToggleDiagnostics", function() | |||
| if vim.g.diagnostics_enable == nil or vim.g.diagnostics_enable then | |||
| vim.g.diagnostics_enable = false | |||
| vim.diagnostic.enable(false) | |||
| return | |||
| end | |||
| vim.g.diagnostics_enable = true | |||
| vim.diagnostic.enable(true) | |||
| end, {}) | |||
| vim.api.nvim_create_user_command("ClearBuffers", function() | |||
| vim.cmd('%bd|e#|bd#') | |||
| end, {}) | |||
| vim.api.nvim_create_user_command("CopyFilename", function() | |||
| vim.cmd('let @+ = expand("%")') | |||
| end, {}) | |||
| vim.api.nvim_create_user_command("SnakeToCamel", function() | |||
| vim.cmd([[%s#\%($\%(\k\+\)\)\@<=_\(\k\)#\u\1#g]]) | |||
| end, {}) | |||
| vim.api.nvim_create_user_command( | |||
| "ToggleTabs", | |||
| function() | |||
| local options = { "tabstop", "softtabstop", "shiftwidth" } | |||
| for _, option in ipairs(options) do | |||
| local current_value = vim.opt[option]:get() | |||
| vim.opt[option] = (current_value == 4) and 2 or 4 | |||
| end | |||
| end, | |||
| { nargs = 0 } | |||
| ) | |||
| vim.api.nvim_create_user_command( | |||
| "ToggleDiagnostics", | |||
| function() | |||
| if vim.g.diagnostics_enable == nil or vim.g.diagnostics_enable then | |||
| vim.g.diagnostics_enable = false | |||
| vim.diagnostic.enable(false) | |||
| return | |||
| end | |||
| vim.g.diagnostics_enable = true | |||
| vim.diagnostic.enable(true) | |||
| end, | |||
| {}) | |||
| vim.api.nvim_create_user_command( | |||
| "ClearBuffers", | |||
| function() | |||
| vim.cmd('%bd|e#|bd#') | |||
| end, | |||
| {} | |||
| ) | |||
| vim.api.nvim_create_user_command( | |||
| "CopyFilename", | |||
| function() | |||
| vim.cmd('let @+ = expand("%")') | |||
| end, | |||
| {} | |||
| ) | |||
| vim.api.nvim_create_user_command( | |||
| "SnakeToCamel", | |||
| function() | |||
| vim.cmd([[%s#\%($\%(\k\+\)\)\@<=_\(\k\)#\u\1#g]]) | |||
| end, | |||
| {} | |||
| ) | |||
| @ -1,4 +0,0 @@ | |||
| require('core.options') | |||
| require('core.remaps') | |||
| require('core.autocmd') | |||
| require('core.commands') | |||
| @ -1,25 +0,0 @@ | |||
| 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", | |||
| lazypath, | |||
| }) | |||
| end | |||
| vim.opt.rtp:prepend(lazypath) | |||
| require("lazy").setup({ | |||
| { import = "plugins" }, | |||
| }, { | |||
| checker = { | |||
| enabled = true, | |||
| notify = false, | |||
| }, | |||
| change_detection = { | |||
| notify = false, | |||
| }, | |||
| colorscheme = "cyberdream", | |||
| }) | |||
| @ -1,78 +0,0 @@ | |||
| local M = {} | |||
| -- Find global node_modules path | |||
| function M.find_node_modules_path() | |||
| local paths = { | |||
| "/usr/lib/node_modules", | |||
| "/usr/local/lib/node_modules", | |||
| "/opt/homebrew/lib/node_modules" | |||
| } | |||
| for _, path in ipairs(paths) do | |||
| if vim.loop.fs_stat(path) then | |||
| return path | |||
| end | |||
| end | |||
| return nil | |||
| end | |||
| -- Check if a file exists | |||
| function M.file_exists(path) | |||
| return vim.fn.filereadable(path) == 1 | |||
| end | |||
| -- Check if a directory exists | |||
| function M.dir_exists(path) | |||
| return vim.fn.isdirectory(path) == 1 | |||
| end | |||
| -- Get project root directory | |||
| function M.get_project_root() | |||
| return vim.loop.cwd() | |||
| end | |||
| -- Setup common LSP keymaps (you can move the keymap logic here if desired) | |||
| function M.setup_lsp_keymaps(bufnr) | |||
| local keymap = vim.keymap | |||
| local function map(mode, lhs, rhs, desc) | |||
| keymap.set(mode, lhs, rhs, { | |||
| buffer = bufnr, | |||
| noremap = true, | |||
| silent = true, | |||
| desc = desc | |||
| }) | |||
| end | |||
| -- Navigation (using Snacks.nvim picker) | |||
| map("n", "gr", function() Snacks.picker.lsp_references() end, "Show LSP references") | |||
| map("n", "gD", vim.lsp.buf.declaration, "Go to declaration") | |||
| map("n", "gd", function() Snacks.picker.lsp_definitions() end, "Show LSP definitions") | |||
| map("n", "gi", function() Snacks.picker.lsp_implementations() end, "Show LSP implementations") | |||
| map("n", "gt", function() Snacks.picker.lsp_type_definitions() end, "Show LSP type definitions") | |||
| -- Actions | |||
| map({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, "See available code actions") | |||
| map("n", "<leader>rn", vim.lsp.buf.rename, "Smart rename") | |||
| -- Diagnostics | |||
| map("n", "<leader>D", function() Snacks.picker.diagnostics({ buf = 0 }) end, "Show buffer diagnostics") | |||
| map("n", "<leader>d", vim.diagnostic.open_float, "Show line diagnostics") | |||
| map("n", "[d", function() | |||
| vim.diagnostic.jump({ count = -1 }) | |||
| end, "Go to previous diagnostic") | |||
| map("n", "]d", function() | |||
| vim.diagnostic.jump({ count = 1 }) | |||
| end, "Go to next diagnostic") | |||
| map("n", "[e", function() | |||
| vim.diagnostic.jump({ count = -1, severity = vim.diagnostic.severity.ERROR }) | |||
| end, "Go to previous diagnostic (error only)") | |||
| map("n", "]e", function() | |||
| vim.diagnostic.jump({ count = 1, severity = vim.diagnostic.severity.ERROR }) | |||
| end, "Go to next diagnostic (error only)") | |||
| -- Documentation | |||
| map("n", "K", vim.lsp.buf.hover, "Show documentation for what is under cursor") | |||
| end | |||
| return M | |||
| @ -1,163 +0,0 @@ | |||
| return { | |||
| 'saghen/blink.cmp', | |||
| event = { "InsertEnter", "CmdlineEnter" }, | |||
| dependencies = { | |||
| { 'rafamadriz/friendly-snippets' }, | |||
| { 'kristijanhusak/vim-dadbod-completion', ft = { 'sql', 'mysql', 'plsql' }, lazy = true }, | |||
| { 'saghen/blink.compat', version = '2.*', lazy = true, opts = {} }, | |||
| }, | |||
| version = '1.*', | |||
| opts = { | |||
| completion = { | |||
| accept = { | |||
| auto_brackets = { | |||
| enabled = true, | |||
| }, | |||
| }, | |||
| menu = { | |||
| auto_show = true, | |||
| winblend = vim.o.pumblend, | |||
| scrollbar = true, | |||
| border = 'single', | |||
| draw = { | |||
| columns = { | |||
| { "label", "label_description", gap = 1 }, | |||
| { "kind_icon", "kind", gap = 1 } | |||
| }, | |||
| components = { | |||
| kind_icon = { | |||
| ellipsis = false, | |||
| text = function(ctx) | |||
| return ctx.kind_icon .. ctx.icon_gap | |||
| end, | |||
| highlight = function(ctx) | |||
| return 'BlinkCmpKind' .. ctx.kind | |||
| end, | |||
| } | |||
| }, | |||
| treesitter = { "lsp" } | |||
| } | |||
| }, | |||
| documentation = { | |||
| auto_show = true, | |||
| auto_show_delay_ms = 200, | |||
| update_delay_ms = 50, | |||
| window = { | |||
| border = 'single', | |||
| winblend = vim.o.pumblend, | |||
| max_width = 80, | |||
| max_height = 20, | |||
| } | |||
| }, | |||
| ghost_text = { | |||
| enabled = vim.g.ai_cmp or false, | |||
| }, | |||
| }, | |||
| appearance = { | |||
| use_nvim_cmp_as_default = true, | |||
| nerd_font_variant = 'mono' | |||
| }, | |||
| sources = { | |||
| default = { | |||
| 'lsp', | |||
| 'path', | |||
| 'snippets', | |||
| 'buffer', | |||
| 'dadbod', | |||
| 'laravel', | |||
| }, | |||
| providers = { | |||
| dadbod = { | |||
| name = "Dadbod", | |||
| module = "vim_dadbod_completion.blink", | |||
| score_offset = 85, | |||
| }, | |||
| laravel = { | |||
| name = "laravel", | |||
| module = "blink.compat.source", | |||
| score_offset = 80, | |||
| }, | |||
| lsp = { | |||
| name = "LSP", | |||
| module = "blink.cmp.sources.lsp", | |||
| score_offset = 90, | |||
| }, | |||
| path = { | |||
| name = "Path", | |||
| module = "blink.cmp.sources.path", | |||
| score_offset = 3, | |||
| opts = { | |||
| trailing_slash = false, | |||
| label_trailing_slash = true, | |||
| get_cwd = function(context) return vim.fn.getcwd() end, | |||
| show_hidden_files_by_default = true, | |||
| } | |||
| }, | |||
| snippets = { | |||
| name = "Snippets", | |||
| module = "blink.cmp.sources.snippets", | |||
| score_offset = 85, | |||
| opts = { | |||
| friendly_snippets = true, | |||
| search_paths = { vim.fn.stdpath("config") .. "/snippets" }, | |||
| global_snippets = { "all" }, | |||
| extended_filetypes = {}, | |||
| ignored_filetypes = {}, | |||
| } | |||
| }, | |||
| buffer = { | |||
| name = "Buffer", | |||
| module = "blink.cmp.sources.buffer", | |||
| opts = { | |||
| max_items = 5, | |||
| keyword_length = 2, | |||
| } | |||
| }, | |||
| cmdline = { | |||
| name = "Cmdline", | |||
| module = "blink.cmp.sources.cmdline", | |||
| }, | |||
| }, | |||
| }, | |||
| cmdline = { | |||
| sources = function() | |||
| local type = vim.fn.getcmdtype() | |||
| if type == "/" or type == "?" then | |||
| return { 'buffer' } | |||
| end | |||
| if type == ":" then | |||
| return { 'cmdline' } | |||
| end | |||
| return {} | |||
| end, | |||
| }, | |||
| signature = { | |||
| enabled = true, | |||
| window = { | |||
| border = 'single', | |||
| winblend = vim.o.pumblend, | |||
| }, | |||
| }, | |||
| }, | |||
| opts_extend = { "sources.default" }, | |||
| config = function(_, opts) | |||
| require('blink.cmp').setup(opts) | |||
| -- Optional: Set up highlights | |||
| vim.api.nvim_set_hl(0, 'BlinkCmpMenu', { link = 'Pmenu' }) | |||
| vim.api.nvim_set_hl(0, 'BlinkCmpMenuBorder', { link = 'Pmenu' }) | |||
| vim.api.nvim_set_hl(0, 'BlinkCmpMenuSelection', { link = 'PmenuSel' }) | |||
| vim.api.nvim_set_hl(0, 'BlinkCmpDoc', { link = 'NormalFloat' }) | |||
| vim.api.nvim_set_hl(0, 'BlinkCmpDocBorder', { link = 'FloatBorder' }) | |||
| vim.api.nvim_set_hl(0, 'BlinkCmpSignatureHelp', { link = 'NormalFloat' }) | |||
| vim.api.nvim_set_hl(0, 'BlinkCmpSignatureHelpBorder', { link = 'FloatBorder' }) | |||
| end | |||
| } | |||
| @ -1,5 +0,0 @@ | |||
| return { | |||
| "NvChad/nvim-colorizer.lua", | |||
| event = { "BufReadPre", "BufNewFile" }, | |||
| config = true, | |||
| } | |||
| @ -1,134 +0,0 @@ | |||
| return { | |||
| { | |||
| "rebelot/kanagawa.nvim", | |||
| enabled = false, | |||
| priority = 1000, | |||
| config = function() | |||
| -- Default options: | |||
| require("kanagawa").setup({ | |||
| compile = false, -- enable compiling the colorscheme | |||
| undercurl = true, -- enable undercurls | |||
| commentStyle = { italic = true }, | |||
| functionStyle = {}, | |||
| keywordStyle = { italic = true }, | |||
| statementStyle = { bold = true }, | |||
| typeStyle = {}, | |||
| transparent = true, -- do not set background color | |||
| dimInactive = false, -- dim inactive window `:h hl-NormalNC` | |||
| terminalColors = true, -- define vim.g.terminal_color_{0,17} | |||
| colors = { -- add/modify theme and palette colors | |||
| palette = {}, | |||
| theme = { wave = {}, lotus = {}, dragon = {}, all = {} }, | |||
| }, | |||
| overrides = function(colors) -- add/modify highlights | |||
| return {} | |||
| end, | |||
| theme = "wave", -- Load "wave" theme when 'background' option is not set | |||
| background = { -- map the value of 'background' option to a theme | |||
| dark = "wave", -- try "dragon" ! | |||
| light = "lotus", | |||
| }, | |||
| }) | |||
| -- setup must be called before loading | |||
| require("kanagawa").load("wave") | |||
| end, | |||
| }, | |||
| { | |||
| "scottmckendry/cyberdream.nvim", | |||
| lazy = false, | |||
| priority = 1000, | |||
| enabled = false, | |||
| config = function() | |||
| require("cyberdream").setup({ | |||
| variant = "default", | |||
| transparent = true, | |||
| saturation = 1, -- accepts a value between 0 and 1. 0 will be fully desaturated (greyscale) and 1 will be the full color (default) | |||
| italic_comments = false, | |||
| hide_fillchars = false, | |||
| borderless_pickers = false, | |||
| terminal_colors = true, | |||
| cache = true, | |||
| -- Override highlight groups with your own colour values | |||
| highlights = { | |||
| -- Highlight groups to override, adding new groups is also possible | |||
| -- See `:h highlight-groups` for a list of highlight groups or run `:hi` to see all groups and their current values | |||
| -- Example: | |||
| Comment = { fg = "#696969", bg = "NONE", italic = true }, | |||
| -- More examples can be found in `lua/cyberdream/extensions/*.lua` | |||
| }, | |||
| -- Override a highlight group entirely using the built-in colour palette | |||
| -- overrides = function(colors) -- NOTE: This function nullifies the `highlights` option | |||
| -- -- Example: | |||
| -- return { | |||
| -- Comment = { fg = colors.green, bg = "NONE", italic = true }, | |||
| -- ["@property"] = { fg = colors.magenta, bold = true }, | |||
| -- } | |||
| -- end, | |||
| -- Disable or enable colorscheme extensions | |||
| extensions = { | |||
| mini = true, | |||
| }, | |||
| }) | |||
| vim.cmd("colorscheme cyberdream") | |||
| end | |||
| }, | |||
| { | |||
| "EdenEast/nightfox.nvim", | |||
| lazy = false, | |||
| enabled = false, | |||
| priority = 1000, | |||
| opts = { | |||
| options = { | |||
| compile_path = vim.fn.stdpath("cache") .. "/nightfox", | |||
| compile_file_suffix = "_compiled", | |||
| transparent = false, | |||
| terminal_colors = true, | |||
| dim_inactive = false, | |||
| module_default = true, | |||
| colorblind = { | |||
| enable = false, | |||
| simulate_only = false, | |||
| severity = { | |||
| protan = 0, | |||
| deutan = 0, | |||
| tritan = 0, | |||
| }, | |||
| }, | |||
| styles = { | |||
| comments = "italic", | |||
| conditionals = "NONE", | |||
| constants = "NONE", | |||
| functions = "NONE", | |||
| keywords = "NONE", | |||
| numbers = "NONE", | |||
| operators = "NONE", | |||
| strings = "NONE", | |||
| types = "NONE", | |||
| variables = "NONE", | |||
| }, | |||
| inverse = { | |||
| match_paren = false, | |||
| visual = false, | |||
| search = false, | |||
| }, | |||
| } | |||
| }, | |||
| config = function(_, opts) | |||
| require("nightfox").setup(opts) | |||
| vim.cmd("colorscheme carbonfox") | |||
| end | |||
| }, | |||
| { | |||
| "olimorris/onedarkpro.nvim", | |||
| priority = 1000, -- Ensure it loads first | |||
| config = function() | |||
| vim.cmd("colorscheme onedark") | |||
| end, | |||
| } | |||
| } | |||
| @ -1,54 +0,0 @@ | |||
| return { | |||
| "stevearc/conform.nvim", | |||
| event = { "BufReadPre", "BufNewFile" }, | |||
| config = function() | |||
| local conform = require("conform") | |||
| conform.setup({ | |||
| formatters_by_ft = { | |||
| lua = { "stylua" }, | |||
| go = { "goimports", "gofmt" }, | |||
| javascript = { "prettierd" }, | |||
| typescript = { "prettierd" }, | |||
| typescriptreact = { "prettierd" }, | |||
| vue = { "prettierd" }, | |||
| css = { "prettierd" }, | |||
| html = { "prettierd" }, | |||
| markdown = { "prettierd" }, | |||
| json = { "fixjson" }, | |||
| rust = { "rustfmt" }, | |||
| shell = { "shfmt", "shellcheck" }, | |||
| python = { "isort", "black" }, | |||
| php = { "phpcbf", "php_cs_fixer" }, | |||
| blade = { "blade-formatter" } | |||
| }, | |||
| log_level = vim.log.levels.WARN, | |||
| notify_on_error = false, | |||
| }) | |||
| vim.keymap.set({ "n", "v" }, "<leader>F", function() | |||
| conform.format({ | |||
| lsp_fallback = true, | |||
| async = false, | |||
| timeout_ms = 500, | |||
| }) | |||
| end) | |||
| vim.fn.mkdir(vim.fn.expand("~/.cache/php-cs-fixer"), "p") | |||
| conform.formatters.php_cs_fixer = { | |||
| prepend_args = { | |||
| "--config=" .. vim.fn.expand("~/.config/php-cs-fixer.php"), | |||
| "--cache-file=" .. vim.fn.expand("~/.cache/php-cs-fixer/cache"), | |||
| }, | |||
| env = { | |||
| PHP_CS_FIXER_IGNORE_ENV = "1", | |||
| }, | |||
| } | |||
| conform.formatters.phpcbf = { | |||
| prepend_args = { "--standard=~/.config/phpcs.xml" }, | |||
| } | |||
| end, | |||
| } | |||
| @ -1,7 +0,0 @@ | |||
| return { | |||
| 'hat0uma/csvview.nvim', | |||
| event = { "BufReadPre", "BufNewFile" }, | |||
| config = function() | |||
| require('csvview').setup() | |||
| end | |||
| } | |||
| @ -1,40 +0,0 @@ | |||
| return { | |||
| 'kristijanhusak/vim-dadbod-ui', | |||
| dependencies = { | |||
| { 'tpope/vim-dadbod', lazy = true }, | |||
| { 'kristijanhusak/vim-dadbod-completion', ft = { 'sql', 'mysql', 'plsql' }, lazy = true }, -- Optional | |||
| }, | |||
| cmd = { | |||
| 'DBUI', | |||
| 'DBUIToggle', | |||
| 'DBUIAddConnection', | |||
| 'DBUIFindBuffer', | |||
| }, | |||
| init = function() | |||
| -- Your DBUI configuration | |||
| vim.g.db_ui_use_nerd_fonts = 1 | |||
| vim.g.db_ui_auto_execute_table_helpers = 1 | |||
| vim.g.dbs = { | |||
| dev = 'mysql://jack:secret@localhost:33061/jack?protocol=tcp', | |||
| dev_prod_dump = 'mysql://root:secret@localhost:33061/jac_prod?protocol=tcp', | |||
| } | |||
| vim.api.nvim_create_user_command('DBUITab', function() | |||
| vim.cmd('tabnew') | |||
| vim.cmd('DBUI') | |||
| end, { desc = 'Open DBUI in a new tab' }) | |||
| vim.keymap.set('n', '<leader>db', function () | |||
| vim.cmd('tabnew') | |||
| vim.cmd('DBUI') | |||
| end, { desc = 'Open DBUI in a new tab' }) | |||
| vim.api.nvim_create_autocmd("FileType", { | |||
| pattern = {"dbout", "dbui"}, | |||
| callback = function() | |||
| vim.opt_local.foldenable = false | |||
| end, | |||
| }) | |||
| end, | |||
| } | |||
| @ -1,8 +0,0 @@ | |||
| return { | |||
| 'mawkler/demicolon.nvim', | |||
| dependencies = { | |||
| 'nvim-treesitter/nvim-treesitter', | |||
| 'nvim-treesitter/nvim-treesitter-textobjects', | |||
| }, | |||
| opts = {} | |||
| } | |||
| @ -1,11 +1,16 @@ | |||
| return { | |||
| "sindrets/diffview.nvim", | |||
| opts = { | |||
| local M = {} | |||
| M.install = { src = "https://github.com/sindrets/diffview.nvim" } | |||
| M.setup = function() | |||
| require("diffview").setup({ | |||
| enhanced_diff_hl = true, | |||
| view = { | |||
| merge_tool = { | |||
| layout = "diff3_mixed", -- or "diff3_horizontal" | |||
| layout = "diff3_mixed", -- or "diff3_horizontal" | |||
| }, | |||
| }, | |||
| }, | |||
| } | |||
| }) | |||
| end | |||
| return M | |||
| @ -1,53 +0,0 @@ | |||
| return { | |||
| "folke/flash.nvim", | |||
| event = "VeryLazy", | |||
| opts = { | |||
| modes = { | |||
| char = { | |||
| enabled = false, | |||
| }, | |||
| }, | |||
| }, | |||
| keys = { | |||
| { | |||
| "s", | |||
| mode = { "n", "x", "o" }, | |||
| function() | |||
| require("flash").jump() | |||
| end, | |||
| desc = "Flash", | |||
| }, | |||
| { | |||
| "S", | |||
| mode = { "n", "x", "o" }, | |||
| function() | |||
| require("flash").treesitter() | |||
| end, | |||
| desc = "Flash Treesitter", | |||
| }, | |||
| { | |||
| "r", | |||
| mode = "o", | |||
| function() | |||
| require("flash").remote() | |||
| end, | |||
| desc = "Remote Flash", | |||
| }, | |||
| { | |||
| "R", | |||
| mode = { "o", "x" }, | |||
| function() | |||
| require("flash").treesitter_search() | |||
| end, | |||
| desc = "Treesitter Search", | |||
| }, | |||
| { | |||
| "<c-s>", | |||
| mode = { "c" }, | |||
| function() | |||
| require("flash").toggle() | |||
| end, | |||
| desc = "Toggle Flash Search", | |||
| }, | |||
| }, | |||
| } | |||
| @ -1,7 +0,0 @@ | |||
| return { | |||
| 'akinsho/flutter-tools.nvim', | |||
| lazy = false, | |||
| dependencies = { | |||
| 'nvim-lua/plenary.nvim', | |||
| }, | |||
| } | |||
| @ -1,179 +1,168 @@ | |||
| return { | |||
| { | |||
| "tpope/vim-fugitive", | |||
| event = "VeryLazy", | |||
| dependencies = { | |||
| "shumphrey/fugitive-gitlab.vim", | |||
| }, | |||
| config = function() | |||
| -- Git diff settings | |||
| vim.opt.diffopt:append("vertical") | |||
| vim.opt.display:append("lastline") | |||
| -- Helper function for consistent keymap creation | |||
| local function map(mode, lhs, rhs, desc, opts) | |||
| opts = opts or {} | |||
| opts.desc = desc | |||
| opts.noremap = true | |||
| opts.silent = true | |||
| vim.keymap.set(mode, lhs, rhs, opts) | |||
| end | |||
| -- Buffer-local mappings for fugitive buffers | |||
| local function set_fugitive_buffer_mappings() | |||
| local buf_opts = { buffer = 0, noremap = true, silent = true } | |||
| -- Git operations | |||
| map("n", "<leader>gp", "<cmd>Git push<CR>", "Git push", buf_opts) | |||
| map("n", "<leader>gP", "<cmd>Git pull<CR>", "Git pull", buf_opts) | |||
| map("n", "<leader>gc", "<cmd>Git commit<CR>", "Git commit", buf_opts) | |||
| -- Additional useful fugitive buffer mappings | |||
| map("n", "q", "<cmd>close<CR>", "Close fugitive buffer", buf_opts) | |||
| map("n", "<leader>gd", "<cmd>Gvdiffsplit<CR>", "Git diff split", buf_opts) | |||
| end | |||
| -- Auto-command for fugitive buffer mappings | |||
| local fugitive_augroup = vim.api.nvim_create_augroup("fugitive_mappings", { clear = true }) | |||
| vim.api.nvim_create_autocmd("FileType", { | |||
| group = fugitive_augroup, | |||
| pattern = "fugitive", | |||
| callback = set_fugitive_buffer_mappings, | |||
| desc = "Set fugitive buffer-local mappings", | |||
| }) | |||
| -- Enhanced line-based git log function | |||
| local function git_log_range() | |||
| local mode = vim.fn.mode() | |||
| local start_line, end_line | |||
| if mode == 'V' or mode == 'v' then | |||
| -- Visual mode - get selected range | |||
| local start_pos = vim.fn.getpos("'<") | |||
| local end_pos = vim.fn.getpos("'>") | |||
| start_line = start_pos[2] | |||
| end_line = end_pos[2] | |||
| else | |||
| -- Normal mode - use current line | |||
| start_line = vim.fn.line(".") | |||
| end_line = start_line | |||
| end | |||
| -- Validate line numbers | |||
| if start_line <= 0 or end_line <= 0 then | |||
| vim.notify("Invalid line range selected", vim.log.levels.WARN) | |||
| return | |||
| end | |||
| local filepath = vim.fn.expand("%:.") | |||
| if filepath == "" then | |||
| vim.notify("No file in current buffer", vim.log.levels.WARN) | |||
| return | |||
| end | |||
| -- Ensure proper order | |||
| if start_line > end_line then | |||
| start_line, end_line = end_line, start_line | |||
| end | |||
| local cmd = string.format("Git log -L %d,%d:%s", start_line, end_line, filepath) | |||
| vim.cmd(cmd) | |||
| end | |||
| -- Global git mappings | |||
| map("n", "<leader>gg", function() | |||
| vim.cmd("Git") | |||
| end, "Open git status") | |||
| map("n", "<leader>gl", function() | |||
| vim.cmd("Git log --oneline -20") | |||
| end, "Git log (last 20)") | |||
| map("n", "<leader>gL", function() | |||
| vim.cmd("Git log") | |||
| end, "Git log (detailed)") | |||
| map({ "n", "v" }, "<leader>gr", git_log_range, "Git log for range/line") | |||
| map("n", "<leader>gs", function() | |||
| vim.cmd("Git status") | |||
| end, "Git status") | |||
| map("n", "<leader>gd", function() | |||
| vim.cmd("Gvdiffsplit") | |||
| end, "Git diff split") | |||
| map("n", "<leader>gb", function() | |||
| vim.cmd("Git blame") | |||
| end, "Git blame") | |||
| map("n", "<leader>ga", function() | |||
| vim.cmd("Git add %") | |||
| end, "Git add current file") | |||
| map("n", "<leader>gA", function() | |||
| vim.cmd("Git add .") | |||
| end, "Git add all") | |||
| -- Git stash operations | |||
| map("n", "<leader>gss", function() | |||
| vim.cmd("Git stash") | |||
| end, "Git stash") | |||
| map("n", "<leader>gsp", function() | |||
| vim.cmd("Git stash pop") | |||
| end, "Git stash pop") | |||
| map("n", "<leader>gsl", function() | |||
| vim.cmd("Git stash list") | |||
| end, "Git stash list") | |||
| -- Branch operations | |||
| map("n", "<leader>gco", function() | |||
| local branch = vim.fn.input("Branch name: ") | |||
| if branch ~= "" then | |||
| vim.cmd("Git checkout " .. branch) | |||
| end | |||
| end, "Git checkout branch") | |||
| map("n", "<leader>gcb", function() | |||
| local branch = vim.fn.input("New branch name: ") | |||
| if branch ~= "" then | |||
| vim.cmd("Git checkout -b " .. branch) | |||
| end | |||
| end, "Git create and checkout branch") | |||
| -- Additional autocmds for better fugitive experience | |||
| vim.api.nvim_create_autocmd("FileType", { | |||
| group = fugitive_augroup, | |||
| pattern = "gitcommit", | |||
| callback = function() | |||
| -- Enable spell checking for commit messages | |||
| vim.opt_local.spell = true | |||
| vim.opt_local.spelllang = "en_us" | |||
| -- Position cursor at the beginning | |||
| vim.cmd("startinsert") | |||
| end, | |||
| desc = "Git commit buffer settings", | |||
| }) | |||
| -- Auto-close fugitive buffers when done | |||
| vim.api.nvim_create_autocmd("BufReadPost", { | |||
| group = fugitive_augroup, | |||
| pattern = "fugitive:*", | |||
| callback = function() | |||
| vim.opt_local.bufhidden = "delete" | |||
| end, | |||
| desc = "Auto-delete fugitive buffers", | |||
| }) | |||
| local M = {} | |||
| M.install = { src = "https://github.com/tpope/vim-fugitive" } | |||
| M.setup = function() | |||
| -- Git diff settings | |||
| vim.opt.diffopt:append("vertical") | |||
| vim.opt.display:append("lastline") | |||
| -- Helper function for consistent keymap creation | |||
| local function map(mode, lhs, rhs, desc, opts) | |||
| opts = opts or {} | |||
| opts.desc = desc | |||
| opts.noremap = true | |||
| opts.silent = true | |||
| vim.keymap.set(mode, lhs, rhs, opts) | |||
| end | |||
| -- Buffer-local mappings for fugitive buffers | |||
| local function set_fugitive_buffer_mappings() | |||
| local buf_opts = { buffer = 0, noremap = true, silent = true } | |||
| -- Git operations | |||
| map("n", "<leader>gp", "<cmd>Git push<CR>", "Git push", buf_opts) | |||
| map("n", "<leader>gP", "<cmd>Git pull<CR>", "Git pull", buf_opts) | |||
| map("n", "<leader>gc", "<cmd>Git commit<CR>", "Git commit", buf_opts) | |||
| -- Additional useful fugitive buffer mappings | |||
| map("n", "q", "<cmd>close<CR>", "Close fugitive buffer", buf_opts) | |||
| map("n", "<leader>gd", "<cmd>Gvdiffsplit<CR>", "Git diff split", buf_opts) | |||
| end | |||
| -- Auto-command for fugitive buffer mappings | |||
| local fugitive_augroup = vim.api.nvim_create_augroup("fugitive_mappings", { clear = true }) | |||
| vim.api.nvim_create_autocmd("FileType", { | |||
| group = fugitive_augroup, | |||
| pattern = "fugitive", | |||
| callback = set_fugitive_buffer_mappings, | |||
| desc = "Set fugitive buffer-local mappings", | |||
| }) | |||
| -- Enhanced line-based git log function | |||
| local function git_log_range() | |||
| local mode = vim.fn.mode() | |||
| local start_line, end_line | |||
| if mode == 'V' or mode == 'v' then | |||
| -- Visual mode - get selected range | |||
| local start_pos = vim.fn.getpos("'<") | |||
| local end_pos = vim.fn.getpos("'>") | |||
| start_line = start_pos[2] | |||
| end_line = end_pos[2] | |||
| else | |||
| -- Normal mode - use current line | |||
| start_line = vim.fn.line(".") | |||
| end_line = start_line | |||
| end | |||
| -- Validate line numbers | |||
| if start_line <= 0 or end_line <= 0 then | |||
| vim.notify("Invalid line range selected", vim.log.levels.WARN) | |||
| return | |||
| end | |||
| local filepath = vim.fn.expand("%:.") | |||
| if filepath == "" then | |||
| vim.notify("No file in current buffer", vim.log.levels.WARN) | |||
| return | |||
| end | |||
| -- Ensure proper order | |||
| if start_line > end_line then | |||
| start_line, end_line = end_line, start_line | |||
| end | |||
| local cmd = string.format("Git log -L %d,%d:%s", start_line, end_line, filepath) | |||
| vim.cmd(cmd) | |||
| end | |||
| -- Global git mappings | |||
| map("n", "<leader>gg", function() | |||
| vim.cmd("Git") | |||
| end, "Open git status") | |||
| map("n", "<leader>gl", function() | |||
| vim.cmd("Git log --oneline -20") | |||
| end, "Git log (last 20)") | |||
| map("n", "<leader>gL", function() | |||
| vim.cmd("Git log") | |||
| end, "Git log (detailed)") | |||
| map({ "n", "v" }, "<leader>gr", git_log_range, "Git log for range/line") | |||
| map("n", "<leader>gs", function() | |||
| vim.cmd("Git status") | |||
| end, "Git status") | |||
| map("n", "<leader>gd", function() | |||
| vim.cmd("Gvdiffsplit") | |||
| end, "Git diff split") | |||
| map("n", "<leader>gb", function() | |||
| vim.cmd("Git blame") | |||
| end, "Git blame") | |||
| map("n", "<leader>ga", function() | |||
| vim.cmd("Git add %") | |||
| end, "Git add current file") | |||
| map("n", "<leader>gA", function() | |||
| vim.cmd("Git add .") | |||
| end, "Git add all") | |||
| -- Git stash operations | |||
| map("n", "<leader>gss", function() | |||
| vim.cmd("Git stash") | |||
| end, "Git stash") | |||
| map("n", "<leader>gsp", function() | |||
| vim.cmd("Git stash pop") | |||
| end, "Git stash pop") | |||
| map("n", "<leader>gsl", function() | |||
| vim.cmd("Git stash list") | |||
| end, "Git stash list") | |||
| -- Branch operations | |||
| map("n", "<leader>gco", function() | |||
| local branch = vim.fn.input("Branch name: ") | |||
| if branch ~= "" then | |||
| vim.cmd("Git checkout " .. branch) | |||
| end | |||
| end, "Git checkout branch") | |||
| map("n", "<leader>gcb", function() | |||
| local branch = vim.fn.input("New branch name: ") | |||
| if branch ~= "" then | |||
| vim.cmd("Git checkout -b " .. branch) | |||
| end | |||
| end, "Git create and checkout branch") | |||
| -- Additional autocmds for better fugitive experience | |||
| vim.api.nvim_create_autocmd("FileType", { | |||
| group = fugitive_augroup, | |||
| pattern = "gitcommit", | |||
| callback = function() | |||
| -- Enable spell checking for commit messages | |||
| vim.opt_local.spell = true | |||
| vim.opt_local.spelllang = "en_us" | |||
| -- Position cursor at the beginning | |||
| vim.cmd("startinsert") | |||
| end, | |||
| }, | |||
| { | |||
| "rbong/vim-flog", | |||
| lazy = true, | |||
| cmd = { "Flog", "Flogsplit", "Floggit" }, | |||
| dependencies = { | |||
| "tpope/vim-fugitive", | |||
| }, | |||
| }, | |||
| } | |||
| desc = "Git commit buffer settings", | |||
| }) | |||
| -- Auto-close fugitive buffers when done | |||
| vim.api.nvim_create_autocmd("BufReadPost", { | |||
| group = fugitive_augroup, | |||
| pattern = "fugitive:*", | |||
| callback = function() | |||
| vim.opt_local.bufhidden = "delete" | |||
| end, | |||
| desc = "Auto-delete fugitive buffers", | |||
| }) | |||
| end | |||
| return M | |||
| @ -1,22 +0,0 @@ | |||
| return { | |||
| "harrisoncramer/gitlab.nvim", | |||
| dependencies = { | |||
| "MunifTanjim/nui.nvim", | |||
| "nvim-lua/plenary.nvim", | |||
| "sindrets/diffview.nvim", | |||
| "stevearc/dressing.nvim", -- Recommended but not required. Better UI for pickers. | |||
| "nvim-tree/nvim-web-devicons", -- Recommended but not required. Icons in discussion tree. | |||
| }, | |||
| build = function() require("gitlab.server").build(true) end, -- Builds the Go binary | |||
| config = function() | |||
| require("gitlab").setup() | |||
| vim.api.nvim_create_user_command("GChoose", function() | |||
| require("gitlab").choose_merge_request() | |||
| end, { desc = "Choose a GitLab merge request" }) | |||
| vim.api.nvim_create_user_command("GReview", function() | |||
| require("gitlab").review() | |||
| end, { desc = "Start GitLab review" }) | |||
| end, | |||
| } | |||
| @ -1,46 +1,19 @@ | |||
| return { | |||
| "lewis6991/gitsigns.nvim", | |||
| event = { "BufReadPre", "BufNewFile" }, | |||
| config = function() | |||
| require("gitsigns").setup({ | |||
| signs = { | |||
| add = { text = "┃" }, | |||
| change = { text = "┃" }, | |||
| delete = { text = "_" }, | |||
| topdelete = { text = "‾" }, | |||
| changedelete = { text = "~" }, | |||
| untracked = { text = "┆" }, | |||
| }, | |||
| signcolumn = true, | |||
| numhl = false, | |||
| linehl = false, | |||
| word_diff = false, | |||
| watch_gitdir = { | |||
| follow_files = true, | |||
| }, | |||
| auto_attach = true, | |||
| attach_to_untracked = false, | |||
| current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame` | |||
| current_line_blame_opts = { | |||
| virt_text = true, | |||
| virt_text_pos = "eol", | |||
| delay = 0, | |||
| ignore_whitespace = false, | |||
| virt_text_priority = 100, | |||
| }, | |||
| current_line_blame_formatter = "<author>, <author_time:%R> - <summary>", | |||
| sign_priority = 6, | |||
| update_debounce = 100, | |||
| status_formatter = nil, -- Use default | |||
| max_file_length = 40000, -- Disable if file is longer than this (in lines) | |||
| preview_config = { | |||
| -- Options passed to nvim_open_win | |||
| border = "single", | |||
| style = "minimal", | |||
| relative = "cursor", | |||
| row = 0, | |||
| col = 1, | |||
| }, | |||
| }) | |||
| end, | |||
| } | |||
| local M = {} | |||
| M.install = { src = "https://github.com/lewis6991/gitsigns.nvim" } | |||
| M.setup = function() | |||
| require("gitsigns").setup({ | |||
| current_line_blame = true, | |||
| current_line_blame_opts = { | |||
| virt_text = true, | |||
| virt_text_pos = "eol", | |||
| delay = 0, | |||
| ignore_whitespace = false, | |||
| virt_text_priority = 100, | |||
| }, | |||
| current_line_blame_formatter = "<author>, <author_time:%R> - <summary>", | |||
| }) | |||
| end | |||
| return M | |||
| @ -1,68 +1,71 @@ | |||
| return { | |||
| "ThePrimeagen/harpoon", | |||
| event = "VeryLazy", | |||
| branch = "harpoon2", | |||
| dependencies = { | |||
| "nvim-lua/plenary.nvim", | |||
| }, | |||
| config = function() | |||
| local harpoon = require("harpoon") | |||
| local M = {} | |||
| -- REQUIRED | |||
| harpoon:setup() | |||
| -- REQUIRED | |||
| M.install = { src = "https://github.com/ThePrimeagen/harpoon", version = "harpoon2" } | |||
| local keymap = vim.keymap | |||
| M.dependencies = { | |||
| { src = "https://github.com/nvim-lua/plenary.nvim" }, | |||
| } | |||
| keymap.set("n", "<leader>a", function() | |||
| harpoon:list():add() | |||
| end, { desc = "Mark file with harpoon" }) | |||
| keymap.set("n", "<C-e>", function() | |||
| harpoon.ui:toggle_quick_menu(harpoon:list()) | |||
| end, { desc = "Toggle quick menu for harpoon" }) | |||
| M.setup = function() | |||
| local harpoon = require("harpoon") | |||
| keymap.set("n", "<leader>1", function() | |||
| harpoon:list():select(1) | |||
| end, { desc = "Go to first harpoon file" }) | |||
| -- REQUIRED | |||
| harpoon:setup() | |||
| -- REQUIRED | |||
| keymap.set("n", "<leader>h", function() | |||
| harpoon:list():select(1) | |||
| end, { desc = "Go to first harpoon file" }) | |||
| local keymap = vim.keymap | |||
| keymap.set("n", "<leader>a", function() | |||
| harpoon:list():add() | |||
| end, { desc = "Mark file with harpoon" }) | |||
| keymap.set("n", "<leader>2", function() | |||
| harpoon:list():select(2) | |||
| end, { desc = "Go to second harpoon file" }) | |||
| keymap.set("n", "<C-e>", function() | |||
| harpoon.ui:toggle_quick_menu(harpoon:list()) | |||
| end, { desc = "Toggle quick menu for harpoon" }) | |||
| keymap.set("n", "<leader>j", function() | |||
| harpoon:list():select(2) | |||
| end, { desc = "Go to second harpoon file" }) | |||
| keymap.set("n", "<leader>1", function() | |||
| harpoon:list():select(1) | |||
| end, { desc = "Go to first harpoon file" }) | |||
| keymap.set("n", "<leader>h", function() | |||
| harpoon:list():select(1) | |||
| end, { desc = "Go to first harpoon file" }) | |||
| keymap.set("n", "<leader>3", function() | |||
| harpoon:list():select(3) | |||
| end, { desc = "Go to third harpoon file" }) | |||
| keymap.set("n", "<leader>k", function() | |||
| harpoon:list():select(3) | |||
| end, { desc = "Go to third harpoon file" }) | |||
| keymap.set("n", "<leader>2", function() | |||
| harpoon:list():select(2) | |||
| end, { desc = "Go to second harpoon file" }) | |||
| keymap.set("n", "<leader>j", function() | |||
| harpoon:list():select(2) | |||
| end, { desc = "Go to second harpoon file" }) | |||
| keymap.set("n", "<leader>4", function() | |||
| harpoon:list():select(4) | |||
| end, { desc = "Go to fourth harpoon file" }) | |||
| keymap.set("n", "<leader>l", function() | |||
| harpoon:list():select(4) | |||
| end, { desc = "Go to fourth harpoon file" }) | |||
| keymap.set("n", "<leader>3", function() | |||
| harpoon:list():select(3) | |||
| end, { desc = "Go to third harpoon file" }) | |||
| keymap.set("n", "<leader>k", function() | |||
| harpoon:list():select(3) | |||
| end, { desc = "Go to third harpoon file" }) | |||
| keymap.set("n", "<C-S-P>", function() | |||
| harpoon:list():prev() | |||
| end) | |||
| keymap.set("n", "<C-S-N>", function() | |||
| harpoon:list():next() | |||
| end) | |||
| end, | |||
| } | |||
| keymap.set("n", "<leader>4", function() | |||
| harpoon:list():select(4) | |||
| end, { desc = "Go to fourth harpoon file" }) | |||
| keymap.set("n", "<leader>l", function() | |||
| harpoon:list():select(4) | |||
| end, { desc = "Go to fourth harpoon file" }) | |||
| keymap.set("n", "<C-S-P>", function() | |||
| harpoon:list():prev() | |||
| end) | |||
| keymap.set("n", "<C-S-N>", function() | |||
| harpoon:list():next() | |||
| end) | |||
| end | |||
| return M | |||
| @ -0,0 +1,49 @@ | |||
| local plugins_dir = vim.fn.stdpath('config') .. '/lua/plugins' | |||
| local plugin_files = vim.fn.globpath(plugins_dir, '*.lua', false, true) | |||
| local plugins_to_add = {} | |||
| local plugins_to_setup = {} | |||
| -- Collect all plugin configs (excluding init.lua) | |||
| for _, file in ipairs(plugin_files) do | |||
| local filename = vim.fn.fnamemodify(file, ':t:r') | |||
| if filename ~= 'init' then | |||
| local ok, plugin = pcall(require, 'plugins.' .. filename) | |||
| if ok and type(plugin) == 'table' then | |||
| if not plugin.disabled then | |||
| if plugin.install then | |||
| table.insert(plugins_to_add, plugin.install) | |||
| end | |||
| if plugin.dependencies then | |||
| vim.list_extend( | |||
| plugins_to_add, | |||
| plugin.dependencies | |||
| ) | |||
| end | |||
| if plugin.setup and type(plugin.setup) == 'function' then | |||
| table.insert(plugins_to_setup, { | |||
| name = filename, | |||
| setup = plugin.setup | |||
| }) | |||
| end | |||
| end | |||
| else | |||
| vim.notify('Failed to load plugin: ' .. filename .. ': ' .. tostring(plugin), vim.log.levels.WARN) | |||
| end | |||
| end | |||
| end | |||
| -- Add all plugins | |||
| vim.pack.add(plugins_to_add) | |||
| -- Run all setup functions | |||
| for _, plugin in ipairs(plugins_to_setup) do | |||
| local ok, err = pcall(plugin.setup) | |||
| if not ok then | |||
| vim.notify('Failed to setup plugin ' .. plugin.name .. ': ' .. tostring(err), vim.log.levels.ERROR) | |||
| end | |||
| end | |||
| @ -0,0 +1,11 @@ | |||
| local M = {} | |||
| M.disabled = false | |||
| M.install = { src = "https://github.com/rebelot/kanagawa.nvim" } | |||
| M.setup = function() | |||
| vim.cmd("colorscheme kanagawa") | |||
| end | |||
| return M | |||
| @ -1,42 +0,0 @@ | |||
| return { | |||
| dir = "~/Projects/laravel.nvim", | |||
| dependencies = { | |||
| "tpope/vim-dotenv", | |||
| "MunifTanjim/nui.nvim", | |||
| "kevinhwang91/promise-async", | |||
| }, | |||
| cmd = { "Laravel" }, | |||
| keys = {}, | |||
| event = { "VeryLazy" }, | |||
| opts = { | |||
| lsp_server = "intelephense", | |||
| artisan_path = "app/api/artisan", | |||
| environments = { | |||
| default = "docker-compose", | |||
| auto_discover = false, | |||
| definitions = { | |||
| { | |||
| name = "docker-compose", | |||
| condition = { | |||
| file_exists = { "docker-compose.yml" }, | |||
| executable = { "docker" }, | |||
| }, | |||
| commands = { | |||
| compose = { "docker", "compose" }, | |||
| { | |||
| commands = { "php", "composer", "npm" }, | |||
| docker = { | |||
| container = { | |||
| env = "APP_SERVICE", | |||
| default = "app-fpm", | |||
| }, | |||
| exec = { "docker", "compose", "exec", "-it" }, | |||
| }, | |||
| }, | |||
| }, | |||
| }, | |||
| }, | |||
| }, | |||
| }, | |||
| config = true, | |||
| } | |||
| @ -1,113 +0,0 @@ | |||
| return { | |||
| "mfussenegger/nvim-lint", | |||
| event = { "BufReadPre", "BufNewFile" }, | |||
| config = function() | |||
| local lint = require("lint") | |||
| local severities = { | |||
| ERROR = vim.diagnostic.severity.ERROR, | |||
| WARNING = vim.diagnostic.severity.WARN, | |||
| } | |||
| lint.linters.phpcs = { | |||
| name = "phpcs", | |||
| cmd = "phpcs", | |||
| stdin = true, | |||
| args = { | |||
| "-q", | |||
| "--report=json", | |||
| "--standard=~/.config/phpcs.xml", | |||
| "-", -- need `-` at the end for stdin support | |||
| }, | |||
| ignore_exitcode = true, | |||
| parser = function(output, _) | |||
| if vim.trim(output) == "" or output == nil then | |||
| return {} | |||
| end | |||
| if not vim.startswith(output, "{") then | |||
| vim.notify(output) | |||
| return {} | |||
| end | |||
| local decoded = vim.json.decode(output) | |||
| local diagnostics = {} | |||
| local messages = decoded["files"]["STDIN"]["messages"] | |||
| for _, msg in ipairs(messages or {}) do | |||
| table.insert(diagnostics, { | |||
| lnum = msg.line - 1, | |||
| end_lnum = msg.line - 1, | |||
| col = msg.column - 1, | |||
| end_col = msg.column - 1, | |||
| message = msg.message, | |||
| code = msg.source, | |||
| source = "phpcs", | |||
| severity = assert(severities[msg.type], "missing mapping for severity " .. msg.type), | |||
| }) | |||
| end | |||
| return diagnostics | |||
| end, | |||
| } | |||
| lint.linters_by_ft = { | |||
| javascript = { "eslint" }, | |||
| typescript = { "eslint" }, | |||
| typescriptreact = { "eslint" }, | |||
| vue = { "eslint" }, | |||
| json = { "jsonlint" }, | |||
| markdown = { "markdownlint" }, | |||
| php = { "phpcs" }, | |||
| golang = { "gospell", "golangci-lint" }, | |||
| python = { "pylint" }, | |||
| dockerfile = { "hadolint" }, | |||
| blade = { "phpcs" }, | |||
| html = { "curlylint" }, | |||
| } | |||
| local lint_augroup = vim.api.nvim_create_augroup("lint", { | |||
| clear = true, | |||
| }) | |||
| local function find_nearest_node_modules_dir() | |||
| -- current buffer dir | |||
| local current_dir = vim.fn.expand('%:p:h') .. "./frontend" | |||
| while current_dir ~= "/" do | |||
| if vim.fn.isdirectory(current_dir .. "/node_modules") == 1 then | |||
| return current_dir | |||
| end | |||
| current_dir = vim.fn.fnamemodify(current_dir, ":h") | |||
| end | |||
| return nil | |||
| end | |||
| vim.api.nvim_create_autocmd({ | |||
| "BufEnter", | |||
| "BufWritePost", | |||
| "InsertLeave", | |||
| }, { | |||
| group = lint_augroup, | |||
| callback = function() | |||
| local ft = vim.bo.filetype | |||
| local js_types = { "javascript", "typescript", "javascriptreact", "typescriptreact", "vue" } | |||
| if not vim.tbl_contains(js_types, ft) then | |||
| lint.try_lint() | |||
| return | |||
| end | |||
| local original_cwd = vim.fn.getcwd() | |||
| local node_modules_dir = find_nearest_node_modules_dir() | |||
| if node_modules_dir then | |||
| vim.cmd("cd " .. node_modules_dir) | |||
| end | |||
| lint.try_lint() | |||
| vim.cmd("cd " .. original_cwd) | |||
| end, | |||
| }) | |||
| -- vim.keymap.set("n", "<leader>ll", function() | |||
| -- lint.try_lint() | |||
| -- end) | |||
| end, | |||
| } | |||
| @ -1,78 +1,172 @@ | |||
| return { | |||
| "neovim/nvim-lspconfig", | |||
| -- 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 = {} }, | |||
| { 'mawkler/refjump.nvim', opts = {}, event = 'LspAttach', }, | |||
| }, | |||
| config = function() | |||
| local utils = require("lsp.utils") | |||
| vim.api.nvim_create_autocmd("LspAttach", { | |||
| group = vim.api.nvim_create_augroup("lsp-attach", { clear = true }), | |||
| callback = function(event) | |||
| -- Use the utility function to setup keymaps | |||
| utils.setup_lsp_keymaps(event.buf) | |||
| local client = vim.lsp.get_client_by_id(event.data.client_id) | |||
| if client and client.server_capabilities.documentHighlightProvider then | |||
| vim.api.nvim_create_autocmd("LspDetach", { | |||
| group = vim.api.nvim_create_augroup("lsp-detach", { clear = true }), | |||
| callback = function() | |||
| vim.lsp.buf.clear_references() | |||
| end, | |||
| }) | |||
| end | |||
| end, | |||
| }) | |||
| vim.diagnostic.config({ | |||
| virtual_text = false, | |||
| float = { | |||
| border = "rounded", | |||
| }, | |||
| signs = true, | |||
| underline = true, | |||
| update_in_insert = true, | |||
| severity_sort = true, | |||
| }) | |||
| local capabilities = vim.lsp.protocol.make_client_capabilities() | |||
| capabilities = vim.tbl_deep_extend( | |||
| "force", | |||
| capabilities, | |||
| require('blink.cmp').get_lsp_capabilities() | |||
| ) | |||
| -- Load server configurations from separate files | |||
| local servers_path = vim.fn.stdpath("config") .. "/lua/lsp/servers" | |||
| local server_files = vim.fn.glob(servers_path .. "/*.lua", false, true) | |||
| local servers = {} | |||
| for _, file in ipairs(server_files) do | |||
| local server_name = vim.fn.fnamemodify(file, ":t:r") | |||
| local ok, server_config = pcall(require, "lsp.servers." .. server_name) | |||
| if ok then | |||
| servers[server_name] = server_config | |||
| else | |||
| vim.notify("Failed to load server config: " .. server_name, vim.log.levels.WARN) | |||
| local M = {} | |||
| M.install = { src = "https://github.com/neovim/nvim-lspconfig" } | |||
| M.setup = function() | |||
| vim.api.nvim_create_autocmd("LspAttach", { | |||
| group = vim.api.nvim_create_augroup("LspAttach", { clear = true }), | |||
| callback = function(event) | |||
| vim.keymap.set("n", "gr", function() | |||
| vim.lsp.buf.references() | |||
| end, { desc = "LSP References" }) | |||
| vim.keymap.set("n", "gd", function() | |||
| vim.lsp.buf.definition() | |||
| end, { desc = "LSP Definition" }) | |||
| -- LSP implementations | |||
| vim.keymap.set('n', 'gi', function() | |||
| vim.lsp.buf.implementation() | |||
| end, { desc = 'LSP implementation' }) | |||
| -- LSP type definitions | |||
| vim.keymap.set('n', 'gt', function() | |||
| vim.lsp.buf.type_definition() | |||
| end, { desc = 'LSP type definition' }) | |||
| -- LSP document symbols | |||
| vim.keymap.set('n', 'gs', function() | |||
| vim.lsp.buf.document_symbol() | |||
| end, { desc = 'LSP document symbols' }) | |||
| -- LSP workspace symbols | |||
| vim.keymap.set('n', 'gS', function() | |||
| vim.lsp.buf.workspace_symbol() | |||
| end, { desc = 'LSP workspace symbols' }) | |||
| -- LSP Declaration | |||
| vim.keymap.set("n", "gD", function() | |||
| vim.lsp.buf.declaration() | |||
| end, { desc = "Go to declaration" }) | |||
| -- LSP Code Actions | |||
| vim.keymap.set({ "n", "v" }, "<leader>ca", function() | |||
| vim.lsp.buf.code_action() | |||
| end, { desc = "LSP Code Actions" }) | |||
| -- LSP Rename | |||
| vim.keymap.set("n", "<leader>rn", function() | |||
| vim.lsp.buf.rename() | |||
| end, { desc = "LSP Rename" }) | |||
| -- LSP diagnostics for current buffer | |||
| vim.keymap.set('n', '<leader>d', function() | |||
| vim.diagnostic.setloclist() | |||
| end, { desc = 'Buffer diagnostics' }) | |||
| -- LSP Format | |||
| vim.keymap.set("n", "<leader>F", function() | |||
| vim.lsp.buf.format() | |||
| end, { desc = "LSP Format" }) | |||
| -- LSP diagnostics for entire workspace | |||
| vim.keymap.set('n', '<leader>D', function() | |||
| vim.diagnostic.setqflist() | |||
| end, { desc = 'Workspace diagnostics' }) | |||
| vim.keymap.set("n", "[d", function() | |||
| vim.diagnostic.jump({ | |||
| count = -1, | |||
| on_jump = function() | |||
| vim.diagnostic.open_float() | |||
| end | |||
| }) | |||
| end, { desc = "Go to previous diagnostic" }) | |||
| vim.keymap.set("n", "]d", function() | |||
| vim.diagnostic.jump({ | |||
| count = 1, | |||
| on_jump = function() | |||
| vim.diagnostic.open_float() | |||
| end | |||
| }) | |||
| end, { desc = "Go to next diagnostic" }) | |||
| vim.keymap.set("n", "[e", function() | |||
| vim.diagnostic.jump({ | |||
| count = -1, | |||
| severity = vim.diagnostic.severity.ERROR, | |||
| on_jump = function() | |||
| vim.diagnostic.open_float() | |||
| end | |||
| }) | |||
| end, { desc = "Go to previous diagnostic (error only)" }) | |||
| vim.keymap.set("n", "]e", function() | |||
| vim.diagnostic.jump({ | |||
| count = 1, | |||
| severity = vim.diagnostic.severity.ERROR, | |||
| on_jump = function() | |||
| vim.diagnostic.open_float() | |||
| end | |||
| }) | |||
| end, { desc = "Go to next diagnostic (error only)" }) | |||
| vim.keymap.set("n", "<leader>df", function() | |||
| vim.diagnostic.open_float() | |||
| end, { desc = "Show diagnostic in floating window" }) | |||
| local client = vim.lsp.get_client_by_id(event.data.client_id) | |||
| if client and client:supports_method('textDocument/completion') then | |||
| -- Optional: trigger autocompletion on EVERY keypress. May be slow! | |||
| local chars = {}; for i = 32, 126 do table.insert(chars, string.char(i)) end | |||
| client.server_capabilities.completionProvider.triggerCharacters = chars | |||
| vim.lsp.completion.enable(true, client.id, event.buf, { | |||
| autotrigger = true, | |||
| -- Prevent auto-selection of first item | |||
| autocomplete = false | |||
| }) | |||
| -- Map Ctrl+y to select first item and accept completion | |||
| vim.keymap.set('i', '<C-y>', function() | |||
| if vim.fn.pumvisible() == 1 then | |||
| -- If completion menu is visible, select first item if nothing selected, then accept | |||
| local selected = vim.fn.complete_info({'selected'}).selected | |||
| if selected == -1 then | |||
| -- Nothing selected, select first item then accept | |||
| return '<C-n><C-y>' | |||
| else | |||
| -- Something already selected, just accept | |||
| return '<C-y>' | |||
| end | |||
| else | |||
| return '<C-y>' | |||
| end | |||
| end, { expr = true, buffer = event.buf, desc = 'Accept completion' }) | |||
| end | |||
| end | |||
| -- 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 {}) | |||
| if client and client.server_capabilities.documentHighlightProvider then | |||
| vim.api.nvim_create_autocmd("LspDetach", { | |||
| group = vim.api.nvim_create_augroup("LspDetach", { clear = true }), | |||
| callback = function() | |||
| vim.lsp.buf.clear_references() | |||
| end, | |||
| }) | |||
| end | |||
| end, | |||
| }) | |||
| -- Load server configurations from separate files | |||
| local servers_path = vim.fn.stdpath("config") .. "/lua/lsp/servers" | |||
| local server_files = vim.fn.glob(servers_path .. "/*.lua", false, true) | |||
| vim.lsp.config(server_name, server) | |||
| vim.lsp.enable(server_name) | |||
| local servers = {} | |||
| for _, file in ipairs(server_files) do | |||
| local server_name = vim.fn.fnamemodify(file, ":t:r") | |||
| local ok, server_config = pcall(require, "lsp.servers." .. server_name) | |||
| if ok then | |||
| servers[server_name] = server_config | |||
| else | |||
| vim.notify("Failed to load server config: " .. server_name, vim.log.levels.WARN) | |||
| end | |||
| end, | |||
| } | |||
| end | |||
| -- Setup all servers using the new vim.lsp.config and vim.lsp.enable APIs | |||
| for server_name, server in pairs(servers) do | |||
| vim.lsp.config(server_name, server or {}) | |||
| vim.lsp.enable(server_name) | |||
| end | |||
| end | |||
| return M | |||
| @ -1,110 +0,0 @@ | |||
| return { | |||
| "nvim-lualine/lualine.nvim", | |||
| event = "VeryLazy", | |||
| dependencies = { | |||
| "nvim-tree/nvim-web-devicons", | |||
| "letieu/harpoon-lualine", | |||
| }, | |||
| config = function() | |||
| local lualine = require("lualine") | |||
| local lazy_status = require("lazy.status") | |||
| -- Custom components | |||
| local function macro_recording() | |||
| local recording_register = vim.fn.reg_recording() | |||
| if recording_register == "" then | |||
| return "" | |||
| else | |||
| return "Recording @" .. recording_register | |||
| end | |||
| end | |||
| local function buffer_count() | |||
| local buffers = vim.fn.getbufinfo({ buflisted = 1 }) | |||
| return "Buffers: " .. #buffers | |||
| end | |||
| lualine.setup({ | |||
| options = { | |||
| theme = "auto", | |||
| component_separators = { left = "", right = "" }, | |||
| section_separators = { left = "", right = "" }, | |||
| globalstatus = true, | |||
| refresh = { | |||
| statusline = 1000, -- Refresh every second for macro recording | |||
| }, | |||
| }, | |||
| extensions = { | |||
| "fugitive", | |||
| "oil", | |||
| "quickfix", | |||
| "trouble", -- Add if you use trouble.nvim | |||
| "mason", -- Add if you use mason.nvim | |||
| }, | |||
| sections = { | |||
| lualine_a = { | |||
| { "mode", fmt = function(str) return str:sub(1,1) end }, -- Shorter mode display | |||
| }, | |||
| lualine_b = { | |||
| { "branch", icon = "" }, | |||
| { | |||
| "diff", | |||
| colored = true, | |||
| symbols = { added = " ", modified = " ", removed = " " } | |||
| }, | |||
| { | |||
| "diagnostics", | |||
| sources = { "nvim_lsp" }, | |||
| symbols = { error = " ", warn = " ", info = " ", hint = " " } | |||
| }, | |||
| }, | |||
| lualine_c = { | |||
| { | |||
| "filename", | |||
| file_status = true, | |||
| path = 1, -- Show relative path | |||
| shorting_target = 40, -- Shorten long paths | |||
| symbols = { | |||
| modified = "", | |||
| readonly = "", | |||
| unnamed = "[No Name]", | |||
| newfile = "[New]", | |||
| } | |||
| }, | |||
| { "harpoon2" }, | |||
| { | |||
| macro_recording, | |||
| color = { fg = "#ff9e64", gui = "bold" }, | |||
| separator = { left = "" } | |||
| }, | |||
| { buffer_count, color = { fg = "#7aa2f7" } }, | |||
| }, | |||
| lualine_x = { | |||
| { | |||
| lazy_status.updates, | |||
| cond = lazy_status.has_updates, | |||
| color = { fg = "#ff9e64" }, | |||
| }, | |||
| -- Remove fileformat unless you really need it | |||
| -- { "fileformat" }, | |||
| { "filetype", colored = true }, | |||
| }, | |||
| lualine_y = { | |||
| { "progress" }, | |||
| }, | |||
| lualine_z = { | |||
| { "location" }, | |||
| }, | |||
| }, | |||
| inactive_sections = { | |||
| lualine_c = { | |||
| { "filename", file_status = true, path = 1 } | |||
| }, | |||
| lualine_x = { | |||
| { "filetype" } | |||
| }, | |||
| }, | |||
| }) | |||
| end, | |||
| } | |||
| @ -0,0 +1,9 @@ | |||
| local M = {} | |||
| M.install = { src = "https://github.com/mason-org/mason.nvim" } | |||
| M.setup = function() | |||
| require("mason").setup() | |||
| end | |||
| return M | |||
| @ -0,0 +1,107 @@ | |||
| local M = {} | |||
| M.install = { src = "https://github.com/nvim-mini/mini.pick" } | |||
| M.setup = function() | |||
| local pick = require('mini.pick') | |||
| pick.setup({ | |||
| mappings = { | |||
| paste_from_clipboard = { | |||
| char = '<C-r>', | |||
| func = function() | |||
| local clipboard = vim.fn.getreg('+') | |||
| local current_query = pick.get_picker_query() or {} | |||
| -- Query is an array of strings, join and append clipboard | |||
| local query_text = type(current_query) == 'table' and table.concat(current_query, '') or current_query | |||
| local new_query = query_text .. clipboard | |||
| -- Convert back to array of characters | |||
| local query_array = {} | |||
| for char in new_query:gmatch('.') do | |||
| table.insert(query_array, char) | |||
| end | |||
| pick.set_picker_query(query_array) | |||
| end, | |||
| }, | |||
| send_to_qflist = { | |||
| char = '<C-q>', | |||
| func = function() | |||
| local items = pick.get_picker_items() | |||
| if not items or #items == 0 then | |||
| return | |||
| end | |||
| local qf_items = {} | |||
| for _, item in ipairs(items) do | |||
| if type(item) == 'string' then | |||
| -- Mini.pick uses null bytes (\0) as separators | |||
| local parts = vim.split(item, '\0', { plain = true }) | |||
| if #parts >= 3 then | |||
| -- Format: path\0lnum\0col\0text | |||
| local path = parts[1] | |||
| local lnum = tonumber(parts[2]) or 1 | |||
| local col = tonumber(parts[3]) or 1 | |||
| local text = parts[4] or '' | |||
| table.insert(qf_items, { | |||
| filename = path, | |||
| lnum = lnum, | |||
| col = col, | |||
| text = text, | |||
| }) | |||
| else | |||
| -- Just a file path | |||
| table.insert(qf_items, { | |||
| filename = item, | |||
| lnum = 1, | |||
| col = 1, | |||
| text = '', | |||
| }) | |||
| end | |||
| end | |||
| end | |||
| if #qf_items > 0 then | |||
| vim.fn.setqflist(qf_items) | |||
| vim.cmd('copen') | |||
| end | |||
| pick.stop() | |||
| end, | |||
| }, | |||
| }, | |||
| window = { | |||
| config = function() | |||
| local height = math.floor(0.618 * vim.o.lines) | |||
| local width = math.floor(0.618 * vim.o.columns) | |||
| return { | |||
| anchor = 'NW', | |||
| height = height, | |||
| width = width, | |||
| row = math.floor(0.5 * (vim.o.lines - height)), | |||
| col = math.floor(0.5 * (vim.o.columns - width)), | |||
| } | |||
| end, | |||
| }, | |||
| }) | |||
| -- Keybind for git files | |||
| vim.keymap.set('n', '<leader>p', function() | |||
| pick.builtin.files({ tool = 'git' }) | |||
| end, { desc = 'Pick Git Files' }) | |||
| -- Keybind for git files | |||
| vim.keymap.set('n', '<leader>P', function() | |||
| pick.builtin.files() | |||
| end, { desc = 'Pick Files' }) | |||
| vim.keymap.set('n', '<leader>f', function() | |||
| pick.builtin.grep_live() | |||
| end, { desc = 'Pick Search' }) | |||
| vim.keymap.set('n', '<leader>H', function() | |||
| pick.builtin.help() | |||
| end, { desc = 'Pick Help' }) | |||
| end | |||
| return M | |||
| @ -1,148 +1,152 @@ | |||
| return { | |||
| "nvim-neotest/neotest", | |||
| event = "VeryLazy", | |||
| dependencies = { | |||
| "nvim-lua/plenary.nvim", | |||
| "nvim-treesitter/nvim-treesitter", | |||
| "antoinemadec/FixCursorHold.nvim", | |||
| "nvim-neotest/nvim-nio", | |||
| -- Adapters | |||
| "olimorris/neotest-phpunit", | |||
| "praem90/neotest-docker-phpunit.nvim", | |||
| "nvim-neotest/neotest-go", | |||
| }, | |||
| config = function() | |||
| local neotest = require("neotest") | |||
| local keymap = vim.keymap | |||
| -- Environment setup | |||
| vim.env.PROJECT_ROOT = vim.fn.getcwd() .. "/backend/" | |||
| vim.env.ENV_PATH = vim.fn.getcwd() .. "/backend/.env" | |||
| -- Container toggle state | |||
| local current_container = "app-fpm" | |||
| -- Test running keymaps | |||
| keymap.set("n", "<leader>tr", function() | |||
| neotest.run.run() | |||
| end, { desc = "Run nearest test" }) | |||
| keymap.set("n", "<leader>tf", function() | |||
| neotest.run.run(vim.fn.expand("%")) | |||
| end, { desc = "Run all tests in file" }) | |||
| keymap.set("n", "<leader>tR", function() | |||
| neotest.run.run_last() | |||
| end, { desc = "Run last test" }) | |||
| keymap.set("n", "<leader>tS", function() | |||
| neotest.run.stop() | |||
| end, { desc = "Stop running tests" }) | |||
| keymap.set("n", "<leader>ta", function() | |||
| neotest.run.attach() | |||
| end, { desc = "Attach to running test" }) | |||
| -- Watch mode | |||
| keymap.set("n", "<leader>tw", function() | |||
| neotest.watch.toggle(vim.fn.expand("%")) | |||
| end, { desc = "Toggle watch mode for file" }) | |||
| -- Output keymaps | |||
| keymap.set("n", "<leader>to", function() | |||
| neotest.output.open({ enter = true, short = false }) | |||
| end, { desc = "Open test output" }) | |||
| keymap.set("n", "<leader>tO", function() | |||
| neotest.output_panel.toggle() | |||
| end, { desc = "Toggle output panel" }) | |||
| -- UI keymaps | |||
| keymap.set("n", "<leader>ts", function() | |||
| neotest.summary.toggle() | |||
| end, { desc = "Toggle summary pane" }) | |||
| -- Navigation keymaps | |||
| keymap.set("n", "[t", function() | |||
| neotest.jump.prev({ status = "failed" }) | |||
| end, { desc = "Jump to previous failed test" }) | |||
| keymap.set("n", "]t", function() | |||
| neotest.jump.next({ status = "failed" }) | |||
| end, { desc = "Jump to next failed test" }) | |||
| -- Setup neotest function | |||
| local cwd = vim.fn.getcwd() | |||
| local app_path = cwd .. "/app/api" | |||
| local subscription_path = cwd .. "/subscription/api" | |||
| -- Config table that we can modify | |||
| local docker_config = { | |||
| default = { | |||
| container = current_container, | |||
| volume = (current_container == "subscription-fpm" and subscription_path or app_path) .. ":/var/www", | |||
| standalone = false, | |||
| local M = {} | |||
| M.install = { src = "https://github.com/nvim-neotest/neotest" } | |||
| M.dependencies = { | |||
| { src = "https://github.com/nvim-lua/plenary.nvim" }, | |||
| { src = "https://github.com/nvim-treesitter/nvim-treesitter" }, | |||
| { src = "https://github.com/antoinemadec/FixCursorHold.nvim" }, | |||
| { src = "https://github.com/nvim-neotest/nvim-nio" }, | |||
| -- Adapters | |||
| { src = "https://github.com/olimorris/neotest-phpunit" }, | |||
| { src = "https://github.com/praem90/neotest-docker-phpunit.nvim" }, | |||
| { src = "https://github.com/nvim-neotest/neotest-go" }, | |||
| } | |||
| M.setup = function() | |||
| local neotest = require("neotest") | |||
| local keymap = vim.keymap | |||
| -- Environment setup | |||
| vim.env.PROJECT_ROOT = vim.fn.getcwd() .. "/backend/" | |||
| vim.env.ENV_PATH = vim.fn.getcwd() .. "/backend/.env" | |||
| -- Container toggle state | |||
| local current_container = "app-fpm" | |||
| -- Test running keymaps | |||
| keymap.set("n", "<leader>tr", function() | |||
| neotest.run.run() | |||
| end, { desc = "Run nearest test" }) | |||
| keymap.set("n", "<leader>tf", function() | |||
| neotest.run.run(vim.fn.expand("%")) | |||
| end, { desc = "Run all tests in file" }) | |||
| keymap.set("n", "<leader>tR", function() | |||
| neotest.run.run_last() | |||
| end, { desc = "Run last test" }) | |||
| keymap.set("n", "<leader>tS", function() | |||
| neotest.run.stop() | |||
| end, { desc = "Stop running tests" }) | |||
| keymap.set("n", "<leader>ta", function() | |||
| neotest.run.attach() | |||
| end, { desc = "Attach to running test" }) | |||
| -- Watch mode | |||
| keymap.set("n", "<leader>tw", function() | |||
| neotest.watch.toggle(vim.fn.expand("%")) | |||
| end, { desc = "Toggle watch mode for file" }) | |||
| -- Output keymaps | |||
| keymap.set("n", "<leader>to", function() | |||
| neotest.output.open({ enter = true, short = false }) | |||
| end, { desc = "Open test output" }) | |||
| keymap.set("n", "<leader>tO", function() | |||
| neotest.output_panel.toggle() | |||
| end, { desc = "Toggle output panel" }) | |||
| -- UI keymaps | |||
| keymap.set("n", "<leader>ts", function() | |||
| neotest.summary.toggle() | |||
| end, { desc = "Toggle summary pane" }) | |||
| -- Navigation keymaps | |||
| keymap.set("n", "[t", function() | |||
| neotest.jump.prev({ status = "failed" }) | |||
| end, { desc = "Jump to previous failed test" }) | |||
| keymap.set("n", "]t", function() | |||
| neotest.jump.next({ status = "failed" }) | |||
| end, { desc = "Jump to next failed test" }) | |||
| -- Setup neotest function | |||
| local cwd = vim.fn.getcwd() | |||
| local app_path = cwd .. "/app/api" | |||
| local subscription_path = cwd .. "/subscription/api" | |||
| -- Config table that we can modify | |||
| local docker_config = { | |||
| default = { | |||
| container = current_container, | |||
| volume = (current_container == "subscription-fpm" and subscription_path or app_path) .. ":/var/www", | |||
| standalone = false, | |||
| }, | |||
| } | |||
| local function setup_neotest() | |||
| neotest.setup({ | |||
| adapters = { | |||
| require("neotest-docker-phpunit").setup({ | |||
| phpunit_cmd = "neotest-docker-phpunit", | |||
| docker_phpunit = docker_config, | |||
| }), | |||
| require("neotest-go")({ | |||
| root = function() | |||
| return './backend' | |||
| end, | |||
| experimental = { | |||
| test_table = true, | |||
| }, | |||
| args = { "-count=1", "-timeout=60s" }, | |||
| }), | |||
| }, | |||
| output = { | |||
| enabled = true, | |||
| open_on_run = false, | |||
| }, | |||
| output_panel = { | |||
| enabled = true, | |||
| open = "botright split | resize 15", | |||
| }, | |||
| quickfix = { | |||
| enabled = true, | |||
| open = false, | |||
| }, | |||
| } | |||
| local function setup_neotest() | |||
| neotest.setup({ | |||
| adapters = { | |||
| require("neotest-docker-phpunit").setup({ | |||
| phpunit_cmd = "neotest-docker-phpunit", | |||
| docker_phpunit = docker_config, | |||
| }), | |||
| require("neotest-go")({ | |||
| root = function() | |||
| return './backend' | |||
| end, | |||
| experimental = { | |||
| test_table = true, | |||
| }, | |||
| args = { "-count=1", "-timeout=60s" }, | |||
| }), | |||
| }, | |||
| output = { | |||
| enabled = true, | |||
| open_on_run = false, | |||
| }, | |||
| output_panel = { | |||
| enabled = true, | |||
| open = "botright split | resize 15", | |||
| }, | |||
| quickfix = { | |||
| enabled = true, | |||
| open = false, | |||
| }, | |||
| status = { | |||
| enabled = true, | |||
| virtual_text = true, | |||
| signs = true, | |||
| }, | |||
| floating = { | |||
| border = "rounded", | |||
| max_height = 0.8, | |||
| max_width = 0.9, | |||
| }, | |||
| }) | |||
| status = { | |||
| enabled = true, | |||
| virtual_text = true, | |||
| signs = true, | |||
| }, | |||
| floating = { | |||
| border = "rounded", | |||
| max_height = 0.8, | |||
| max_width = 0.9, | |||
| }, | |||
| }) | |||
| end | |||
| -- Initial setup | |||
| setup_neotest() | |||
| -- Container toggle keybind | |||
| keymap.set("n", "<leader>tc", function() | |||
| if current_container == "app-fpm" then | |||
| current_container = "subscription-fpm" | |||
| else | |||
| current_container = "app-fpm" | |||
| end | |||
| -- Initial setup | |||
| setup_neotest() | |||
| -- Update the config table directly | |||
| docker_config.default.container = current_container | |||
| docker_config.default.volume = (current_container == "subscription-fpm" and subscription_path or app_path) .. | |||
| ":/var/www" | |||
| -- Container toggle keybind | |||
| keymap.set("n", "<leader>tc", function() | |||
| if current_container == "app-fpm" then | |||
| current_container = "subscription-fpm" | |||
| else | |||
| current_container = "app-fpm" | |||
| end | |||
| vim.notify("Switched to container: " .. current_container, vim.log.levels.INFO) | |||
| end, { desc = "Toggle container (app/subscription)" }) | |||
| end | |||
| -- Update the config table directly | |||
| docker_config.default.container = current_container | |||
| docker_config.default.volume = (current_container == "subscription-fpm" and subscription_path or app_path) .. ":/var/www" | |||
| vim.notify("Switched to container: " .. current_container, vim.log.levels.INFO) | |||
| end, { desc = "Toggle container (app/subscription)" }) | |||
| end, | |||
| } | |||
| return M | |||
| @ -1,23 +0,0 @@ | |||
| return { | |||
| "ray-x/go.nvim", | |||
| dependencies = { | |||
| "ray-x/guihua.lua", | |||
| "neovim/nvim-lspconfig", | |||
| "nvim-treesitter/nvim-treesitter", | |||
| }, | |||
| event = "VeryLazy", | |||
| ft = { "go", 'gomod' }, | |||
| build = ':lua require("go.install").update_all_sync()', | |||
| config = function() | |||
| require("go").setup() | |||
| local format_sync_grp = vim.api.nvim_create_augroup("GoFormat", {}) | |||
| vim.api.nvim_create_autocmd("BufWritePre", { | |||
| pattern = "*.go", | |||
| callback = function() | |||
| require('go.format').goimports() | |||
| end, | |||
| group = format_sync_grp, | |||
| }) | |||
| end | |||
| } | |||
| @ -0,0 +1,115 @@ | |||
| local M = {} | |||
| M.install = { src = "https://github.com/mfussenegger/nvim-lint" } | |||
| M.setup = function() | |||
| local lint = require("lint") | |||
| local severities = { | |||
| ERROR = vim.diagnostic.severity.ERROR, | |||
| WARNING = vim.diagnostic.severity.WARN, | |||
| } | |||
| lint.linters.phpcs = { | |||
| name = "phpcs", | |||
| cmd = "phpcs", | |||
| stdin = true, | |||
| args = { | |||
| "-q", | |||
| "--report=json", | |||
| "--standard=~/.config/phpcs.xml", | |||
| "-", -- need `-` at the end for stdin support | |||
| }, | |||
| ignore_exitcode = true, | |||
| parser = function(output, _) | |||
| if vim.trim(output) == "" or output == nil then | |||
| return {} | |||
| end | |||
| if not vim.startswith(output, "{") then | |||
| vim.notify(output) | |||
| return {} | |||
| end | |||
| local decoded = vim.json.decode(output) | |||
| local diagnostics = {} | |||
| local messages = decoded["files"]["STDIN"]["messages"] | |||
| for _, msg in ipairs(messages or {}) do | |||
| table.insert(diagnostics, { | |||
| lnum = msg.line - 1, | |||
| end_lnum = msg.line - 1, | |||
| col = msg.column - 1, | |||
| end_col = msg.column - 1, | |||
| message = msg.message, | |||
| code = msg.source, | |||
| source = "phpcs", | |||
| severity = assert(severities[msg.type], "missing mapping for severity " .. msg.type), | |||
| }) | |||
| end | |||
| return diagnostics | |||
| end, | |||
| } | |||
| lint.linters_by_ft = { | |||
| javascript = { "eslint" }, | |||
| typescript = { "eslint" }, | |||
| typescriptreact = { "eslint" }, | |||
| vue = { "eslint" }, | |||
| json = { "jsonlint" }, | |||
| markdown = { "markdownlint" }, | |||
| php = { "phpcs" }, | |||
| golang = { "gospell", "golangci-lint" }, | |||
| python = { "pylint" }, | |||
| dockerfile = { "hadolint" }, | |||
| blade = { "phpcs" }, | |||
| html = { "curlylint" }, | |||
| } | |||
| local lint_augroup = vim.api.nvim_create_augroup("lint", { | |||
| clear = true, | |||
| }) | |||
| local function find_nearest_node_modules_dir() | |||
| -- current buffer dir | |||
| local current_dir = vim.fn.expand('%:p:h') .. "./frontend" | |||
| while current_dir ~= "/" do | |||
| if vim.fn.isdirectory(current_dir .. "/node_modules") == 1 then | |||
| return current_dir | |||
| end | |||
| current_dir = vim.fn.fnamemodify(current_dir, ":h") | |||
| end | |||
| return nil | |||
| end | |||
| vim.api.nvim_create_autocmd({ | |||
| "BufEnter", | |||
| "BufWritePost", | |||
| "InsertLeave", | |||
| }, { | |||
| group = lint_augroup, | |||
| callback = function() | |||
| local ft = vim.bo.filetype | |||
| local js_types = { "javascript", "typescript", "javascriptreact", "typescriptreact", "vue" } | |||
| if not vim.tbl_contains(js_types, ft) then | |||
| lint.try_lint() | |||
| return | |||
| end | |||
| local original_cwd = vim.fn.getcwd() | |||
| local node_modules_dir = find_nearest_node_modules_dir() | |||
| if node_modules_dir then | |||
| vim.cmd("cd " .. node_modules_dir) | |||
| end | |||
| lint.try_lint() | |||
| vim.cmd("cd " .. original_cwd) | |||
| end, | |||
| }) | |||
| -- vim.keymap.set("n", "<leader>ll", function() | |||
| -- lint.try_lint() | |||
| -- end) | |||
| end | |||
| return M | |||
| @ -1,143 +0,0 @@ | |||
| return { | |||
| { | |||
| "nvim-treesitter/nvim-treesitter", | |||
| event = { "BufReadPre", "BufNewFile" }, | |||
| build = ":TSUpdate", | |||
| dependencies = { | |||
| { "nvim-treesitter/nvim-treesitter-textobjects" }, | |||
| }, | |||
| config = function() | |||
| ---@class ParserConfig | |||
| ---@field install_info table | |||
| ---@field filetype string | |||
| local parser_config = require("nvim-treesitter.parsers").get_parser_configs() | |||
| parser_config.blade = { | |||
| install_info = { | |||
| url = "https://github.com/EmranMR/tree-sitter-blade", | |||
| files = { "src/parser.c" }, | |||
| branch = "main", | |||
| }, | |||
| filetype = "blade", | |||
| } | |||
| vim.filetype.add({ | |||
| extension = { blade = "blade" }, | |||
| pattern = { | |||
| ['.*%.blade%.php'] = 'blade', | |||
| }, | |||
| }) | |||
| --- | |||
| ---:TSEditQuery highlights blade | |||
| --- | |||
| ---(directive) @function | |||
| ---(directive_start) @function | |||
| ---(directive_end) @function | |||
| ---(comment) @comment | |||
| ---((parameter) @include (#set! "priority" 110)) | |||
| ---((php_only) @include (#set! "priority" 110)) | |||
| ---((bracket_start) @function (#set! "priority" 120)) | |||
| ---((bracket_end) @function (#set! "priority" 120)) | |||
| ---(keyword) @function | |||
| --- | |||
| --- | |||
| ---:TSEditQuery injections blade | |||
| ---((text) @injection.content | |||
| --- (#not-has-ancestor? @injection.content "envoy") | |||
| --- (#set! injection.combined) | |||
| --- (#set! injection.language php)) | |||
| --- | |||
| -- import nvim-treesitter plugin | |||
| local treesitter = require("nvim-treesitter.configs") | |||
| -- configure treesitter | |||
| treesitter.setup({ | |||
| -- ensure these language parsers are installed | |||
| ensure_installed = { | |||
| "json", | |||
| "javascript", | |||
| "typescript", | |||
| "tsx", | |||
| "yaml", | |||
| "html", | |||
| "css", | |||
| "markdown", | |||
| "markdown_inline", | |||
| "bash", | |||
| "lua", | |||
| "vim", | |||
| "dockerfile", | |||
| "gitignore", | |||
| "php", | |||
| "latex", | |||
| "blade", | |||
| }, | |||
| ignore_install = {}, | |||
| modules = {}, | |||
| sync_install = true, | |||
| auto_install = true, | |||
| highlight = { | |||
| enable = true, | |||
| additional_vim_regex_highlighting = false, | |||
| disable = { "latex" }, | |||
| }, | |||
| conceal = false, | |||
| indent = { enable = true }, | |||
| autotag = { enable = true }, | |||
| textobjects = { | |||
| select = { | |||
| enable = true, | |||
| lookahead = true, | |||
| keymaps = { | |||
| ["af"] = "@function.outer", | |||
| ["if"] = "@function.inner", | |||
| ["ac"] = "@conditional.outer", | |||
| ["ic"] = "@conditional.inner", | |||
| ["al"] = "@loop.outer", | |||
| ["il"] = "@loop.inner", | |||
| }, | |||
| selection_modes = { | |||
| ["@parameter.outer"] = "v", -- charwise | |||
| ["@function.outer"] = "V", -- linewise | |||
| ["@class.outer"] = "<c-v>", -- blockwise | |||
| }, | |||
| include_surrounding_whitespace = false, | |||
| }, | |||
| move = { | |||
| enable = true, | |||
| set_jumps = true, | |||
| goto_next_start = { | |||
| ["]f"] = "@function.outer", | |||
| ["]c"] = "@conditional.outer", | |||
| ["]o"] = "@loop.outer", | |||
| }, | |||
| goto_next_end = { | |||
| ["]F"] = "@function.outer", | |||
| ["]C"] = "@conditional.outer", | |||
| ["]O"] = "@loop.outer", | |||
| }, | |||
| goto_previous_start = { | |||
| ["[f"] = "@function.outer", | |||
| ["[c"] = "@conditional.outer", | |||
| ["[o"] = "@loop.outer", | |||
| }, | |||
| goto_previous_end = { | |||
| ["[F"] = "@function.outer", | |||
| ["[C"] = "@conditional.outer", | |||
| ["[O"] = "@loop.outer", | |||
| }, | |||
| goto_next = { | |||
| ["]b"] = "@block.outer", | |||
| }, | |||
| goto_previous = { | |||
| ["[b"] = "@block.outer", | |||
| }, | |||
| }, | |||
| }, | |||
| }) | |||
| end, | |||
| }, | |||
| } | |||
| @ -1,5 +0,0 @@ | |||
| return { | |||
| "JoosepAlviste/nvim-ts-context-commentstring", | |||
| event = { "BufRead", "BufNewFile" }, | |||
| config = true, | |||
| } | |||
| @ -1,89 +1,89 @@ | |||
| return { | |||
| "stevearc/oil.nvim", | |||
| opts = {}, | |||
| -- Optional dependencies | |||
| dependencies = { "nvim-tree/nvim-web-devicons" }, | |||
| config = function() | |||
| require("oil").setup({ | |||
| default_file_explorer = true, | |||
| buf_options = { | |||
| buflisted = false, | |||
| bufhidden = "hide", | |||
| }, | |||
| win_options = { | |||
| wrap = false, | |||
| signcolumn = "no", | |||
| cursorcolumn = false, | |||
| foldcolumn = "0", | |||
| spell = false, | |||
| list = false, | |||
| conceallevel = 3, | |||
| concealcursor = "nvic", | |||
| }, | |||
| delete_to_trash = false, | |||
| skip_confirm_for_simple_edits = false, | |||
| prompt_save_on_select_new_entry = true, | |||
| cleanup_delay_ms = 2000, | |||
| keymaps = { | |||
| ["g?"] = "actions.show_help", | |||
| ["<CR>"] = "actions.select", | |||
| ["<C-s>"] = "actions.select_vsplit", | |||
| ["<C-h>"] = false, | |||
| ["<C-t>"] = "actions.select_tab", | |||
| ["<C-v>"] = "actions.preview", | |||
| ["<C-c>"] = "actions.close", | |||
| ["<C-l>"] = false, | |||
| ["-"] = "actions.parent", | |||
| ["_"] = "actions.open_cwd", | |||
| ["`"] = "actions.cd", | |||
| ["~"] = "actions.tcd", | |||
| ["gs"] = "actions.change_sort", | |||
| ["gx"] = "actions.open_external", | |||
| ["g."] = "actions.toggle_hidden", | |||
| }, | |||
| use_default_keymaps = false, | |||
| view_options = { | |||
| show_hidden = true, | |||
| is_hidden_file = function(name, _) | |||
| return vim.startswith(name, ".") | |||
| end, | |||
| is_always_hidden = function(_, _) | |||
| return false | |||
| end, | |||
| sort = { | |||
| { "type", "asc" }, | |||
| { "name", "asc" }, | |||
| }, | |||
| }, | |||
| preview = { | |||
| max_width = 0.9, | |||
| min_width = { 40, 0.4 }, | |||
| width = nil, | |||
| max_height = 0.9, | |||
| min_height = { 5, 0.1 }, | |||
| height = nil, | |||
| border = "rounded", | |||
| win_options = { | |||
| winblend = 0, | |||
| }, | |||
| }, | |||
| progress = { | |||
| max_width = 0.9, | |||
| min_width = { 40, 0.4 }, | |||
| width = nil, | |||
| max_height = { 10, 0.9 }, | |||
| min_height = { 5, 0.1 }, | |||
| height = nil, | |||
| border = "rounded", | |||
| minimized_border = "none", | |||
| win_options = { | |||
| winblend = 0, | |||
| }, | |||
| }, | |||
| }) | |||
| local M = {} | |||
| vim.keymap.set("n", "-", function() | |||
| vim.cmd("Oil") | |||
| end, { desc = "Open parent directory" }) | |||
| end, | |||
| } | |||
| M.install = { src = "https://github.com/stevearc/oil.nvim" } | |||
| M.setup = function() | |||
| require("oil").setup({ | |||
| default_file_explorer = true, | |||
| buf_options = { | |||
| buflisted = false, | |||
| bufhidden = "hide", | |||
| }, | |||
| win_options = { | |||
| wrap = false, | |||
| signcolumn = "no", | |||
| cursorcolumn = false, | |||
| foldcolumn = "0", | |||
| spell = false, | |||
| list = false, | |||
| conceallevel = 3, | |||
| concealcursor = "nvic", | |||
| }, | |||
| delete_to_trash = false, | |||
| skip_confirm_for_simple_edits = false, | |||
| prompt_save_on_select_new_entry = true, | |||
| cleanup_delay_ms = 2000, | |||
| keymaps = { | |||
| ["g?"] = "actions.show_help", | |||
| ["<CR>"] = "actions.select", | |||
| ["<C-s>"] = "actions.select_vsplit", | |||
| ["<C-h>"] = false, | |||
| ["<C-t>"] = "actions.select_tab", | |||
| ["<C-v>"] = "actions.preview", | |||
| ["<C-c>"] = "actions.close", | |||
| ["<C-l>"] = false, | |||
| ["-"] = "actions.parent", | |||
| ["_"] = "actions.open_cwd", | |||
| ["`"] = "actions.cd", | |||
| ["~"] = "actions.tcd", | |||
| ["gs"] = "actions.change_sort", | |||
| ["gx"] = "actions.open_external", | |||
| ["g."] = "actions.toggle_hidden", | |||
| }, | |||
| use_default_keymaps = false, | |||
| view_options = { | |||
| show_hidden = true, | |||
| is_hidden_file = function(name, _) | |||
| return vim.startswith(name, ".") | |||
| end, | |||
| is_always_hidden = function(_, _) | |||
| return false | |||
| end, | |||
| sort = { | |||
| { "type", "asc" }, | |||
| { "name", "asc" }, | |||
| }, | |||
| }, | |||
| preview = { | |||
| max_width = 0.9, | |||
| min_width = { 40, 0.4 }, | |||
| width = nil, | |||
| max_height = 0.9, | |||
| min_height = { 5, 0.1 }, | |||
| height = nil, | |||
| border = "rounded", | |||
| win_options = { | |||
| winblend = 0, | |||
| }, | |||
| }, | |||
| progress = { | |||
| max_width = 0.9, | |||
| min_width = { 40, 0.4 }, | |||
| width = nil, | |||
| max_height = { 10, 0.9 }, | |||
| min_height = { 5, 0.1 }, | |||
| height = nil, | |||
| border = "rounded", | |||
| minimized_border = "none", | |||
| win_options = { | |||
| winblend = 0, | |||
| }, | |||
| }, | |||
| }) | |||
| vim.keymap.set("n", "-", function() | |||
| vim.cmd("Oil") | |||
| end, { desc = "Open parent directory" }) | |||
| end | |||
| return M | |||
| @ -1,270 +0,0 @@ | |||
| return { | |||
| "folke/snacks.nvim", | |||
| priority = 1000, | |||
| lazy = false, | |||
| opts = { | |||
| -- Dashboard/Starter | |||
| dashboard = { enabled = false }, | |||
| -- Notification system (replaces nvim-notify) | |||
| notifier = { | |||
| enabled = true, | |||
| timeout = 5000, | |||
| width = { min = 50, max = 0.4 }, | |||
| height = { min = 1, max = 0.6 }, | |||
| margin = { top = 0, right = 1, bottom = 0 }, | |||
| padding = true, | |||
| sort = { "level", "added" }, | |||
| level = vim.log.levels.INFO, | |||
| icons = { | |||
| error = " ", | |||
| warn = " ", | |||
| info = " ", | |||
| debug = " ", | |||
| trace = "✎ ", | |||
| }, | |||
| style = "compact", | |||
| }, | |||
| -- File picker (replaces telescope) | |||
| picker = { | |||
| enabled = true, | |||
| -- Performance optimizations | |||
| show_delay = 0, -- Show picker immediately (default is 5000ms) | |||
| limit_live = 5000, -- Reduce live search limit for better performance | |||
| matcher = { | |||
| frecency = false, -- Disable frecency for faster startup (enable if you want recency scoring) | |||
| cwd_bonus = false, -- Disable for better performance | |||
| history_bonus = false, -- Disable for better performance | |||
| }, | |||
| formatters = { | |||
| file = { | |||
| filename_first = true, | |||
| }, | |||
| }, | |||
| win = { | |||
| input = { | |||
| keys = { | |||
| ["<C-n>"] = { "list_down", mode = { "i", "n" } }, | |||
| ["<C-p>"] = { "list_up", mode = { "i", "n" } }, | |||
| ["<C-j>"] = { "history_next", mode = { "i", "n" } }, | |||
| ["<C-k>"] = { "history_prev", mode = { "i", "n" } }, | |||
| ["<C-q>"] = { "qflist", mode = { "i", "n" } }, | |||
| ["<C-c>"] = { "close", mode = { "i", "n" } }, | |||
| }, | |||
| }, | |||
| }, | |||
| sources = { | |||
| files = { | |||
| hidden = true, | |||
| follow = true, | |||
| -- Let snacks auto-detect fd (fastest) or fallback to rg/find | |||
| }, | |||
| grep = { | |||
| hidden = true, | |||
| follow = true, | |||
| }, | |||
| }, | |||
| }, | |||
| -- Quickfile (fast file operations) | |||
| quickfile = { enabled = true }, | |||
| -- Statuscolumn enhancements | |||
| statuscolumn = { | |||
| enabled = true, | |||
| left = { "mark", "sign" }, -- priority of signs on the left (high to low) | |||
| right = { "fold", "git" }, -- priority of signs on the right (high to low) | |||
| folds = { | |||
| open = false, -- show open fold icons | |||
| git_hl = false, -- use Git Signs hl for fold icons | |||
| }, | |||
| git = { | |||
| -- patterns to match Git signs | |||
| patterns = { "GitSign", "MiniDiffSign" }, | |||
| }, | |||
| refresh = 50, -- refresh at most every 50ms | |||
| }, | |||
| -- Word highlighting | |||
| words = { enabled = true }, | |||
| -- Styling for inputs | |||
| input = { enabled = true }, | |||
| -- Scrolling | |||
| scroll = { enabled = false }, | |||
| -- Indent guides | |||
| indent = { enabled = false }, | |||
| -- Scope highlighting | |||
| scope = { enabled = true }, | |||
| -- Git integration with blame | |||
| git = { | |||
| enabled = true, | |||
| }, | |||
| gitbrowse = { | |||
| enabled = true, | |||
| }, | |||
| -- Rename with LSP | |||
| rename = { enabled = true }, | |||
| -- Terminal | |||
| terminal = { enabled = true }, | |||
| -- Zen mode | |||
| zen = { enabled = false }, | |||
| -- Dim inactive windows | |||
| dim = { enabled = false }, | |||
| -- Better quickfix | |||
| quickfix = { enabled = true }, | |||
| -- Scratch buffer | |||
| scratch = { enabled = true }, | |||
| -- Toggle options | |||
| toggle = { enabled = true }, | |||
| -- Profiler | |||
| profiler = { enabled = false }, | |||
| -- Debugging helpers | |||
| debug = { enabled = false }, | |||
| -- Treesitter scope | |||
| treesitter = { enabled = true }, | |||
| }, | |||
| keys = { | |||
| -- File navigation (replacing telescope keybindings) | |||
| { "<leader>p", function() Snacks.picker.smart() end, desc = "Find project files" }, | |||
| { "<leader>ff", function() Snacks.picker.grep() end, desc = "Live grep" }, | |||
| { "<leader>fg", function() Snacks.picker.grep() end, desc = "Live grep" }, | |||
| { "<leader>fr", function() Snacks.picker.resume() end, desc = "Resume last picker" }, | |||
| { "<leader>fb", function() Snacks.picker.buffers() end, desc = "Find buffers" }, | |||
| { "<leader>fo", function() Snacks.picker.recent() end, desc = "Find recent files" }, | |||
| { "<leader>fc", function() Snacks.picker.commands() end, desc = "Find commands" }, | |||
| -- Search | |||
| { | |||
| "<leader>fw", | |||
| function() | |||
| Snacks.picker.grep_word() | |||
| end, | |||
| desc = "Grep word under cursor" | |||
| }, | |||
| { | |||
| "<leader>fW", | |||
| function() | |||
| local word = vim.fn.expand("<cWORD>") | |||
| Snacks.picker.grep({ search = word }) | |||
| end, | |||
| desc = "Grep WORD under cursor" | |||
| }, | |||
| { | |||
| "<leader>fw", | |||
| function() | |||
| local mode = vim.fn.mode() | |||
| if mode == 'v' or mode == 'V' then | |||
| vim.cmd('noau normal! "vy"') | |||
| local text = vim.fn.getreg('v') | |||
| vim.fn.setreg('v', {}) | |||
| text = string.gsub(text, "\n", "") | |||
| if #text > 0 then | |||
| Snacks.picker.grep({ search = text }) | |||
| else | |||
| Snacks.picker.grep() | |||
| end | |||
| end | |||
| end, | |||
| mode = "v", | |||
| desc = "Grep selection" | |||
| }, | |||
| { | |||
| "<leader>fF", | |||
| function() | |||
| local word = vim.fn.expand("<cword>") | |||
| Snacks.picker.files({ search = word }) | |||
| end, | |||
| desc = "Find file with name under cursor" | |||
| }, | |||
| -- Git | |||
| { "<leader>gb", function() Snacks.picker.git_branches() end, desc = "Git branches" }, | |||
| { "<leader>gc", function() Snacks.picker.git_log() end, desc = "Git commits" }, | |||
| { "<leader>gs", function() Snacks.picker.git_status() end, desc = "Git status" }, | |||
| { "<leader>gbl", function() Snacks.git.blame_line() end, desc = "Git blame line" }, | |||
| -- LSP | |||
| { "<leader>ds", function() Snacks.picker.lsp_symbols() end, desc = "Document symbols" }, | |||
| { "<leader>ws", function() Snacks.picker.lsp_symbols({ symbols = "workspace" }) end, desc = "Workspace symbols" }, | |||
| { "<leader>dws", function() Snacks.picker.lsp_symbols({ symbols = "workspace" }) end, desc = "Dynamic workspace symbols" }, | |||
| { "gd", function() Snacks.picker.lsp_definitions() end, desc = "Go to definition" }, | |||
| { "gr", function() Snacks.picker.lsp_references() end, desc = "Go to references" }, | |||
| { "gI", function() Snacks.picker.lsp_implementations() end, desc = "Go to implementation" }, | |||
| -- Utilities | |||
| { "<leader>fs", function() Snacks.picker.spelling() end, desc = "Spell suggestions" }, | |||
| { "<leader>fm", function() Snacks.picker.marks() end, desc = "Marks" }, | |||
| { "<leader>fh", function() Snacks.picker.command_history() end, desc = "Command history" }, | |||
| { "<leader>fH", function() Snacks.picker.help() end, desc = "Help tags" }, | |||
| { "<leader>fk", function() Snacks.picker.keymaps() end, desc = "Keymaps" }, | |||
| { "<leader>:", function() Snacks.picker.commands() end, desc = "Commands" }, | |||
| -- Quickfix | |||
| { "<leader>fq", function() Snacks.picker.qflist() end, desc = "Quickfix list" }, | |||
| { "<leader>fl", function() Snacks.picker.loclist() end, desc = "Location list" }, | |||
| -- Diagnostics | |||
| { "<leader>fd", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" }, | |||
| -- Additional snacks features | |||
| { "<leader>gg", function() Snacks.lazygit() end, desc = "Lazygit" }, | |||
| { "<leader>gf", function() Snacks.lazygit.log_file() end, desc = "Lazygit log (current file)" }, | |||
| { "<leader>gl", function() Snacks.lazygit.log() end, desc = "Lazygit log" }, | |||
| { "<leader>un", function() Snacks.notifier.hide() end, desc = "Dismiss notifications" }, | |||
| { "<leader>nh", function() Snacks.notifier.show_history() end, desc = "Notification history" }, | |||
| { "<c-/>", function() Snacks.terminal() end, desc = "Toggle terminal", mode = { "n", "t" } }, | |||
| { "<c-_>", function() Snacks.terminal() end, desc = "Toggle terminal (which_key)", mode = { "n", "t" } }, | |||
| { "]]", function() Snacks.words.jump(vim.v.count1) end, desc = "Next reference", mode = { "n", "t" } }, | |||
| { "[[", function() Snacks.words.jump(-vim.v.count1) end, desc = "Prev reference", mode = { "n", "t" } }, | |||
| { "<leader>N", function() Snacks.notifier.show_history() end, desc = "Notification history" }, | |||
| { "<leader>bd", function() Snacks.bufdelete() end, desc = "Delete buffer" }, | |||
| { "<leader>cR", function() Snacks.rename.rename_file() end, desc = "Rename file" }, | |||
| { "<leader>gB", function() Snacks.gitbrowse() end, desc = "Git browse" }, | |||
| { "<leader>S", function() Snacks.profiler.scratch() end, desc = "Profiler scratch buffer" }, | |||
| }, | |||
| init = function() | |||
| -- Setup notification handler immediately | |||
| vim.notify = function(msg, level, opts) | |||
| return Snacks.notifier.notify(msg, level, opts) | |||
| end | |||
| vim.api.nvim_create_autocmd("User", { | |||
| pattern = "VeryLazy", | |||
| callback = function() | |||
| -- Create some toggle keymaps | |||
| Snacks.toggle.option("spell", { name = "Spelling" }):map("<leader>us") | |||
| Snacks.toggle.option("wrap", { name = "Wrap" }):map("<leader>uw") | |||
| Snacks.toggle.option("relativenumber", { name = "Relative Number" }):map("<leader>uL") | |||
| Snacks.toggle.diagnostics():map("<leader>ud") | |||
| Snacks.toggle.line_number():map("<leader>ul") | |||
| Snacks.toggle.option("conceallevel", { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 }) | |||
| :map("<leader>uc") | |||
| Snacks.toggle.treesitter():map("<leader>uT") | |||
| Snacks.toggle.option("background", { off = "light", on = "dark", name = "Dark Background" }):map( | |||
| "<leader>ub") | |||
| Snacks.toggle.inlay_hints():map("<leader>uh") | |||
| Snacks.toggle.indent():map("<leader>ug") | |||
| Snacks.toggle.dim():map("<leader>uD") | |||
| end, | |||
| }) | |||
| end, | |||
| } | |||
| @ -1,9 +0,0 @@ | |||
| return { | |||
| "rachartier/tiny-inline-diagnostic.nvim", | |||
| event = "VeryLazy", | |||
| priority = 1000, | |||
| config = function() | |||
| require("tiny-inline-diagnostic").setup() | |||
| vim.diagnostic.config({ virtual_text = false }) -- Disable Neovim's default virtual text diagnostics | |||
| end, | |||
| } | |||
| @ -1,20 +1,22 @@ | |||
| return { | |||
| "aserowy/tmux.nvim", | |||
| event = "VeryLazy", | |||
| config = function() | |||
| require("tmux").setup({ | |||
| copy_sync = { | |||
| enable = false, | |||
| }, | |||
| navigation = { | |||
| cycle_navigation = true, | |||
| enable_default_keybindings = true, | |||
| persist_zoom = true, | |||
| }, | |||
| resize = { | |||
| -- enables default keybindings (A-hjkl) for normal mode | |||
| enable_default_keybindings = false, | |||
| }, | |||
| }) | |||
| end, | |||
| } | |||
| local M = {} | |||
| M.install = { src = "https://github.com/aserowy/tmux.nvim" } | |||
| M.setup = function () | |||
| require("tmux").setup({ | |||
| copy_sync = { | |||
| enable = false, | |||
| }, | |||
| navigation = { | |||
| cycle_navigation = true, | |||
| enable_default_keybindings = true, | |||
| persist_zoom = true, | |||
| }, | |||
| resize = { | |||
| -- enables default keybindings (A-hjkl) for normal mode | |||
| enable_default_keybindings = false, | |||
| }, | |||
| }) | |||
| end | |||
| return M | |||
| @ -1,16 +0,0 @@ | |||
| return { | |||
| "folke/todo-comments.nvim", | |||
| event = "VeryLazy", | |||
| dependencies = { "nvim-lua/plenary.nvim" }, | |||
| config = function() | |||
| require("todo-comments").setup() | |||
| vim.keymap.set("n", "<leader>tt", function() | |||
| require("todo-comments.fzf").todo() | |||
| end, {}) | |||
| vim.keymap.set("n", "<leader>tq", function() | |||
| vim.cmd("TodoQuickFix") | |||
| end, {}) | |||
| end, | |||
| } | |||
| @ -0,0 +1,80 @@ | |||
| local M = {} | |||
| M.install = { src = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects", version = "main" } | |||
| M.setup = function() | |||
| -- configuration | |||
| require("nvim-treesitter-textobjects").setup { | |||
| select = { | |||
| -- Automatically jump forward to textobj, similar to targets.vim | |||
| lookahead = true, | |||
| -- You can choose the select mode (default is charwise 'v') | |||
| -- | |||
| -- Can also be a function which gets passed a table with the keys | |||
| -- * query_string: eg '@function.inner' | |||
| -- * method: eg 'v' or 'o' | |||
| -- and should return the mode ('v', 'V', or '<c-v>') or a table | |||
| -- mapping query_strings to modes. | |||
| selection_modes = { | |||
| ['@parameter.outer'] = 'v', -- charwise | |||
| ['@function.outer'] = 'V', -- linewise | |||
| -- ['@class.outer'] = '<c-v>', -- blockwise | |||
| }, | |||
| -- If you set this to `true` (default is `false`) then any textobject is | |||
| -- extended to include preceding or succeeding whitespace. Succeeding | |||
| -- whitespace has priority in order to act similarly to eg the built-in | |||
| -- `ap`. | |||
| -- | |||
| -- Can also be a function which gets passed a table with the keys | |||
| -- * query_string: eg '@function.inner' | |||
| -- * selection_mode: eg 'v' | |||
| -- and should return true of false | |||
| include_surrounding_whitespace = false, | |||
| }, | |||
| move = { | |||
| -- whether to set jumps in the jumplist | |||
| set_jumps = true, | |||
| }, | |||
| } | |||
| -- Select textobjects | |||
| local select = require('nvim-treesitter-textobjects.select') | |||
| vim.keymap.set({'n', 'x', 'o'}, 'af', function() select.select_textobject('@function.outer', 'textobjects') end) | |||
| vim.keymap.set({'n', 'x', 'o'}, 'if', function() select.select_textobject('@function.inner', 'textobjects') end) | |||
| vim.keymap.set({'n', 'x', 'o'}, 'ac', function() select.select_textobject('@conditional.outer', 'textobjects') end) | |||
| vim.keymap.set({'n', 'x', 'o'}, 'ic', function() select.select_textobject('@conditional.inner', 'textobjects') end) | |||
| vim.keymap.set({'n', 'x', 'o'}, 'al', function() select.select_textobject('@loop.outer', 'textobjects') end) | |||
| vim.keymap.set({'n', 'x', 'o'}, 'il', function() select.select_textobject('@loop.inner', 'textobjects') end) | |||
| -- Move textobjects | |||
| local move = require('nvim-treesitter-textobjects.move') | |||
| vim.keymap.set({'n', 'x', 'o'}, ']f', function() move.goto_next_start('@function.outer', 'textobjects') end) | |||
| vim.keymap.set({'n', 'x', 'o'}, ']c', function() move.goto_next_start('@conditional.outer', 'textobjects') end) | |||
| vim.keymap.set({'n', 'x', 'o'}, ']o', function() move.goto_next_start('@loop.outer', 'textobjects') end) | |||
| vim.keymap.set({'n', 'x', 'o'}, ']b', function() move.goto_next_start('@block.outer', 'textobjects') end) | |||
| vim.keymap.set({'n', 'x', 'o'}, ']F', function() move.goto_next_end('@function.outer', 'textobjects') end) | |||
| vim.keymap.set({'n', 'x', 'o'}, ']C', function() move.goto_next_end('@conditional.outer', 'textobjects') end) | |||
| vim.keymap.set({'n', 'x', 'o'}, ']O', function() move.goto_next_end('@loop.outer', 'textobjects') end) | |||
| vim.keymap.set({'n', 'x', 'o'}, '[f', function() move.goto_previous_start('@function.outer', 'textobjects') end) | |||
| vim.keymap.set({'n', 'x', 'o'}, '[c', function() move.goto_previous_start('@conditional.outer', 'textobjects') end) | |||
| vim.keymap.set({'n', 'x', 'o'}, '[o', function() move.goto_previous_start('@loop.outer', 'textobjects') end) | |||
| vim.keymap.set({'n', 'x', 'o'}, '[b', function() move.goto_previous_start('@block.outer', 'textobjects') end) | |||
| vim.keymap.set({'n', 'x', 'o'}, '[F', function() move.goto_previous_end('@function.outer', 'textobjects') end) | |||
| vim.keymap.set({'n', 'x', 'o'}, '[C', function() move.goto_previous_end('@conditional.outer', 'textobjects') end) | |||
| vim.keymap.set({'n', 'x', 'o'}, '[O', function() move.goto_previous_end('@loop.outer', 'textobjects') end) | |||
| -- Make movements repeatable with ; and , | |||
| local ts_repeat_move = require('nvim-treesitter-textobjects.repeatable_move') | |||
| vim.keymap.set({'n', 'x', 'o'}, ';', ts_repeat_move.repeat_last_move_next) | |||
| vim.keymap.set({'n', 'x', 'o'}, ',', ts_repeat_move.repeat_last_move_previous) | |||
| -- Make builtin f, F, t, T also repeatable | |||
| vim.keymap.set({'n', 'x', 'o'}, 'f', ts_repeat_move.builtin_f_expr, { expr = true }) | |||
| vim.keymap.set({'n', 'x', 'o'}, 'F', ts_repeat_move.builtin_F_expr, { expr = true }) | |||
| vim.keymap.set({'n', 'x', 'o'}, 't', ts_repeat_move.builtin_t_expr, { expr = true }) | |||
| vim.keymap.set({'n', 'x', 'o'}, 'T', ts_repeat_move.builtin_T_expr, { expr = true }) | |||
| end | |||
| return M | |||
| @ -0,0 +1,44 @@ | |||
| local M = {} | |||
| M.install = { src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main" } | |||
| M.setup = function() | |||
| require("nvim-treesitter").setup { | |||
| install_dir = vim.fn.stdpath('data') .. '/site', | |||
| indent = { | |||
| enable = true, | |||
| }, | |||
| } | |||
| -- Install parsers | |||
| require('nvim-treesitter').install({ | |||
| 'json', | |||
| 'javascript', | |||
| 'typescript', | |||
| 'tsx', | |||
| 'yaml', | |||
| 'html', | |||
| 'css', | |||
| 'markdown', | |||
| 'markdown_inline', | |||
| 'bash', | |||
| 'lua', | |||
| 'vim', | |||
| 'dockerfile', | |||
| 'gitignore', | |||
| 'php', | |||
| 'latex', | |||
| 'blade' | |||
| }) | |||
| vim.api.nvim_create_autocmd('FileType', { | |||
| pattern = { | |||
| 'php', | |||
| 'ts', | |||
| 'vue', | |||
| }, | |||
| callback = function() vim.treesitter.start() end, | |||
| }) | |||
| end | |||
| return M | |||
| @ -0,0 +1,87 @@ | |||
| { | |||
| "plugins": { | |||
| "FixCursorHold.nvim": { | |||
| "rev": "1900f89dc17c603eec29960f57c00bd9ae696495", | |||
| "src": "https://github.com/antoinemadec/FixCursorHold.nvim" | |||
| }, | |||
| "diffview.nvim": { | |||
| "rev": "4516612fe98ff56ae0415a259ff6361a89419b0a", | |||
| "src": "https://github.com/sindrets/diffview.nvim" | |||
| }, | |||
| "gitsigns.nvim": { | |||
| "rev": "130beacf8a51f00aede9c31064c749136679a321", | |||
| "src": "https://github.com/lewis6991/gitsigns.nvim" | |||
| }, | |||
| "harpoon": { | |||
| "rev": "87b1a3506211538f460786c23f98ec63ad9af4e5", | |||
| "src": "https://github.com/ThePrimeagen/harpoon", | |||
| "version": "'harpoon2'" | |||
| }, | |||
| "kanagawa.nvim": { | |||
| "rev": "aef7f5cec0a40dbe7f3304214850c472e2264b10", | |||
| "src": "https://github.com/rebelot/kanagawa.nvim" | |||
| }, | |||
| "mason.nvim": { | |||
| "rev": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800", | |||
| "src": "https://github.com/mason-org/mason.nvim" | |||
| }, | |||
| "mini.pick": { | |||
| "rev": "0c56dc3ef9b15e9659ce09331fdc82449349701b", | |||
| "src": "https://github.com/nvim-mini/mini.pick" | |||
| }, | |||
| "neotest": { | |||
| "rev": "deadfb1af5ce458742671ad3a013acb9a6b41178", | |||
| "src": "https://github.com/nvim-neotest/neotest" | |||
| }, | |||
| "neotest-docker-phpunit.nvim": { | |||
| "rev": "1da5ab0eac5684bdfdc8dc248e4bc357a58d7d91", | |||
| "src": "https://github.com/praem90/neotest-docker-phpunit.nvim" | |||
| }, | |||
| "neotest-go": { | |||
| "rev": "59b50505053f9c45a9febb79e11a56206c3e3901", | |||
| "src": "https://github.com/nvim-neotest/neotest-go" | |||
| }, | |||
| "neotest-phpunit": { | |||
| "rev": "2761ae9e9a385e491a9731f8c52824e1be64a68f", | |||
| "src": "https://github.com/olimorris/neotest-phpunit" | |||
| }, | |||
| "nvim-lint": { | |||
| "rev": "1f19dacd945a7b1a57f29f32b2d7168384df3d36", | |||
| "src": "https://github.com/mfussenegger/nvim-lint" | |||
| }, | |||
| "nvim-lspconfig": { | |||
| "rev": "d696e36d5792daf828f8c8e8d4b9aa90c1a10c2a", | |||
| "src": "https://github.com/neovim/nvim-lspconfig" | |||
| }, | |||
| "nvim-nio": { | |||
| "rev": "21f5324bfac14e22ba26553caf69ec76ae8a7662", | |||
| "src": "https://github.com/nvim-neotest/nvim-nio" | |||
| }, | |||
| "nvim-treesitter": { | |||
| "rev": "36fcb4a4238928f0b627e1ab84ade0acc1facc2c", | |||
| "src": "https://github.com/nvim-treesitter/nvim-treesitter", | |||
| "version": "'main'" | |||
| }, | |||
| "nvim-treesitter-textobjects": { | |||
| "rev": "ecd03f5811eb5c66d2fa420b79121b866feecd82", | |||
| "src": "https://github.com/nvim-treesitter/nvim-treesitter-textobjects", | |||
| "version": "'main'" | |||
| }, | |||
| "oil.nvim": { | |||
| "rev": "756dec855b4811f2d27f067a3aca477f368d99f5", | |||
| "src": "https://github.com/stevearc/oil.nvim" | |||
| }, | |||
| "plenary.nvim": { | |||
| "rev": "b9fd5226c2f76c951fc8ed5923d85e4de065e509", | |||
| "src": "https://github.com/nvim-lua/plenary.nvim" | |||
| }, | |||
| "tmux.nvim": { | |||
| "rev": "2c1c3be0ef287073cef963f2aefa31a15c8b9cd8", | |||
| "src": "https://github.com/aserowy/tmux.nvim" | |||
| }, | |||
| "vim-fugitive": { | |||
| "rev": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4", | |||
| "src": "https://github.com/tpope/vim-fugitive" | |||
| } | |||
| } | |||
| } | |||
| @ -1 +0,0 @@ | |||
| {"name":"my-snippets","contributes":{"snippets":[{"path":".\/vue.json","language":["vue"]}]},"description":"This package.json has been generated by nvim-scissors."} | |||
| @ -1 +0,0 @@ | |||
| {"t + $t":{"prefix":["t","$t"],"body":"{{ $t('${1}') }}"},"this.t + this.$t":{"prefix":["this.t","this.$t"],"body":"this.$t('${1}')"}} | |||
| @ -0,0 +1,20 @@ | |||
| #!/bin/bash | |||
| # File to store the current state | |||
| STATE_FILE="$HOME/.caps_esc_swap_state" | |||
| # Default layout - change this to match your keyboard layout (us, au, etc.) | |||
| LAYOUT="${RIVER_KEYBOARD_LAYOUT:-us}" | |||
| # Check current state | |||
| if [ -f "$STATE_FILE" ]; then | |||
| # Currently swapped, so swap back to normal | |||
| riverctl keyboard-layout "$LAYOUT" | |||
| rm "$STATE_FILE" | |||
| echo "Restored CapsLock and Escape to normal" | |||
| else | |||
| # Not swapped, so swap them | |||
| riverctl keyboard-layout -options "caps:swapescape" "$LAYOUT" | |||
| touch "$STATE_FILE" | |||
| echo "Swapped CapsLock and Escape" | |||
| fi | |||
| @ -1,14 +0,0 @@ | |||
| #!/bin/bash | |||
| # Check if keyd is using the swapped config | |||
| if pgrep -f "keyd.*default.conf" > /dev/null && keyd list | grep -q "capslock = esc"; then | |||
| # Currently swapped, switch to normal config | |||
| sudo cp ~/.config/keyd/normal.conf ~/.config/keyd/default.conf | |||
| sudo keyd reload | |||
| notify-send "Keyboard Layout" "Caps Lock and Escape returned to normal" -i input-keyboard | |||
| else | |||
| # Not swapped, switch to swapped config | |||
| sudo cp ~/.config/keyd/swapped.conf ~/.config/keyd/default.conf | |||
| sudo keyd reload | |||
| notify-send "Keyboard Layout" "Caps Lock and Escape swapped" -i input-keyboard | |||
| fi | |||
| @ -1,3 +0,0 @@ | |||
| #!/bin/bash | |||
| echo "You fucking bozo" | |||
| @ -1,71 +0,0 @@ | |||
| #!/bin/bash | |||
| # Hyprland Monitor Management Script | |||
| # Disables eDP-1 when both DP-5 and DP-6 are connected | |||
| # Function to check if a monitor is connected | |||
| check_monitor_connected() { | |||
| local monitor_name="$1" | |||
| hyprctl monitors -j | jq -r ".[].name" | grep -q "^${monitor_name}$" | |||
| } | |||
| # Function to check if a monitor is disabled | |||
| check_monitor_disabled() { | |||
| local monitor_name="$1" | |||
| hyprctl monitors -j | jq -r ".[] | select(.name == \"${monitor_name}\") | .disabled" 2>/dev/null | |||
| } | |||
| # Function to disable a monitor | |||
| disable_monitor() { | |||
| local monitor_name="$1" | |||
| echo "Disabling monitor: $monitor_name" | |||
| hyprctl keyword monitor "$monitor_name,disable" | |||
| } | |||
| # Function to enable a monitor (you might want to customize the resolution/position) | |||
| enable_monitor() { | |||
| local monitor_name="$1" | |||
| echo "Enabling monitor: $monitor_name" | |||
| # Adjust the resolution and position as needed for your eDP-1 | |||
| hyprctl keyword monitor "$monitor_name,preferred,auto,1" | |||
| } | |||
| # Main logic | |||
| main() { | |||
| # Check if both external monitors are connected | |||
| if check_monitor_connected "DP-5" && check_monitor_connected "DP-6"; then | |||
| echo "Both DP-5 and DP-6 are connected" | |||
| # Check if eDP-1 is currently enabled | |||
| if check_monitor_connected "eDP-1"; then | |||
| local edp_disabled=$(check_monitor_disabled "eDP-1") | |||
| if [[ "$edp_disabled" == "false" ]]; then | |||
| echo "eDP-1 is enabled, disabling it..." | |||
| disable_monitor "eDP-1" | |||
| else | |||
| echo "eDP-1 is already disabled" | |||
| fi | |||
| else | |||
| echo "eDP-1 is not detected" | |||
| fi | |||
| else | |||
| echo "Not both external monitors are connected" | |||
| # Check if eDP-1 exists and is disabled, then enable it | |||
| if check_monitor_connected "eDP-1"; then | |||
| local edp_disabled=$(check_monitor_disabled "eDP-1") | |||
| if [[ "$edp_disabled" == "true" ]]; then | |||
| echo "eDP-1 is disabled, enabling it..." | |||
| enable_monitor "eDP-1" | |||
| else | |||
| echo "eDP-1 is already enabled" | |||
| fi | |||
| else | |||
| echo "eDP-1 is not detected" | |||
| fi | |||
| fi | |||
| } | |||
| # Run the main function | |||
| main "$@" | |||
| @ -1,3 +0,0 @@ | |||
| #!/bin/bash | |||
| xrandr --output HDMI-1 --scale 1.5x1.5 | |||
| @ -1,17 +0,0 @@ | |||
| #!/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 | |||