-
-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(neogit): enable neogit integrations if they are available (#456)
- Loading branch information
Showing
3 changed files
with
41 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
return { | ||
"sindrets/diffview.nvim", | ||
event = "User AstroGitFile", | ||
cmd = { "DiffviewOpen" }, | ||
{ | ||
"sindrets/diffview.nvim", | ||
event = "User AstroGitFile", | ||
cmd = { "DiffviewOpen" }, | ||
}, | ||
{ | ||
"NeogitOrg/neogit", | ||
optional = true, | ||
opts = { integrations = { diffview = true } }, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,38 @@ | ||
local utils = require "astronvim.utils" | ||
local prefix = "<leader>g" | ||
local maps = { n = {} } | ||
local icon = vim.g.icons_enabled and " " or "" | ||
maps.n[prefix] = { desc = icon .. "Neogit" } | ||
require("astronvim.utils").set_mappings(maps) | ||
utils.set_mappings { n = { [prefix] = { desc = icon .. "Neogit" } } } | ||
|
||
local fold_signs = { utils.get_icon "FoldClosed", utils.get_icon "FoldOpened" } | ||
return { | ||
{ | ||
"NeogitOrg/neogit", | ||
dependencies = { | ||
{ "nvim-lua/plenary.nvim" }, | ||
}, | ||
event = "User AstroGitFile", | ||
opts = {}, | ||
opts = function(_, opts) | ||
return utils.extend_tbl(opts, { | ||
disable_builtin_notifications = utils.is_available "nvim-notify", | ||
telescope_sorter = function() | ||
if utils.is_available "telescope-fzf-native.nvim" then | ||
return require("telescope").extensions.fzf.native_fzf_sorter() | ||
end | ||
end, | ||
integrations = { telescope = utils.is_available "telescope.nvim" }, | ||
signs = { section = fold_signs, item = fold_signs }, | ||
}) | ||
end, | ||
keys = { | ||
{ prefix .. "nt", "<cmd>Neogit<CR>", desc = "Open Neogit Tab Page" }, | ||
{ prefix .. "nc", "<cmd>Neogit commit<CR>", desc = "Open Neogit Commit Page" }, | ||
{ prefix .. "nd", ":Neogit cwd=", desc = "Open Neogit Override CWD" }, | ||
{ prefix .. "nk", ":Neogit kind=", desc = "Open Neogit Override Kind" }, | ||
}, | ||
}, | ||
{ | ||
"catppuccin/nvim", | ||
optional = true, | ||
opts = { integrations = { neogit = true } }, | ||
}, | ||
} |
13 changes: 10 additions & 3 deletions
13
lua/astrocommunity/utility/telescope-fzy-native-nvim/init.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
return { | ||
"nvim-telescope/telescope.nvim", | ||
dependencies = { "nvim-telescope/telescope-fzy-native.nvim" }, | ||
opts = function() require("telescope").load_extension "fzy_native" end, | ||
{ | ||
"nvim-telescope/telescope.nvim", | ||
dependencies = { "nvim-telescope/telescope-fzy-native.nvim" }, | ||
opts = function() require("telescope").load_extension "fzy_native" end, | ||
}, | ||
{ | ||
"NeogitOrg/neogit", | ||
optional = true, | ||
opts = { telescope_sorter = function() return require("telescope").extensions.fzy_native.native_fzy_sorter() end }, | ||
}, | ||
} |