/
git.toml
108 lines (100 loc) · 3.58 KB
/
git.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Git plugins
[[plugins]] # vim-gitbranch
repo = 'itchyny/vim-gitbranch'
[[plugins]] # gitsigns.nvim
repo = 'lewis6991/gitsigns.nvim'
on_source = 'nightfox.nvim'
lua_source = '''
-- <% ./dein_toml/gitsigns.lua
local gitsigns = require("gitsigns")
gitsigns.setup({
signs = {
add = { hl = "GitSignsAdd", text = "+", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
change = { hl = "GitSignsChange", text = "│", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
delete = { hl = "GitSignsDelete", text = "_", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
topdelete = { hl = "GitSignsDelete", text = "‾", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
changedelete = { hl = "GitSignsChange", text = "~", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
untracked = { hl = "GitSignsAdd", text = "┆", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
},
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = true, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
watch_gitdir = {
interval = 1000,
follow_files = true,
},
attach_to_untracked = true,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = "right_align", -- 'eol' | 'overlay' | 'right_align'
delay = 1000,
ignore_whitespace = false,
},
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default
max_file_length = 40000, -- Disable if file is longer than this (in lines)
preview_config = {
-- Options passed to nvim_open_win
border = "single",
style = "minimal",
relative = "cursor",
row = 0,
col = 1,
},
yadm = {
enable = false,
},
on_attach = function(bufnr)
local keymap = vim.keymap.set
local keymap_options = { noremap = true, buffer = bufnr, expr = true }
-- Navigation
keymap("n", "[c", function()
if vim.wo.diff then
return "[c"
end
vim.schedule(function()
gitsigns.prev_hunk()
end)
return "<Ignore>"
end, keymap_options)
keymap("n", "]c", function()
if vim.wo.diff then
return "]c"
end
vim.schedule(function()
gitsigns.next_hunk()
end)
return "<Ignore>"
end, keymap_options)
keymap("n", "<git>hs", "<Cmd>Gitsigns stage_hunk<CR>")
keymap("n", "<git>hr", "<Cmd>Gitsigns reset_hunk<CR>")
end,
})
-- %>
'''
[[plugins]] # gina.vim
repo = 'lambdalisue/gina.vim'
on_cmd = 'Gina'
hook_add = '''
nnoremap <git>s <Cmd>Gina status<CR>
nnoremap <git>c <Cmd>Gina commit<CR>
nnoremap <git>l <Cmd>Gina log<CR>
nnoremap <git>b <Cmd>Gina blame<CR>
nnoremap <git>d <Cmd>Gina patch<CR>
nnoremap <git>ps <Cmd>Deol git push -split=floating -winheight=30 -winwidth=120 -toggle<CR>
nnoremap <git>pl <Cmd>Deol git pull -split=floating -winheight=30 -winwidth=120 -toggle<CR>
'''
hook_source = '''
call gina#custom#command#option('status', '-s')
call gina#custom#command#option('status', '--opener', 'split')
call gina#custom#command#option('commit', '-v')
call gina#custom#command#option('log', '--opener', 'vsplit')
call gina#custom#command#option('log', '--graph')
call gina#custom#command#option('log', '--all')
call gina#custom#command#option('blame', '--opener', 'tabedit')
call gina#custom#command#option('patch', '--oneside')
'''