mirror of
https://github.com/harivansh-afk/nvim.git
synced 2026-04-15 21:03:25 +00:00
fzf oil and ui
This commit is contained in:
parent
dd59a54b92
commit
f93bb4ffe8
6 changed files with 143 additions and 159 deletions
|
|
@ -1,26 +1,25 @@
|
||||||
{
|
{
|
||||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||||
"arrow.nvim": { "branch": "master", "commit": "6e0f726f55f99332dd726a53effd6813786b6d49" },
|
|
||||||
"dashboard-nvim": { "branch": "master", "commit": "0775e567b6c0be96d01a61795f7b64c1758262f6" },
|
"dashboard-nvim": { "branch": "master", "commit": "0775e567b6c0be96d01a61795f7b64c1758262f6" },
|
||||||
"diffs.nvim": { "branch": "main", "commit": "2c943c5b9496c816fd1fdcb1fa069b94ba8e9f27" },
|
"diffs.nvim": { "branch": "main", "commit": "4008df355829dffc0f8dd690c6fe61c520fa95fb" },
|
||||||
"flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
|
"flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "abf82a65f185bd54adc0679f74b7d6e1ada690c9" },
|
"fzf-lua": { "branch": "main", "commit": "36d60dd59cd9bc0442352119fc0e45e1c9011e03" },
|
||||||
"gruvbox-material": { "branch": "master", "commit": "790afe9dd085aa04eccd1da3626c5fa05c620e53" },
|
"gitsigns.nvim": { "branch": "main", "commit": "1ce96a464fdbc24208e24c117e2021794259005d" },
|
||||||
|
"gruvbox.nvim": { "branch": "main", "commit": "a472496e1a4465a2dd574389dcf6cdb29af9bf1b" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
"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" },
|
"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-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "3f58aeca0c6ece8a9fb8782ea3fcb6024f285be3" },
|
"nvim-lspconfig": { "branch": "master", "commit": "59cd07d8df2fefde32556268b8d52606a32152a1" },
|
||||||
"nvim-tree.lua": { "branch": "master", "commit": "037d89e60fb01a6c11a48a19540253b8c72a3c32" },
|
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
"nvim-treesitter-textobjects": { "branch": "main", "commit": "a0e182ae21fda68c59d1f36c9ed45600aef50311" },
|
"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" },
|
"oil.nvim": { "branch": "master", "commit": "f55b25e493a7df76371cfadd0ded5004cb9cd48a" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
"snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" },
|
"snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" },
|
||||||
"supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" },
|
"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-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
|
||||||
"vim-gutentags": { "branch": "master", "commit": "aa47c5e29c37c52176c44e61c780032dfacef3dd" },
|
"vim-gutentags": { "branch": "master", "commit": "aa47c5e29c37c52176c44e61c780032dfacef3dd" },
|
||||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||||
|
|
|
||||||
55
lua/plugins/fzf.lua
Normal file
55
lua/plugins/fzf.lua
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
return {
|
||||||
|
"ibhagwan/fzf-lua",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
cmd = "FzfLua",
|
||||||
|
keys = {
|
||||||
|
-- Main keybinds
|
||||||
|
{
|
||||||
|
"<C-f>",
|
||||||
|
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",
|
||||||
|
},
|
||||||
|
{ "<C-g>", function() require("fzf-lua").live_grep() end, desc = "Live grep" },
|
||||||
|
|
||||||
|
-- Leader keybinds
|
||||||
|
{ "<leader>ff", function() require("fzf-lua").files() end, desc = "Files" },
|
||||||
|
{ "<leader>fg", function() require("fzf-lua").live_grep() end, desc = "Live grep" },
|
||||||
|
{ "<leader>fb", function() require("fzf-lua").buffers() end, desc = "Buffers" },
|
||||||
|
{ "<leader>fh", function() require("fzf-lua").help_tags() end, desc = "Help tags" },
|
||||||
|
{ "<leader>fr", function() require("fzf-lua").resume() end, desc = "Resume last search" },
|
||||||
|
{ "<leader>fo", function() require("fzf-lua").oldfiles() end, desc = "Recent files" },
|
||||||
|
{ "<leader>fc", function() require("fzf-lua").commands() end, desc = "Commands" },
|
||||||
|
{ "<leader>fk", function() require("fzf-lua").keymaps() end, desc = "Keymaps" },
|
||||||
|
{ "<leader>f/", function() require("fzf-lua").search_history() end, desc = "Search history" },
|
||||||
|
{ "<leader>f:", function() require("fzf-lua").command_history() end, desc = "Command history" },
|
||||||
|
{ "<leader>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
|
||||||
|
{ "<leader>GB", function() require("fzf-lua").git_branches() end, desc = "Git branches" },
|
||||||
|
{ "<leader>Gc", function() require("fzf-lua").git_commits() end, desc = "Git commits" },
|
||||||
|
{ "<leader>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",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -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 = {
|
|
||||||
{ "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find files" },
|
|
||||||
{
|
|
||||||
"<leader>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",
|
|
||||||
},
|
|
||||||
{ "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Live grep" },
|
|
||||||
{ "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Buffers" },
|
|
||||||
{ "<leader>fh", "<cmd>Telescope help_tags<cr>", 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 = {
|
|
||||||
["<C-j>"] = "move_selection_next",
|
|
||||||
["<C-k>"] = "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 = {
|
|
||||||
{ "-", "<cmd>Oil<cr>", desc = "Open parent directory" },
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
default_file_explorer = true,
|
|
||||||
columns = {
|
|
||||||
"icon",
|
|
||||||
},
|
|
||||||
view_options = {
|
|
||||||
show_hidden = true,
|
|
||||||
},
|
|
||||||
keymaps = {
|
|
||||||
["g?"] = "actions.show_help",
|
|
||||||
["<CR>"] = "actions.select",
|
|
||||||
["<C-v>"] = "actions.select_vsplit",
|
|
||||||
["<C-s>"] = "actions.select_split",
|
|
||||||
["<C-t>"] = "actions.select_tab",
|
|
||||||
["<C-p>"] = "actions.preview",
|
|
||||||
["<C-c>"] = "actions.close",
|
|
||||||
["<C-r>"] = "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 = ";",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
25
lua/plugins/oil.lua
Normal file
25
lua/plugins/oil.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
return {
|
||||||
|
"stevearc/oil.nvim",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
lazy = false,
|
||||||
|
keys = {
|
||||||
|
{ "-", "<cmd>Oil<cr>", desc = "Open parent directory" },
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
default_file_explorer = true, -- nvim . opens oil
|
||||||
|
columns = { "icon" },
|
||||||
|
view_options = {
|
||||||
|
show_hidden = true,
|
||||||
|
},
|
||||||
|
keymaps = {
|
||||||
|
["g?"] = "actions.show_help",
|
||||||
|
["<CR>"] = "actions.select",
|
||||||
|
["<C-v>"] = "actions.select_vsplit",
|
||||||
|
["<C-x>"] = "actions.select_split",
|
||||||
|
["<C-p>"] = "actions.preview",
|
||||||
|
["<C-c>"] = "actions.close",
|
||||||
|
["-"] = "actions.parent",
|
||||||
|
["g."] = "actions.toggle_hidden",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
47
lua/plugins/tree.lua
Normal file
47
lua/plugins/tree.lua
Normal file
|
|
@ -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 = {
|
||||||
|
{ "<C-e>", "<cmd>Neotree toggle<cr>", desc = "Toggle file explorer" },
|
||||||
|
{ "<leader>e", "<cmd>Neotree toggle<cr>", desc = "Toggle file explorer" },
|
||||||
|
{ "<BS>", "<cmd>Neotree toggle<cr>", desc = "Toggle file explorer" },
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("neo-tree").setup({
|
||||||
|
close_if_last_window = true,
|
||||||
|
window = {
|
||||||
|
width = 30,
|
||||||
|
mappings = {
|
||||||
|
["<space>"] = "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,
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
return {
|
return {
|
||||||
-- Gruvbox Material colorscheme
|
-- Gruvbox Material colorscheme
|
||||||
{
|
{
|
||||||
"sainnhe/gruvbox-material",
|
"ellisonleao/gruvbox.nvim",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
|
|
@ -12,7 +12,7 @@ return {
|
||||||
vim.g.gruvbox_material_better_performance = true
|
vim.g.gruvbox_material_better_performance = true
|
||||||
vim.g.gruvbox_material_diagnostic_text_highlight = true
|
vim.g.gruvbox_material_diagnostic_text_highlight = true
|
||||||
vim.g.gruvbox_material_diagnostic_virtual_text = "colored"
|
vim.g.gruvbox_material_diagnostic_virtual_text = "colored"
|
||||||
vim.cmd.colorscheme("gruvbox-material")
|
vim.cmd.colorscheme("gruvbox")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -58,31 +58,31 @@ return {
|
||||||
icon = " ",
|
icon = " ",
|
||||||
desc = "Find File ",
|
desc = "Find File ",
|
||||||
key = "f",
|
key = "f",
|
||||||
action = "Telescope find_files",
|
action = function() require("fzf-lua").files() end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = " ",
|
icon = " ",
|
||||||
desc = "Recent Files ",
|
desc = "Recent Files ",
|
||||||
key = "r",
|
key = "r",
|
||||||
action = "Telescope oldfiles",
|
action = function() require("fzf-lua").oldfiles() end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = " ",
|
icon = " ",
|
||||||
desc = "Find Text ",
|
desc = "Find Text ",
|
||||||
key = "g",
|
key = "g",
|
||||||
action = "Telescope live_grep",
|
action = function() require("fzf-lua").live_grep() end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = " ",
|
icon = " ",
|
||||||
desc = "File Explorer ",
|
desc = "File Explorer ",
|
||||||
key = "e",
|
key = "e",
|
||||||
action = "Oil",
|
action = function() vim.cmd("Neotree toggle") end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = " ",
|
icon = " ",
|
||||||
desc = "Quit ",
|
desc = "Quit ",
|
||||||
key = "q",
|
key = "q",
|
||||||
action = "quit",
|
action = function() vim.cmd("quit") end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
footer = {},
|
footer = {},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue