Skip to content

Commit

Permalink
git advanced search
Browse files Browse the repository at this point in the history
  • Loading branch information
BakerNet committed Jun 1, 2023
1 parent b7a0a4d commit 11e560f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
15 changes: 15 additions & 0 deletions after/plugin/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,25 @@ require('telescope').setup {
},
},
},
extensions = {
advanced_git_search = {
-- fugitive or diffview
diff_plugin = "fugitive",
-- customize git in previewer
-- e.g. flags such as { "--no-pager" }, or { "-c", "delta.side-by-side=false" }
git_flags = {},
-- customize git diff in previewer
-- e.g. flags such as { "--raw" }
git_diff_flags = {},
-- Show builtin git pickers when executing "show_custom_functions" or :AdvancedGitSearch
show_builtin_git_pickers = false,
}
}
}

-- Enable telescope fzf native, if installed
pcall(require('telescope').load_extension, 'fzf')
pcall(require('telescope').load_extension, 'advanced_git_search')

-- See `:help telescope.builtin`
vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' })
Expand Down
3 changes: 3 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
vim.cmd([[
:command! -nargs=1 Browse silent execute '!$BROWSER' shellescape(<q-args>,1)
]])
-- Set <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
Expand Down
13 changes: 13 additions & 0 deletions lua/hans/lazy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,19 @@ require('lazy').setup({
return vim.fn.executable 'make' == 1
end,
},
{
'aaronhallaert/advanced-git-search.nvim',
dependencies = {
"nvim-telescope/telescope.nvim",
-- to show diff splits and open commits in browser
"tpope/vim-fugitive",
-- to open commits in browser with fugitive
"tpope/vim-rhubarb",
-- OPTIONAL: to replace the diff from fugitive with diffview.nvim
-- (fugitive is still needed to open in browser)
-- "sindrets/diffview.nvim",
}
},

{
-- Highlight, edit, and navigate code
Expand Down

0 comments on commit 11e560f

Please sign in to comment.