vim/git: Use gitlinker

This commit is contained in:
Geoffrey Frogeye 2024-01-26 22:02:25 +01:00
parent 85cd61d206
commit 9c6a2f69f0
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8

View file

@ -2,26 +2,30 @@
{ {
config = { config = {
programs.nixvim = { programs.nixvim = {
extraConfigVim = '' keymaps = [
let g:fugitive_gitlab_domains = [${ {
lib.strings.concatStringsSep ", " ( mode = [ "n" ];
map (d: "'${d}'") config.frogeye.vim.fugitive.gitlab_domains key = "gG";
)}] action = ''<cmd>lua require"gitlinker".get_buf_range_url("n")<cr>'';
''; }
extraPlugins = with pkgs.vimPlugins; [ {
fugitive-gitlab-vim # Open files in GitLab mode = [ "v" ];
# TODO Investigate gitlinker instead key = "gG";
action = ''<cmd>lua require"gitlinker".get_buf_range_url("v")<cr>'';
}
]; ];
plugins = { plugins = {
fugitive.enable = true; # Git basics fugitive.enable = true; # Git basics
gitsigns.enable = true; # Show changed lines in the gutter gitsigns.enable = true; # Show changed lines in the gutter
gitlinker = {
enable = true; # Copy URL of forge corresponding to cursor
callbacks = {
"code.techinc.nl" = "get_gitea_type_url";
"git.frogeye.fr" = "get_gitea_type_url";
};
mappings = null; # This option doesn't work, hence manual mappings
};
}; };
}; };
}; };
options.frogeye.vim.fugitive = {
gitlab_domains = lib.mkOption {
default = { };
type = lib.types.listOf lib.types.str;
};
};
} }