some working stuff

This commit is contained in:
Noah Masur 2022-11-27 13:08:33 -07:00
parent cf62184744
commit dc00ef26b5
4 changed files with 108 additions and 1 deletions

View File

@ -187,7 +187,55 @@
inputs.nix2vim.overlay
];
};
in pkgs.neovimBuilder { package = pkgs.neovim-unwrapped; };
in pkgs.neovimBuilder {
package = pkgs.neovim-unwrapped;
imports = [
./modules/neovim/plugins/gitsigns.nix
./modules/neovim/plugins/misc.nix
# ({ pkgs, dsl, ... }:
# # with dsl;
# {
# plugins = [ pkgs.vimPlugins.gitsigns-nvim ];
# setup.gitsigns = { };
# lua = ''
# vim.keymap.set("", "<Space>", "<Nop>", { silent = true })
# vim.g.mapleader = " "
# vim.g.maplocalleader = " "
# local gitsigns = require("gitsigns")
# vim.keymap.set("n", "<Leader>gB", gitsigns.blame_line)
# vim.keymap.set("n", "<Leader>gp", gitsigns.preview_hunk)
# vim.keymap.set("v", "<Leader>gp", gitsigns.preview_hunk)
# vim.keymap.set("n", "<Leader>gd", gitsigns.diffthis)
# vim.keymap.set("v", "<Leader>gd", gitsigns.diffthis)
# vim.keymap.set("n", "<Leader>rgf", gitsigns.reset_buffer)
# vim.keymap.set("v", "<Leader>hs", gitsigns.stage_hunk)
# vim.keymap.set("v", "<Leader>hr", gitsigns.reset_hunk)
# vim.keymap.set("v", "<Leader>hr", gitsigns.reset_hunk)
#
# -- Navigation
# vim.keymap.set("n", "]g", function()
# if vim.wo.diff then
# return "]g"
# end
# vim.schedule(function()
# gitsigns.next_hunk()
# end)
# return "<Ignore>"
# end, { expr = true })
#
# vim.keymap.set("n", "[g", function()
# if vim.wo.diff then
# return "[g"
# end
# vim.schedule(function()
# gitsigns.prev_hunk()
# end)
# return "<Ignore>"
# end, { expr = true })
# '';
# })
];
};
});

View File

@ -0,0 +1,35 @@
vim.keymap.set("", "<Space>", "<Nop>", { silent = true })
vim.g.mapleader = " "
vim.g.maplocalleader = " "
local gitsigns = require("gitsigns")
vim.keymap.set("n", "<Leader>gB", gitsigns.blame_line)
vim.keymap.set("n", "<Leader>gp", gitsigns.preview_hunk)
vim.keymap.set("v", "<Leader>gp", gitsigns.preview_hunk)
vim.keymap.set("n", "<Leader>gd", gitsigns.diffthis)
vim.keymap.set("v", "<Leader>gd", gitsigns.diffthis)
vim.keymap.set("n", "<Leader>rgf", gitsigns.reset_buffer)
vim.keymap.set("v", "<Leader>hs", gitsigns.stage_hunk)
vim.keymap.set("v", "<Leader>hr", gitsigns.reset_hunk)
vim.keymap.set("v", "<Leader>hr", gitsigns.reset_hunk)
-- Navigation
vim.keymap.set("n", "]g", function()
if vim.wo.diff then
return "]g"
end
vim.schedule(function()
gitsigns.next_hunk()
end)
return "<Ignore>"
end, { expr = true })
vim.keymap.set("n", "[g", function()
if vim.wo.diff then
return "[g"
end
vim.schedule(function()
gitsigns.prev_hunk()
end)
return "<Ignore>"
end, { expr = true })

View File

@ -0,0 +1,7 @@
{ pkgs, dsl, ... }:
# with dsl;
{
plugins = [ pkgs.vimPlugins.gitsigns-nvim ];
setup.gitsigns = { };
lua = builtins.readFile ./gitsigns.lua;
}

View File

@ -0,0 +1,17 @@
{ pkgs, dsl, ... }:
# with dsl;
{
plugins = [
pkgs.vimPlugins.vim-surround
pkgs.vimPlugins.vim-eunuch
pkgs.vimPlugins.vim-vinegar
pkgs.vimPlugins.vim-fugitive
pkgs.vimPlugins.vim-repeat
pkgs.vimPlugins.comment-nvim
];
setup.Comment = { };
lua = ''
${builtins.readFile ../lua/keybinds.lua};
${builtins.readFile ../lua/settings.lua};
'';
}