diff --git a/.config/aliasrc b/.config/aliasrc index 87e663b..3680c79 100644 --- a/.config/aliasrc +++ b/.config/aliasrc @@ -46,3 +46,28 @@ alias jack-phpunit="dce app-fpm ./vendor/bin/phpunit" alias jack-subscription-artisan="dce subscription-fpm ./artisan" alias jack-subscription-paratest="dce subscription-fpm ./test" alias jack-subscription-phpunit="dce subscription-fpm ./vendor/bin/phpunit" + +alias t11wl='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.11.14 workspace list ' +alias t11ws='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.11.14 workspace select ' +alias t11wd='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.11.14 workspace delete ' +alias t11='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.11.14 ' + +alias t10wl='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.10.8 workspace list ' +alias t10ws='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.10.8 workspace select ' +alias t10wd='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.10.8 workspace delete ' +alias t10='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.10.8 ' + +alias t12wl='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.12.0 workspace list ' +alias t12ws='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.12.0 workspace select ' +alias t12wd='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.12.0 workspace delete ' +alias t12='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.12.0 ' + +alias t1227wl='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.12.27 workspace list ' +alias t1227ws='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.12.27 workspace select ' +alias t1227wd='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.12.27 workspace delete ' +alias t1227='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.12.27 ' + +alias t1231wl='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.12.31 workspace list ' +alias t1231ws='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.12.31 workspace select ' +alias t1231wd='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.12.31 workspace delete ' +alias t1231='docker run -it -v $(pwd):/workspace -v /root/.ssh:/root/.ssh:ro -v ~/.aws:/root/.aws -w /workspace hashicorp/terraform:0.12.31 ' diff --git a/.config/nvim/lua/lsp/utils.lua b/.config/nvim/lua/lsp/utils.lua index 329bd8f..d55d7dd 100644 --- a/.config/nvim/lua/lsp/utils.lua +++ b/.config/nvim/lua/lsp/utils.lua @@ -44,19 +44,19 @@ function M.setup_lsp_keymaps(bufnr) }) end - -- Navigation - map("n", "gr", "Telescope lsp_references", "Show LSP references") + -- 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", "Telescope lsp_definitions", "Show LSP definitions") - map("n", "gi", "Telescope lsp_implementations", "Show LSP implementations") - map("n", "gt", "Telescope lsp_type_definitions", "Show LSP type definitions") + 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" }, "ca", vim.lsp.buf.code_action, "See available code actions") map("n", "rn", vim.lsp.buf.rename, "Smart rename") -- Diagnostics - map("n", "D", "Telescope diagnostics bufnr=0", "Show buffer diagnostics") + map("n", "D", function() Snacks.picker.diagnostics({ buf = 0 }) end, "Show buffer diagnostics") map("n", "d", vim.diagnostic.open_float, "Show line diagnostics") map("n", "[d", function() vim.diagnostic.jump({ count = -1 }) diff --git a/.config/nvim/lua/plugins/claude-code.lua b/.config/nvim/lua/plugins/claude-code.lua deleted file mode 100644 index f335248..0000000 --- a/.config/nvim/lua/plugins/claude-code.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - "greggh/claude-code.nvim", - dependencies = { - "nvim-lua/plenary.nvim", -- Required for git operations - }, - config = function() - require("claude-code").setup() - - vim.keymap.set('n', 'CC', 'ClaudeCode', { desc = 'Toggle Claude Code' }) - end -} diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua index b200d03..41dfcdf 100644 --- a/.config/nvim/lua/plugins/colorscheme.lua +++ b/.config/nvim/lua/plugins/colorscheme.lua @@ -72,8 +72,6 @@ return { -- Disable or enable colorscheme extensions extensions = { - telescope = true, - notify = true, mini = true, }, }) diff --git a/.config/nvim/lua/plugins/dap.lua b/.config/nvim/lua/plugins/dap.lua deleted file mode 100644 index 74570e7..0000000 --- a/.config/nvim/lua/plugins/dap.lua +++ /dev/null @@ -1,93 +0,0 @@ -return { - "mfussenegger/nvim-dap", - dependencies = { - "rcarriga/nvim-dap-ui", - "theHamsta/nvim-dap-virtual-text", - }, - config = function() - local dap = require("dap") - local dapui = require('dapui') - - -- Setup DAP UI with explicit configuration - dapui.setup() - - dap.adapters.php = { - type = 'executable', - command = vim.fn.stdpath('data') .. '/mason/bin/php-debug-adapter', - } - - -- Get the correct project paths (make this global so keys can access it) - _G.get_project_paths = function() - local cwd = vim.fn.getcwd() - - -- Check if we're in the project root (where docker-compose.yml is) - if vim.fn.filereadable(cwd .. "/docker-compose.yml") == 1 then - return { - project_root = cwd, - api_path = cwd .. "/app/api", - docker_path = "/var/www" - } - -- Check if we're in the app/api directory - elseif string.match(cwd, "app/api$") then - local project_root = string.gsub(cwd, "/app/api$", "") - return { - project_root = project_root, - api_path = cwd, - docker_path = "/var/www" - } - else - -- Fallback - assume we're somewhere in the project - return { - project_root = cwd, - api_path = cwd, - docker_path = "/var/www" - } - end - end - - local paths = _G.get_project_paths() - - -- PHP configurations - dap.configurations.php = { - { - name = "🚀 Jack Laravel - Listen for Xdebug", - type = "php", - request = "launch", - port = 9003, - pathMappings = { - [paths.docker_path] = paths.api_path, - }, - hostname = "0.0.0.0", - log = true, - xdebugSettings = { - max_children = 512, - max_data = 1024, - max_depth = 4, - }, - }, - { - name = "🌐 Jack Laravel - Web Request Debug", - type = "php", - request = "launch", - port = 9003, - pathMappings = { - ["/var/www"] = paths.api_path, - }, - hostname = "0.0.0.0", - -- Pre-configure for Laravel routes - breakMode = "request", - } - } - end, - keys = { - { "DD", function() require("dap").continue() end, desc = "Start Laravel Debug" }, - { "Ds", function() require("dap").step_over() end, desc = "Step Over" }, - { "Di", function() require("dap").step_into() end, desc = "Step Into" }, - { "Do", function() require("dap").step_out() end, desc = "Step Out" }, -- Fixed: was "Ds" twice - { "bp", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" }, - { "bP", function() require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: ")) end, desc = "Conditional Breakpoint" }, - { "dr", function() require("dap").repl.open() end, desc = "Open REPL" }, - { "dl", function() require("dap").run_last() end, desc = "Run Last" }, - { "du", function() require("dapui").toggle() end, desc = "Toggle DAP UI" }, - }, -} diff --git a/.config/nvim/lua/plugins/hardtime.lua b/.config/nvim/lua/plugins/hardtime.lua deleted file mode 100644 index 14b8e4c..0000000 --- a/.config/nvim/lua/plugins/hardtime.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - "m4xshen/hardtime.nvim", - enabled = false, - lazy = false, - dependencies = { - "MunifTanjim/nui.nvim", - "rcarriga/nvim-notify", - }, - opts = {}, -} diff --git a/.config/nvim/lua/plugins/laravel.lua b/.config/nvim/lua/plugins/laravel.lua index 712c061..dfde800 100644 --- a/.config/nvim/lua/plugins/laravel.lua +++ b/.config/nvim/lua/plugins/laravel.lua @@ -2,7 +2,6 @@ return { dir = "~/Projects/laravel.nvim", dependencies = { "tpope/vim-dotenv", - "nvim-telescope/telescope.nvim", "MunifTanjim/nui.nvim", "kevinhwang91/promise-async", }, diff --git a/.config/nvim/lua/plugins/notify.lua b/.config/nvim/lua/plugins/notify.lua deleted file mode 100644 index 39658ce..0000000 --- a/.config/nvim/lua/plugins/notify.lua +++ /dev/null @@ -1,26 +0,0 @@ -return { - "rcarriga/nvim-notify", - event = "VeryLazy", - opts = { - background_colour = "#000000", - fps = 30, - icons = { - DEBUG = "", - ERROR = "", - INFO = "", - TRACE = "✎", - WARN = "" - }, - level = 2, - minimum_width = 50, - render = "default", - stages = "fade_in_slide_out", - timeout = 5000, - top_down = true - }, - config = function(_, opts) - local notify = require("notify") - notify.setup(opts) - vim.notify = notify - end, -} diff --git a/.config/nvim/lua/plugins/snacks.lua b/.config/nvim/lua/plugins/snacks.lua new file mode 100644 index 0000000..957064d --- /dev/null +++ b/.config/nvim/lua/plugins/snacks.lua @@ -0,0 +1,270 @@ +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 = { + [""] = { "list_down", mode = { "i", "n" } }, + [""] = { "list_up", mode = { "i", "n" } }, + [""] = { "history_next", mode = { "i", "n" } }, + [""] = { "history_prev", mode = { "i", "n" } }, + [""] = { "qflist", mode = { "i", "n" } }, + [""] = { "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) + { "p", function() Snacks.picker.smart() end, desc = "Find project files" }, + { "ff", function() Snacks.picker.grep() end, desc = "Live grep" }, + { "fg", function() Snacks.picker.grep() end, desc = "Live grep" }, + { "fr", function() Snacks.picker.resume() end, desc = "Resume last picker" }, + { "fb", function() Snacks.picker.buffers() end, desc = "Find buffers" }, + { "fo", function() Snacks.picker.recent() end, desc = "Find recent files" }, + { "fc", function() Snacks.picker.commands() end, desc = "Find commands" }, + + -- Search + { + "fw", + function() + Snacks.picker.grep_word() + end, + desc = "Grep word under cursor" + }, + + { + "fW", + function() + local word = vim.fn.expand("") + Snacks.picker.grep({ search = word }) + end, + desc = "Grep WORD under cursor" + }, + + { + "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" + }, + + { + "fF", + function() + local word = vim.fn.expand("") + Snacks.picker.files({ search = word }) + end, + desc = "Find file with name under cursor" + }, + + -- Git + { "gb", function() Snacks.picker.git_branches() end, desc = "Git branches" }, + { "gc", function() Snacks.picker.git_log() end, desc = "Git commits" }, + { "gs", function() Snacks.picker.git_status() end, desc = "Git status" }, + { "gbl", function() Snacks.git.blame_line() end, desc = "Git blame line" }, + + -- LSP + { "ds", function() Snacks.picker.lsp_symbols() end, desc = "Document symbols" }, + { "ws", function() Snacks.picker.lsp_symbols({ symbols = "workspace" }) end, desc = "Workspace symbols" }, + { "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 + { "fs", function() Snacks.picker.spelling() end, desc = "Spell suggestions" }, + { "fm", function() Snacks.picker.marks() end, desc = "Marks" }, + { "fh", function() Snacks.picker.command_history() end, desc = "Command history" }, + { "fH", function() Snacks.picker.help() end, desc = "Help tags" }, + { "fk", function() Snacks.picker.keymaps() end, desc = "Keymaps" }, + { ":", function() Snacks.picker.commands() end, desc = "Commands" }, + + -- Quickfix + { "fq", function() Snacks.picker.qflist() end, desc = "Quickfix list" }, + { "fl", function() Snacks.picker.loclist() end, desc = "Location list" }, + + -- Diagnostics + { "fd", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" }, + + -- Additional snacks features + { "gg", function() Snacks.lazygit() end, desc = "Lazygit" }, + { "gf", function() Snacks.lazygit.log_file() end, desc = "Lazygit log (current file)" }, + { "gl", function() Snacks.lazygit.log() end, desc = "Lazygit log" }, + { "un", function() Snacks.notifier.hide() end, desc = "Dismiss notifications" }, + { "nh", function() Snacks.notifier.show_history() end, desc = "Notification history" }, + { "", function() Snacks.terminal() end, desc = "Toggle terminal", mode = { "n", "t" } }, + { "", 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" } }, + { "N", function() Snacks.notifier.show_history() end, desc = "Notification history" }, + { "bd", function() Snacks.bufdelete() end, desc = "Delete buffer" }, + { "cR", function() Snacks.rename.rename_file() end, desc = "Rename file" }, + { "gB", function() Snacks.gitbrowse() end, desc = "Git browse" }, + { "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("us") + Snacks.toggle.option("wrap", { name = "Wrap" }):map("uw") + Snacks.toggle.option("relativenumber", { name = "Relative Number" }):map("uL") + Snacks.toggle.diagnostics():map("ud") + Snacks.toggle.line_number():map("ul") + Snacks.toggle.option("conceallevel", { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 }) + :map("uc") + Snacks.toggle.treesitter():map("uT") + Snacks.toggle.option("background", { off = "light", on = "dark", name = "Dark Background" }):map( + "ub") + Snacks.toggle.inlay_hints():map("uh") + Snacks.toggle.indent():map("ug") + Snacks.toggle.dim():map("uD") + end, + }) + end, +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua deleted file mode 100644 index 7b16206..0000000 --- a/.config/nvim/lua/plugins/telescope.lua +++ /dev/null @@ -1,263 +0,0 @@ -return { - "nvim-telescope/telescope.nvim", - cmd = "Telescope", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "debugloop/telescope-undo.nvim", - "nvim-telescope/telescope-ui-select.nvim", - { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, - "nvim-telescope/telescope-live-grep-args.nvim", - }, - config = function() - local telescope = require("telescope") - local actions = require("telescope.actions") - local builtin = require("telescope.builtin") - local previewers = require("telescope.previewers") - local previewers_utils = require("telescope.previewers.utils") - - -- Configuration constants - local MAX_FILE_SIZE = 100000 - - -- Enable line numbers in telescope previews - vim.api.nvim_create_autocmd('User', { - pattern = 'TelescopePreviewerLoaded', - callback = function() - vim.wo.number = true - end, - }) - - -- Truncate large files in preview to improve performance - local function truncate_large_files(filepath, bufnr, opts) - opts = opts or {} - filepath = vim.fn.expand(filepath) - - vim.uv.fs_stat(filepath, function(_, stat) - if not stat then return end - - if stat.size > MAX_FILE_SIZE then - local cmd = { "head", "-c", tostring(MAX_FILE_SIZE), filepath } - previewers_utils.job_maker(cmd, bufnr, opts) - else - previewers.buffer_previewer_maker(filepath, bufnr, opts) - end - end) - end - - -- Cache git status to avoid repeated system calls - local is_inside_work_tree = {} - - local function smart_project_files() - local cwd = vim.fn.getcwd() - - if is_inside_work_tree[cwd] == nil then - vim.fn.system("git rev-parse --is-inside-work-tree") - is_inside_work_tree[cwd] = vim.v.shell_error == 0 - end - - local opts = is_inside_work_tree[cwd] - and { show_untracked = true, hidden = true } - or {} - - local picker = is_inside_work_tree[cwd] - and builtin.git_files - or builtin.find_files - - picker(opts) - end - - -- Visual selection live grep - local function grep_string_visual() - vim.cmd('noau normal! "vy"') - local text = vim.fn.getreg('v') - vim.fn.setreg('v', {}) - - text = string.gsub(text, "\n", "") - if #text > 0 then - builtin.live_grep({ default_text = text }) - else - builtin.live_grep() - end - end - - -- Telescope setup - telescope.setup({ - defaults = { - file_sorter = require("telescope.sorters").get_fzy_sorter, - color_devicons = true, - buffer_previewer_maker = truncate_large_files, - - initial_mode = "insert", - selection_strategy = "reset", - sorting_strategy = "ascending", - path_display = { "truncate" }, - - layout_config = { - prompt_position = "top", - horizontal = { - preview_width = 0.6, - }, - vertical = { - mirror = false, - }, - }, - - -- Modern borderchars - borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, - - -- Performance optimizations - use_less = true, - set_env = { COLORTERM = "truecolor" }, - - mappings = { - i = { - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - [""] = actions.smart_send_to_qflist + actions.open_qflist, - [""] = false, -- Clear prompt - [""] = actions.close, -- Close prompt - }, - n = { - ["q"] = actions.close, - }, - }, - }, - - pickers = { - diagnostics = { - initial_mode = "normal", - layout_config = { - preview_cutoff = 9999, - }, - }, - buffers = { - sort_mru = true, - sort_lastused = true, - mappings = { - i = { - [""] = actions.delete_buffer, - }, - n = { - ["dd"] = actions.delete_buffer, - }, - }, - }, - find_files = { - hidden = true, - find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" }, - }, - }, - - extensions = { - undo = { - side_by_side = true, - layout_strategy = "vertical", - layout_config = { - preview_height = 0.8, - }, - mappings = { - i = { - [""] = require("telescope-undo.actions").restore, - }, - n = { - [""] = require("telescope-undo.actions").restore, - ["y"] = require("telescope-undo.actions").yank_additions, - ["Y"] = require("telescope-undo.actions").yank_deletions, - ["u"] = require("telescope-undo.actions").restore, - }, - }, - }, - fzf = { - fuzzy = true, - override_generic_sorter = true, - override_file_sorter = true, - case_mode = "smart_case", - }, - live_grep_args = { - auto_quoting = true, - mappings = { - i = { - [""] = require("telescope-live-grep-args.actions").quote_prompt(), - [""] = require("telescope-live-grep-args.actions").quote_prompt({ postfix = " --iglob " }), - }, - }, - }, - ["ui-select"] = { - require("telescope.themes").get_dropdown(), - }, - }, - }) - - -- Load extensions - telescope.load_extension("fzf") - telescope.load_extension("undo") - telescope.load_extension("ui-select") - telescope.load_extension("live_grep_args") - - -- Keymaps - local function map(mode, lhs, rhs, desc) - vim.keymap.set(mode, lhs, rhs, { desc = desc, noremap = true, silent = true }) - end - - -- File navigation - map("n", "ff", function() - require("telescope").extensions.live_grep_args.live_grep_args() - end, "Live grep with args") - - map("n", "fg", function() - require("plugins.telescope.multigrep").live_multgrep() - end, "Live multigrep") - - map("n", "p", smart_project_files, "Find project files") - map("n", "fr", builtin.resume, "Resume last telescope") - map("n", "fb", builtin.buffers, "Find buffers") - map("n", "fo", builtin.oldfiles, "Find recent files") - map("n", "fc", builtin.commands, "Find commands") - - -- Search - map("n", "fw", function() - builtin.grep_string({ search = vim.fn.expand("") }) - end, "Grep word under cursor") - - map("n", "fW", function() - builtin.grep_string({ search = vim.fn.expand("") }) - end, "Grep WORD under cursor") - - map("v", "fw", grep_string_visual, "Grep selection") - - map("n", "fF", function() - builtin.find_files({ search_file = vim.fn.expand("") }) - end, "Find file with name under cursor") - - -- Git - map("n", "gb", function() - builtin.git_branches({ - attach_mappings = function(_, map_func) - map_func("i", "", actions.git_delete_branch) - map_func("n", "", actions.git_delete_branch) - return true - end, - }) - end, "Git branches") - - map("n", "gc", builtin.git_commits, "Git commits") - - -- LSP - map("n", "ds", builtin.lsp_document_symbols, "Document symbols") - map("n", "ws", builtin.lsp_workspace_symbols, "Workspace symbols") - map("n", "dws", builtin.lsp_dynamic_workspace_symbols, "Dynamic workspace symbols") - - -- Utilities - map("n", "fu", "Telescope undo", "Undo history") - map("n", "fs", builtin.spell_suggest, "Spell suggestions") - map("n", "fm", builtin.marks, "Marks") - map("n", "fh", builtin.command_history, "Command history") - map("n", "fH", builtin.help_tags, "Help tags") - - -- Quickfix - map("n", "fq", builtin.quickfix, "Quickfix list") - map("n", "fQ", builtin.quickfixhistory, "Quickfix history") - end, -} diff --git a/.config/nvim/lua/plugins/telescope/multigrep.lua b/.config/nvim/lua/plugins/telescope/multigrep.lua deleted file mode 100644 index ef469ea..0000000 --- a/.config/nvim/lua/plugins/telescope/multigrep.lua +++ /dev/null @@ -1,58 +0,0 @@ -local pickers = require("telescope.pickers") -local finders = require("telescope.finders") -local make_entry = require("telescope.make_entry") -local conf = require("telescope.config").values - -local M = {} - -M.live_multgrep = function (opts) - opts = opts or {} - opts.cwd = opts.cwd or vim.uv.cwd() - - local finder = finders.new_async_job({ - command_generator = function (prompt) - if not prompt or prompt == "" then - return nil - end - - local pieces = vim.split(prompt, " ") - - local args = { "rg" } - if pieces[1] then - table.insert(args, "-e") - table.insert(args, pieces[1]) - end - - if pieces[2] then - table.insert(args, "-g") - table.insert(args, pieces[2]) - end - - ---@diagnostic disable-next-line: deprecated - return vim.iter({ - args, - { - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - "--hidden", - } - }):flatten():totable() - end, - entry_maker = make_entry.gen_from_vimgrep(opts), - cwd = opts.cwd - }) - - pickers.new(opts, { - debounce = 100, - prompt_title = "Multi Grep", - finder = finder, - previewer = conf.grep_previewer(opts), - sorter = require("telescope.sorters").empty(), - }):find() -end - -return M diff --git a/.config/nvim/lua/plugins/todo-comments.lua b/.config/nvim/lua/plugins/todo-comments.lua index 38db7fb..0270602 100644 --- a/.config/nvim/lua/plugins/todo-comments.lua +++ b/.config/nvim/lua/plugins/todo-comments.lua @@ -6,7 +6,7 @@ return { require("todo-comments").setup() vim.keymap.set("n", "tt", function() - vim.cmd("TodoTelescope") + require("todo-comments.fzf").todo() end, {}) vim.keymap.set("n", "tq", function() diff --git a/.config/nvim/lua/plugins/trouble.lua b/.config/nvim/lua/plugins/trouble.lua deleted file mode 100644 index e8689e6..0000000 --- a/.config/nvim/lua/plugins/trouble.lua +++ /dev/null @@ -1,48 +0,0 @@ -return { - "folke/trouble.nvim", - event = { "BufReadPre", "BufNewFile" }, - opts = {}, - cmd = "Trouble", - keys = { - { - "xx", - "Trouble diagnostics toggle", - desc = "Diagnostics (Trouble)", - }, - { - "xX", - "Trouble diagnostics toggle filter.buf=0", - desc = "Buffer Diagnostics (Trouble)", - }, - { - "xj", - "Trouble diagnostics next", - desc = "Diagnostics Next (Trouble)", - }, - { - "xk", - "Trouble diagnostics prev", - desc = "Diagnostics Previous (Trouble)", - }, - { - "cs", - "Trouble symbols toggle focus=false", - desc = "Symbols (Trouble)", - }, - { - "cl", - "Trouble lsp toggle focus=false win.position=right", - desc = "LSP Definitions / references / ... (Trouble)", - }, - { - "xL", - "Trouble loclist toggle", - desc = "Location List (Trouble)", - }, - { - "xQ", - "Trouble qflist toggle", - desc = "Quickfix List (Trouble)", - }, - }, -} diff --git a/.config/nvim/lua/plugins/undotree.lua b/.config/nvim/lua/plugins/undotree.lua deleted file mode 100644 index d8569a5..0000000 --- a/.config/nvim/lua/plugins/undotree.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - "mbbill/undotree", - event = "VeryLazy", - config = function() - if vim.fn.has("persistent_undo") == 0 then - return - end - - local target_path = vim.fn.expand("~/.cache/nvim/undodir/") - - if vim.fn.isdirectory(target_path) == 0 then - vim.fn.mkdir(target_path, "p", "0700") - end - - vim.opt.undodir = target_path - vim.opt.undofile = true - end, -} diff --git a/.tmux.conf b/.tmux.conf index 301d10b..f0edffc 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -35,6 +35,18 @@ bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' { if -F '#{pane_at_bottom}' bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' { if -F '#{pane_at_top}' '' 'select-pane -U' } bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' { if -F '#{pane_at_right}' '' 'select-pane -R' } +bind -r N swap-window -t -1\; select-window -t -1 +bind -r n swap-window -t +1\; select-window -t +1 + +bind -r H swap-pane -U +bind -r J swap-pane -D +bind -r K swap-pane -U +bind -r L swap-pane -D + +bind -r P switch-client -p # Previous session in list +bind -r O switch-client -n # Next session in list (O for "Other") +bind -r Space switch-client -l # Last active session (toggle) + bind-key -T copy-mode-vi 'C-h' if -F '#{pane_at_left}' '' 'select-pane -L' bind-key -T copy-mode-vi 'C-j' if -F '#{pane_at_bottom}' '' 'select-pane -D' bind-key -T copy-mode-vi 'C-k' if -F '#{pane_at_top}' '' 'select-pane -U'