Skip to content

Commit

Permalink
add gitsigns
Browse files Browse the repository at this point in the history
  • Loading branch information
viperML committed Aug 9, 2024
1 parent a58d5ef commit 2c7b054
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
20 changes: 20 additions & 0 deletions modules/wrapper-manager/neovim/generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,26 @@
},
"version": "v7.0.0"
},
"gitsigns-nvim": {
"cargoLocks": null,
"date": null,
"extract": null,
"name": "gitsigns-nvim",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "lewis6991",
"repo": "gitsigns.nvim",
"rev": "v0.9.0",
"sha256": "sha256-AbnjBqKLhOGMGBXBnu9zbL3PG7rKmAoYtxY17kzFEIA=",
"type": "github"
},
"version": "v0.9.0"
},
"guess-indent-nvim": {
"cargoLocks": null,
"date": "2024-07-06",
Expand Down
11 changes: 11 additions & 0 deletions modules/wrapper-manager/neovim/generated.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@
sha256 = "sha256-0gBvpqsBn7KlpIPANPa3nf2TC7EBm4s47V+TFbr7RVU=";
};
};
gitsigns-nvim = {
pname = "gitsigns-nvim";
version = "v0.9.0";
src = fetchFromGitHub {
owner = "lewis6991";
repo = "gitsigns.nvim";
rev = "v0.9.0";
fetchSubmodules = false;
sha256 = "sha256-AbnjBqKLhOGMGBXBnu9zbL3PG7rKmAoYtxY17kzFEIA=";
};
};
guess-indent-nvim = {
pname = "guess-indent-nvim";
version = "6cd61f7a600bb756e558627cd2e740302c58e32d";
Expand Down
4 changes: 4 additions & 0 deletions modules/wrapper-manager/neovim/nvfetcher.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,7 @@ src.git = "https://github.com/coffebar/neovim-project"
[cmp-async-path]
fetch.git = "https://codeberg.org/FelipeLema/cmp-async-path"
src.git = "https://codeberg.org/FelipeLema/cmp-async-path"

[gitsigns-nvim]
fetch.github = "lewis6991/gitsigns.nvim"
src.github = "lewis6991/gitsigns.nvim"
Original file line number Diff line number Diff line change
Expand Up @@ -431,3 +431,12 @@ vim.keymap.set("n", "<leader>p", "<cmd>Telescope neovim-project discover<cr>", {
vim.filetype.add({
filename = { ['.envrc'] = 'bash' },
})

local gitsigns = require('gitsigns')
gitsigns.setup()

vim.keymap.set("n", "<leader>ga", gitsigns.stage_hunk, { desc = "Git: stage hunk" })
vim.keymap.set("n", "<leader>gp", gitsigns.preview_hunk, { desc = "Git: preview hunk" })
vim.keymap.set("n", "<leader>gb", function()
gitsigns.blame_line({full=true})
end, { desc = "Git: blame line" })

0 comments on commit 2c7b054

Please sign in to comment.