diff --git a/lazy-lock.json b/lazy-lock.json index d608e6d..390e76d 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,26 +1,25 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "arrow.nvim": { "branch": "master", "commit": "6e0f726f55f99332dd726a53effd6813786b6d49" }, "dashboard-nvim": { "branch": "master", "commit": "0775e567b6c0be96d01a61795f7b64c1758262f6" }, - "diffs.nvim": { "branch": "main", "commit": "2c943c5b9496c816fd1fdcb1fa069b94ba8e9f27" }, + "diffs.nvim": { "branch": "main", "commit": "4008df355829dffc0f8dd690c6fe61c520fa95fb" }, "flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" }, - "gitsigns.nvim": { "branch": "main", "commit": "abf82a65f185bd54adc0679f74b7d6e1ada690c9" }, - "gruvbox-material": { "branch": "master", "commit": "790afe9dd085aa04eccd1da3626c5fa05c620e53" }, + "fzf-lua": { "branch": "main", "commit": "36d60dd59cd9bc0442352119fc0e45e1c9011e03" }, + "gitsigns.nvim": { "branch": "main", "commit": "1ce96a464fdbc24208e24c117e2021794259005d" }, + "gruvbox.nvim": { "branch": "main", "commit": "a472496e1a4465a2dd574389dcf6cdb29af9bf1b" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "c953789db7fd28eafe5eb5659846d34b5024b3cc" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "ae609525ddf01c153c39305730b1791800ffe4fe" }, "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, - "nvim-lspconfig": { "branch": "master", "commit": "3f58aeca0c6ece8a9fb8782ea3fcb6024f285be3" }, - "nvim-tree.lua": { "branch": "master", "commit": "037d89e60fb01a6c11a48a19540253b8c72a3c32" }, + "nvim-lspconfig": { "branch": "master", "commit": "59cd07d8df2fefde32556268b8d52606a32152a1" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-treesitter-textobjects": { "branch": "main", "commit": "a0e182ae21fda68c59d1f36c9ed45600aef50311" }, - "nvim-web-devicons": { "branch": "master", "commit": "803353450c374192393f5387b6a0176d0972b848" }, + "nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" }, "oil.nvim": { "branch": "master", "commit": "f55b25e493a7df76371cfadd0ded5004cb9cd48a" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }, "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, - "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, "vim-gutentags": { "branch": "master", "commit": "aa47c5e29c37c52176c44e61c780032dfacef3dd" }, "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } diff --git a/lua/plugins/fzf.lua b/lua/plugins/fzf.lua new file mode 100644 index 0000000..eb00fb1 --- /dev/null +++ b/lua/plugins/fzf.lua @@ -0,0 +1,55 @@ +return { + "ibhagwan/fzf-lua", + dependencies = { "nvim-tree/nvim-web-devicons" }, + cmd = "FzfLua", + keys = { + -- Main keybinds + { + "", + function() + local fzf = require("fzf-lua") + local git_dir = vim.fn.system("git rev-parse --git-dir 2>/dev/null"):gsub("\n", "") + if vim.v.shell_error == 0 and git_dir ~= "" then + fzf.git_files() + else + fzf.files() + end + end, + desc = "Find files", + }, + { "", function() require("fzf-lua").live_grep() end, desc = "Live grep" }, + + -- Leader keybinds + { "ff", function() require("fzf-lua").files() end, desc = "Files" }, + { "fg", function() require("fzf-lua").live_grep() end, desc = "Live grep" }, + { "fb", function() require("fzf-lua").buffers() end, desc = "Buffers" }, + { "fh", function() require("fzf-lua").help_tags() end, desc = "Help tags" }, + { "fr", function() require("fzf-lua").resume() end, desc = "Resume last search" }, + { "fo", function() require("fzf-lua").oldfiles() end, desc = "Recent files" }, + { "fc", function() require("fzf-lua").commands() end, desc = "Commands" }, + { "fk", function() require("fzf-lua").keymaps() end, desc = "Keymaps" }, + { "f/", function() require("fzf-lua").search_history() end, desc = "Search history" }, + { "f:", function() require("fzf-lua").command_history() end, desc = "Command history" }, + { "fe", function() require("fzf-lua").files({ cwd = "~/.config" }) end, desc = "Config files" }, + -- Quickfix/loclist + { "gq", function() require("fzf-lua").quickfix() end, desc = "Quickfix" }, + { "gl", function() require("fzf-lua").loclist() end, desc = "Loclist" }, + -- Git + { "GB", function() require("fzf-lua").git_branches() end, desc = "Git branches" }, + { "Gc", function() require("fzf-lua").git_commits() end, desc = "Git commits" }, + { "Gs", function() require("fzf-lua").git_status() end, desc = "Git status" }, + }, + opts = { + "default-title", + winopts = { + border = "single", + preview = { + layout = "vertical", + vertical = "down:50%", + }, + }, + fzf_opts = { + ["--layout"] = "reverse", + }, + }, +} diff --git a/lua/plugins/navigation.lua b/lua/plugins/navigation.lua deleted file mode 100644 index 24b98ee..0000000 --- a/lua/plugins/navigation.lua +++ /dev/null @@ -1,142 +0,0 @@ -return { - -- Telescope fuzzy finder - { - "nvim-telescope/telescope.nvim", - tag = "0.1.5", - dependencies = { - "nvim-lua/plenary.nvim", - { - "nvim-telescope/telescope-fzf-native.nvim", - build = "make", - }, - }, - cmd = "Telescope", - keys = { - { "ff", "Telescope find_files", desc = "Find files" }, - { - "fs", - function() - require("telescope.builtin").find_files({ - find_command = { - "fd", - "--type", "f", - "--max-depth", "3", - "--strip-cwd-prefix", - "--hidden", - "--exclude", ".git", - "--exclude", "node_modules", - "--exclude", ".next", - }, - }) - end, - desc = "Shallow find files", - }, - { "fg", "Telescope live_grep", desc = "Live grep" }, - { "fb", "Telescope buffers", desc = "Buffers" }, - { "fh", "Telescope help_tags", desc = "Help tags" }, - }, - config = function() - local telescope = require("telescope") - telescope.setup({ - defaults = { - file_ignore_patterns = { - "node_modules", - ".next", - ".git", - "dist", - "build", - "%.lock", - }, - vimgrep_arguments = { - "rg", - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - "--hidden", - "--glob=!.git/", - "--glob=!node_modules/", - "--glob=!.next/", - }, - mappings = { - i = { - [""] = "move_selection_next", - [""] = "move_selection_previous", - }, - }, - }, - pickers = { - find_files = { - hidden = true, - find_command = { - "fd", - "--type", "f", - "--strip-cwd-prefix", - "--hidden", - "--exclude", ".git", - "--exclude", "node_modules", - "--exclude", ".next", - }, - }, - }, - extensions = { - fzf = { - fuzzy = true, - override_generic_sorter = true, - override_file_sorter = true, - case_mode = "smart_case", - }, - }, - }) - telescope.load_extension("fzf") - end, - }, - - -- Oil file explorer - { - "stevearc/oil.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - lazy = false, - keys = { - { "-", "Oil", desc = "Open parent directory" }, - }, - opts = { - default_file_explorer = true, - columns = { - "icon", - }, - view_options = { - show_hidden = true, - }, - keymaps = { - ["g?"] = "actions.show_help", - [""] = "actions.select", - [""] = "actions.select_vsplit", - [""] = "actions.select_split", - [""] = "actions.select_tab", - [""] = "actions.preview", - [""] = "actions.close", - [""] = "actions.refresh", - ["-"] = "actions.parent", - ["_"] = "actions.open_cwd", - ["`"] = "actions.cd", - ["~"] = "actions.tcd", - ["gs"] = "actions.change_sort", - ["gx"] = "actions.open_external", - ["g."] = "actions.toggle_hidden", - }, - }, - }, - - -- Arrow for quick file bookmarks - { - "otavioschwanck/arrow.nvim", - event = "VeryLazy", - opts = { - show_icons = true, - leader_key = ";", - }, - }, -} diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua new file mode 100644 index 0000000..a6747c9 --- /dev/null +++ b/lua/plugins/oil.lua @@ -0,0 +1,25 @@ +return { + "stevearc/oil.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + lazy = false, + keys = { + { "-", "Oil", desc = "Open parent directory" }, + }, + opts = { + default_file_explorer = true, -- nvim . opens oil + columns = { "icon" }, + view_options = { + show_hidden = true, + }, + keymaps = { + ["g?"] = "actions.show_help", + [""] = "actions.select", + [""] = "actions.select_vsplit", + [""] = "actions.select_split", + [""] = "actions.preview", + [""] = "actions.close", + ["-"] = "actions.parent", + ["g."] = "actions.toggle_hidden", + }, + }, +} diff --git a/lua/plugins/tree.lua b/lua/plugins/tree.lua new file mode 100644 index 0000000..6c74080 --- /dev/null +++ b/lua/plugins/tree.lua @@ -0,0 +1,47 @@ +return { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + cmd = "Neotree", + keys = { + { "", "Neotree toggle", desc = "Toggle file explorer" }, + { "e", "Neotree toggle", desc = "Toggle file explorer" }, + { "", "Neotree toggle", desc = "Toggle file explorer" }, + }, + config = function() + require("neo-tree").setup({ + close_if_last_window = true, + window = { + width = 30, + mappings = { + [""] = "none", + }, + }, + -- Source selector at top (just Files, no Git tab) + source_selector = { + winbar = true, + content_layout = "center", + tabs_layout = "equal", + sources = { + { source = "filesystem", display_name = " Files" }, + }, + }, + filesystem = { + follow_current_file = { + enabled = true, + leave_dirs_open = false, + }, + filtered_items = { + visible = true, + hide_dotfiles = false, + hide_gitignored = false, + hide_hidden = false, + }, + }, + }) + end, +} diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 297ae84..66486b1 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -1,7 +1,7 @@ return { -- Gruvbox Material colorscheme { - "sainnhe/gruvbox-material", + "ellisonleao/gruvbox.nvim", lazy = false, priority = 1000, config = function() @@ -12,7 +12,7 @@ return { vim.g.gruvbox_material_better_performance = true vim.g.gruvbox_material_diagnostic_text_highlight = true vim.g.gruvbox_material_diagnostic_virtual_text = "colored" - vim.cmd.colorscheme("gruvbox-material") + vim.cmd.colorscheme("gruvbox") end, }, @@ -58,31 +58,31 @@ return { icon = " ", desc = "Find File ", key = "f", - action = "Telescope find_files", + action = function() require("fzf-lua").files() end, }, { icon = " ", desc = "Recent Files ", key = "r", - action = "Telescope oldfiles", + action = function() require("fzf-lua").oldfiles() end, }, { icon = " ", desc = "Find Text ", key = "g", - action = "Telescope live_grep", + action = function() require("fzf-lua").live_grep() end, }, { icon = " ", desc = "File Explorer ", key = "e", - action = "Oil", + action = function() vim.cmd("Neotree toggle") end, }, { icon = " ", desc = "Quit ", key = "q", - action = "quit", + action = function() vim.cmd("quit") end, }, }, footer = {},