diff --git a/config/nvim-lazyvim/lua/plugins/JABS.lua b/config/nvim-lazyvim/lua/plugins/JABS.lua new file mode 100644 index 0000000..88f0900 --- /dev/null +++ b/config/nvim-lazyvim/lua/plugins/JABS.lua @@ -0,0 +1,53 @@ +-- JABS https://github.com/matbme/JABS.nvim + +return { + "matbme/JABS.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + event = "VeryLazy", -- Changed from "VimEnter" to avoid conflict with startify + config = function() + require("jabs").setup({ + -- {"center", "center"}, {"right", "bottom"}, etc. + -- position = { "center", "center" }, + position = { "right", "bottom"}, + width = 40, + height = 10, + -- "single", "double", "shadow", "rounded", "none" + border = "rounded", + preview_position = "bottom", + preview = { + width = 40, + height = 10, + border = "rounded", + }, + highlight = { + current = "Title", + hidden = "Comment", + split = "WarningMsg", + alternate = "CursorLine", + }, + keymap = { + -- delete buffer + close = "d", + -- jump to buffer + jump = "", + -- horizontal split + h_split = "h", + -- vertical split + v_split = "v", + }, + symbols = { + -- symbol for the current buffer + current = "โ˜…", + -- symbol for the alternate buffer + alternate = "โ˜†", + -- symbol for visible/split buffers + split = "โއ", + -- symbol for hidden buffers + hidden = "ยท", + }, + use_devicons = true + }) + -- Keymap to toggle JABS window (change bb to your preference) + vim.keymap.set("n", "bb", "JABSOpen", { desc = "Open JABS buffer switcher" }) + end, +} diff --git a/config/nvim-lazyvim/lua/plugins/arrow.lua b/config/nvim-lazyvim/lua/plugins/arrow.lua new file mode 100644 index 0000000..adb59b6 --- /dev/null +++ b/config/nvim-lazyvim/lua/plugins/arrow.lua @@ -0,0 +1,20 @@ +-- Arrow (like harpoon) https://github.com/otavioschwanck/arrow.nvim + +return { + "otavioschwanck/arrow.nvim", + config = function() + require("arrow").setup({ + show_icons = true, -- show filetype icons + leader_key = "a", -- default keybinding prefix + window = { + border = "rounded", -- nice floating window style + }, + mappings = { + edit = "", -- open file + delete = "dd", -- remove from list + rename = "r", -- rename entry + }, + }) + end, + event = "VeryLazy", -- load when needed +} diff --git a/config/nvim-lazyvim/lua/plugins/auto-mkdir.lua b/config/nvim-lazyvim/lua/plugins/auto-mkdir.lua new file mode 100644 index 0000000..6fd25f0 --- /dev/null +++ b/config/nvim-lazyvim/lua/plugins/auto-mkdir.lua @@ -0,0 +1,37 @@ +-- Auto-mkdir https://github.com/mateuszwieloch/automkdir.nvim + +return { + "mateuszwieloch/automkdir.nvim", + lazy = false, + config = function() + require("automkdir").setup({ + blacklist = { + filetype = { + "help", + "nofile", + "quickfix", + "gitcommit", + "TelescopePrompt", + "NvimTree", + "dashboard", + "alpha", + "starter", + "lazy", + "lazygit", + "oil", + "netrw", + }, + buftype = { + "nofile", + "terminal", + "quickfix", + }, + pattern = { + -- Patterns for filenames you want to exclude + -- Example: "^/tmp/" to exclude all files in /tmp/ + }, + } + }) + end, +} + \ No newline at end of file diff --git a/config/nvim-lazyvim/lua/plugins/data-viewer.lua b/config/nvim-lazyvim/lua/plugins/data-viewer.lua new file mode 100644 index 0000000..e9c8ee8 --- /dev/null +++ b/config/nvim-lazyvim/lua/plugins/data-viewer.lua @@ -0,0 +1,39 @@ +-- Data viewer (CSV, TSV) https://github.com/VidocqH/data-viewer.nvim + +return { + "VidocqH/data-viewer.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + -- Optional: For SQLite table support + "kkharji/sqlite.lua", + }, + opts = { + -- Automatically display the table view when opening a file (default: false) + autoDisplayWhenOpenFile = false, + -- Maximum lines shown per table (default: 100) + maxLineEachTable = 100, + -- Enable color highlighting by column (default: true) + columnColorEnable = true, + -- Highlight groups cycling for columns + columnColorRoulette = { + "DataViewerColumn0", + "DataViewerColumn1", + "DataViewerColumn2", + }, + -- View configuration + view = { + float = true, -- Use a floating window (false uses current window) + width = 0.8, -- Float window width ratio (0 < width <= 1) + height = 0.8, -- Float window height ratio (0 < height <= 1) + zindex = 50, -- Floating window Z-index + }, + -- Keymap configuration + keymap = { + quit = "q", -- Quit data viewer window + next_table = "", -- Next table + prev_table = "", -- Previous table + }, + }, + -- Lazy-load commands + cmd = { "DataViewer", "DataViewerNextTable", "DataViewerPrevTable", "DataViewerClose" }, +} diff --git a/config/nvim-lazyvim/lua/plugins/diffview.lua b/config/nvim-lazyvim/lua/plugins/diffview.lua new file mode 100644 index 0000000..406bee4 --- /dev/null +++ b/config/nvim-lazyvim/lua/plugins/diffview.lua @@ -0,0 +1,48 @@ +-- Diffview https://github.com/sindrets/diffview.nvim + +return { + "sindrets/diffview.nvim", + cmd = { "DiffviewOpen", "DiffviewClose", "DiffviewToggleFiles", "DiffviewFocusFiles", "DiffviewFileHistory", "DiffviewRefresh" }, + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + require("diffview").setup({ + -- You can customize options here, see :h diffview-config + use_icons = true, + view = { + default = { + layout = "diff2_horizontal", + winbar_info = false, + }, + merge_tool = { + layout = "diff3_horizontal", + winbar_info = true, + }, + file_history = { + layout = "diff2_horizontal", + winbar_info = false, + }, + }, + file_panel = { + listing_style = "tree", + win_config = { + position = "left", + width = 35, + }, + }, + file_history_panel = { + win_config = { + position = "bottom", + height = 16, + }, + }, + -- Keymaps are set by default, but you can override them here if you want + -- See :h diffview-config-keymaps + }) + + -- Recommended keymaps for quick access + vim.keymap.set("n", "gd", "DiffviewOpen", { desc = "Open Diffview" }) + vim.keymap.set("n", "gD", "DiffviewFileHistory %", { desc = "File History (current file)" }) + vim.keymap.set("n", "gH", "DiffviewFileHistory", { desc = "File History (project)" }) + vim.keymap.set("n", "gq", "DiffviewClose", { desc = "Close Diffview" }) + end, +} diff --git a/config/nvim-lazyvim/lua/plugins/dockerfile.lua b/config/nvim-lazyvim/lua/plugins/dockerfile.lua new file mode 100644 index 0000000..250fe2a --- /dev/null +++ b/config/nvim-lazyvim/lua/plugins/dockerfile.lua @@ -0,0 +1,5 @@ +-- Dockerfile https://github.com/ekalinin/Dockerfile.vim + +return { + "ekalinin/Dockerfile.vim" +} \ No newline at end of file diff --git a/config/nvim-lazyvim/lua/plugins/floaterm.lua b/config/nvim-lazyvim/lua/plugins/floaterm.lua new file mode 100644 index 0000000..401b1ea --- /dev/null +++ b/config/nvim-lazyvim/lua/plugins/floaterm.lua @@ -0,0 +1,36 @@ +-- Floaterm https://github.com/ + +return { + "voldikss/vim-floaterm", + cmd = { "FloatermToggle", "FloatermNew", "FloatermNext", "FloatermPrev", "FloatermKill" }, -- lazy-load on command + keys = { + { "ft", "FloatermToggle", desc = "Toggle Floaterm" }, + { "fn", "FloatermNew", desc = "New Floaterm" }, + { "fj", "FloatermNext", desc = "Next Floaterm" }, + { "fk", "FloatermPrev", desc = "Prev Floaterm" }, + { "fx", "FloatermKill", desc = "Kill Floaterm" }, + }, + init = function() + -- Detect Windows properly using vim.fn.has() + local is_windows = vim.fn.has("win32") == 1 or vim.fn.has("win64") == 1 + + if is_windows then + -- Use pwsh if available, otherwise fallback to powershell + local shell = vim.fn.executable("pwsh") == 1 and "pwsh" or "powershell" + vim.opt.shell = shell + vim.opt.shellcmdflag = "-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command" + vim.opt.shellredir = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode" + vim.opt.shellpipe = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode" + vim.opt.shellquote = "" + vim.opt.shellxquote = "" + -- Floaterm settings + vim.g.floaterm_shell = shell + else + vim.opt.shell = "bash" + vim.g.floaterm_shell = "bash" + end + vim.g.floaterm_position = 'center' + vim.g.floaterm_width = 0.8 + vim.g.floaterm_height = 0.8 + end, +} diff --git a/config/nvim-lazyvim/lua/plugins/fugitive.lua b/config/nvim-lazyvim/lua/plugins/fugitive.lua new file mode 100644 index 0000000..7e44072 --- /dev/null +++ b/config/nvim-lazyvim/lua/plugins/fugitive.lua @@ -0,0 +1,24 @@ +-- Fugitive git client https://github.com/tpope/vim-fugitive + +return { + "tpope/vim-fugitive", + -- Default: "VeryLazy". "BufReadPre" if you want it loaded earlier + event = "VeryLazy", + + -- Fugitive keybinds + config = function() + vim.keymap.set("n", "gs", ":Git", { desc = "Git status (Fugitive)" }) + vim.keymap.set("n", "gd", ":Gdiffsplit", { desc = "Git diff (Fugitive)" }) + vim.keymap.set("n", "gD", ":Gvdiffsplit", { desc = "3-way diff (Fugitive)" }) + vim.keymap.set("n", "gb", ":Gblame", { desc = "Git blame (Fugitive)" }) + vim.keymap.set("n", "gl", ":Git log --oneline -- %", { desc = "Git log for file" }) + vim.keymap.set("n", "gc", ":Git commit", { desc = "Git commit" }) + vim.keymap.set("n", "gp", ":Git push", { desc = "Git push" }) + vim.keymap.set("n", "gP", ":Git pull", { desc = "Git pull" }) + vim.keymap.set("n", "gr", ":Gread", { desc = "Git checkout file (reset changes)" }) + vim.keymap.set("n", "gw", ":Gwrite", { desc = "Git add (stage) file" }) + vim.keymap.set("n", "gL", ":Gclog", { desc = "Git commit log (quickfix)" }) + vim.keymap.set("n", "gB", ":GBrowse", { desc = "Open in browser (GitHub/GitLab)" }) + vim.keymap.set("n", "ge", ":Gedit", { desc = "Edit file in working tree" }) + end, +} diff --git a/config/nvim-lazyvim/lua/plugins/garbage-day.lua b/config/nvim-lazyvim/lua/plugins/garbage-day.lua new file mode 100644 index 0000000..c6a3de2 --- /dev/null +++ b/config/nvim-lazyvim/lua/plugins/garbage-day.lua @@ -0,0 +1,16 @@ +-- Garbage collection for LSPs https://github.com/zeioth/garbage-day.vim + +return { + "zeioth/garbage-day.nvim", + dependencies = "neovim/nvim-lspconfig", + event = "VeryLazy", + opts = { + aggressive_mode = false, -- Stop all LSP clients except current buffer + excluded_lsp_clients = {}, -- null-ls, jdtls, marksman, lua_ls + grace_period = 60*15, -- 15 minutes + wakeup_delay = 0, -- ms to wait before restoring LSP after mouse re-enters neovim + notifications = false, + retries = 3, -- Times to try to start an LSP client before giving up + timeout = 1000 -- ms to wait during retries to complete + } +} diff --git a/config/nvim-lazyvim/lua/plugins/illuminate.lua b/config/nvim-lazyvim/lua/plugins/illuminate.lua new file mode 100644 index 0000000..0549e55 --- /dev/null +++ b/config/nvim-lazyvim/lua/plugins/illuminate.lua @@ -0,0 +1,52 @@ +-- Illuminate https://github.com/RRethy/vim-illuminate +return { + "RRethy/vim-illuminate", + event = { "BufReadPost", "BufNewFile" }, + config = function() + local ok, illuminate = pcall(require, "illuminate") + if not ok or not illuminate.configure then + vim.notify("[illuminate] failed to load, skipping configuration", vim.log.levels.WARN) + return + end + + -- Build providers list dynamically: include only ones that are likely available + local providers = {} + + -- LSP provider: only if any LSP client is attached or lsp module exists + do + local has_lsp = false + -- quick sanity check: see if lsp is available in runtime + if pcall(require, "vim.lsp") then + has_lsp = true + end + if has_lsp then + table.insert(providers, "lsp") + end + end + + -- Treesitter provider: only if treesitter is installed and loaded + do + local has_ts, _ = pcall(require, "nvim-treesitter.parsers") + if has_ts then + table.insert(providers, "treesitter") + end + end + + -- Regex as fallback (always safe) + table.insert(providers, "regex") + + -- Configure with guarded options + local success, err = pcall(function() + illuminate.configure({ + providers = providers, + delay = 100, + filetypes_denylist = { "dirbuf", "dirvish", "fugitive" }, + under_cursor = true, + min_count_to_highlight = 1, + }) + end) + if not success then + vim.notify("[illuminate] configuration failed: " .. tostring(err), vim.log.levels.WARN) + end + end, +} diff --git a/config/nvim-lazyvim/lua/plugins/kulala.lua b/config/nvim-lazyvim/lua/plugins/kulala.lua new file mode 100644 index 0000000..70f5481 --- /dev/null +++ b/config/nvim-lazyvim/lua/plugins/kulala.lua @@ -0,0 +1,22 @@ +-- Kulala HTTP client https://github.com/mistweaverco/kulala.nvim + +return { + { + "mistweaverco/kulala.nvim", + ft = { "http", "rest" }, -- Loads when you open .http or .rest files + version = "*", + opts = { + global_keymaps = true, -- Enable global key mappings for Kulala + global_keymaps_prefix = "R", -- Prefix for keymaps (e.g. Rs to send request) + kulala_keymaps_prefix = "", -- No extra prefix for kulala-specific keymaps + }, + config = function(_, opts) + require("kulala").setup(opts) + end, + keys = { + { "Rs", desc = "Send request (Kulala)" }, + { "Ra", desc = "Send all requests (Kulala)" }, + { "Rb", desc = "Open scratchpad (Kulala)" }, + }, + }, +} diff --git a/config/nvim-lazyvim/lua/plugins/telescope-project.lua b/config/nvim-lazyvim/lua/plugins/telescope-project.lua new file mode 100644 index 0000000..c4000ae --- /dev/null +++ b/config/nvim-lazyvim/lua/plugins/telescope-project.lua @@ -0,0 +1,159 @@ +-- Telescope Project https://github.com/nvim-telescope/telescope-project.nvim + +return { + 'nvim-telescope/telescope-project.nvim', + dependencies = { + 'nvim-telescope/telescope.nvim', + }, + event = "VeryLazy", -- Load after startup + config = function() + -- Load the extension + require('telescope').load_extension('project') + + -- Setup project configuration in telescope + require('telescope').setup({ + extensions = { + project = { + -- Dynamic base directories that work across OSes + base_dirs = (function() + local dirs = {} + local home = vim.fn.expand('~') + + -- Common project directories that might exist + local potential_dirs = { + 'projects', + 'dev', + 'work', + 'code', + 'src', + 'repos', + 'git', + 'Documents/projects', + 'Documents/dev', + 'Documents/code', + } + + -- Check which directories actually exist + for _, dir in ipairs(potential_dirs) do + local full_path = home .. '/' .. dir + if vim.fn.isdirectory(full_path) == 1 then + table.insert(dirs, {full_path, max_depth = 2}) + end + end + + -- Always include current working directory + table.insert(dirs, vim.fn.getcwd()) + + -- Add config directory (cross-platform) + local config_dir = vim.fn.stdpath('config') + if config_dir then + table.insert(dirs, vim.fn.fnamemodify(config_dir, ':h')) -- Parent of config dir + end + + return dirs + end)(), + hidden_files = false, -- Don't show hidden files by default + theme = "dropdown", -- Use dropdown theme for cleaner look + order_by = "recent", -- Order by most recently used + search_by = {"title", "path"}, -- Search by both title and path + sync_with_nvim_tree = false, -- Set to true if you use nvim-tree + ignore_missing_dirs = true, -- Don't error on missing directories + display_type = "full", -- Show full project information + + -- Enable showing manually added projects + -- This ensures both auto-discovered and manually added projects are shown + project_files = { + ".git", + ".project", + "package.json", + "Cargo.toml", + "pyproject.toml", + "requirements.txt", + ".nvim-project", + "go.mod" + }, + + -- Custom actions when project is selected + on_project_selected = function(prompt_bufnr) + -- Change to project directory and find files + local project_actions = require("telescope._extensions.project.actions") + project_actions.change_working_directory(prompt_bufnr, false) + -- Automatically open telescope file finder in the new project + vim.defer_fn(function() + require('telescope.builtin').find_files() + end, 100) + end, + + -- Custom mappings + mappings = { + n = { + ['d'] = require("telescope._extensions.project.actions").delete_project, + ['r'] = require("telescope._extensions.project.actions").rename_project, + ['c'] = require("telescope._extensions.project.actions").add_project, + ['C'] = require("telescope._extensions.project.actions").add_project_cwd, + ['f'] = require("telescope._extensions.project.actions").find_project_files, + ['b'] = require("telescope._extensions.project.actions").browse_project_files, + ['s'] = require("telescope._extensions.project.actions").search_in_project_files, + ['R'] = require("telescope._extensions.project.actions").recent_project_files, + ['w'] = require("telescope._extensions.project.actions").change_working_directory, + }, + i = { + [''] = require("telescope._extensions.project.actions").delete_project, + [''] = require("telescope._extensions.project.actions").rename_project, + [''] = require("telescope._extensions.project.actions").add_project, + [''] = require("telescope._extensions.project.actions").add_project_cwd, + [''] = require("telescope._extensions.project.actions").find_project_files, + [''] = require("telescope._extensions.project.actions").browse_project_files, + [''] = require("telescope._extensions.project.actions").search_in_project_files, + [''] = require("telescope._extensions.project.actions").recent_project_files, + [''] = require("telescope._extensions.project.actions").change_working_directory, + } + } + } + } + }) + + -- Set up keymaps + vim.keymap.set('n', 'fp', function() + require('telescope').extensions.project.project{} + end, { desc = 'Find Projects' }) + + vim.keymap.set('n', '', function() + require('telescope').extensions.project.project{} + end, { desc = 'Find Projects' }) + + -- Additional project-related keymaps + vim.keymap.set('n', 'fP', function() + require('telescope').extensions.project.project{ display_type = 'full' } + end, { desc = 'Find Projects (detailed)' }) + + -- Quick project creation + vim.keymap.set('n', 'pc', function() + local project_actions = require("telescope._extensions.project.actions") + project_actions.add_project_cwd() + print("Added project: " .. vim.fn.getcwd()) + end, { desc = 'Add current directory as project' }) + + -- Debug: Show all stored projects + vim.keymap.set('n', 'pd', function() + local data_path = vim.fn.stdpath("data") + local project_file = data_path .. "/telescope-project.json" + if vim.fn.filereadable(project_file) == 1 then + local projects = vim.fn.json_decode(vim.fn.readfile(project_file)) + print("Stored projects:") + for path, data in pairs(projects) do + print(" " .. path .. " (" .. (data.title or "no title") .. ")") + end + else + print("No project file found at: " .. project_file) + end + end, { desc = 'Debug: Show all stored projects' }) + + -- Force refresh projects + vim.keymap.set('n', 'pr', function() + -- Clear cache and reload extension + require('telescope').load_extension('project') + print("Project cache refreshed") + end, { desc = 'Refresh project list' }) + end, +} \ No newline at end of file diff --git a/config/nvim-lazyvim/lua/plugins/telescope.lua b/config/nvim-lazyvim/lua/plugins/telescope.lua index 5dfc456..ea85808 100644 --- a/config/nvim-lazyvim/lua/plugins/telescope.lua +++ b/config/nvim-lazyvim/lua/plugins/telescope.lua @@ -1,14 +1,50 @@ return { "nvim-telescope/telescope.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "BurntSushi/ripgrep" + }, keys = { -- add a keymap to browse plugin files -- stylua: ignore { - "fp", - function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, - desc = "Find Plugin File", + "fp", + function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, + desc = "Find Plugin File", + }, + { + '', + function() require("telescope.builtin").git_files() end, + desc = "Git Files" + }, + { + 'ps', + function() require("telescope.builtin").live_grep() end, + desc = "Live Grep" + }, + { + 'pws', + function() + local word = vim.fn.expand("") + require("telescope.builtin").grep_string({ search = word }) + end, + desc = "Grep Word" + }, + { + 'pWs', + function() + local word = vim.fn.expand("") + require("telescope.builtin").grep_string({ search = word }) + end, + desc = "Grep WORD" + }, + { + 'vh', + function() require("telescope.builtin").help_tags() end, + desc = "Help Tags" }, }, + -- change some options opts = { defaults = { diff --git a/config/nvim-lazyvim/lua/plugins/yanky.lua b/config/nvim-lazyvim/lua/plugins/yanky.lua new file mode 100644 index 0000000..6897432 --- /dev/null +++ b/config/nvim-lazyvim/lua/plugins/yanky.lua @@ -0,0 +1,43 @@ +-- Yanky https://github.com/gbprod/yanky.nvim + +return { + "gbprod/yanky.nvim", + -- "VeryLazy" or "BufReadPre" if you want it earlier + event = "VeryLazy", + dependencies = { "nvim-telescope/telescope.nvim" }, + opts = { + -- You can customize options here, or leave empty for sensible defaults + -- ring = { history_length = 100, storage = "shada" }, + -- picker = { select = { action = nil } }, + -- highlight = { on_put = true, on_yank = true, timer = 500 }, + -- preserve_cursor_position = { enabled = true }, + }, + config = function(_, opts) + require("yanky").setup(opts) + + -- Recommended keymaps (see below) + local map = vim.keymap.set + + -- Register the yank_history extension with Telescope + pcall(function() + require("telescope").load_extension("yank_history") + end) + + -- Cycle through yank history (pasting) + map({"n","x"}, "p", "(YankyPutAfter)", {desc = "Yanky Put After"}) + map({"n","x"}, "P", "(YankyPutBefore)", {desc = "Yanky Put Before"}) + map({"n","x"}, "gp", "(YankyGPutAfter)", {desc = "Yanky GPut After"}) + map({"n","x"}, "gP", "(YankyGPutBefore)", {desc = "Yanky GPut Before"}) + -- Cycle through history + map("n", "", "(YankyCycleForward)", {desc = "Yanky Cycle Forward"}) + map("n", "", "(YankyCycleBackward)", {desc = "Yanky Cycle Backward"}) + -- Telescope integration + map("n", "sy", function() + + -- Only require when the keymap is actually used + require("telescope").extensions.yank_history.yank_history({}) + end, {desc = "Yank History (Telescope)"}) + end, +} + + \ No newline at end of file