neovim: lazy-load some plugins

Also rebind mappings for GitSigns
This commit is contained in:
FollieHiyuki 2021-07-09 01:26:52 +03:00
parent e1b2a23507
commit d1be74ee0b
No known key found for this signature in database
GPG Key ID: 813CF484F4993419
3 changed files with 9 additions and 7 deletions

View File

@ -94,9 +94,9 @@ wk.register({
g = {
name = 'Git',
b = 'Blame current line',
i = 'Preview hunk',
n = 'Next hunk',
p = 'Previous hunk',
j = 'Next hunk',
k = 'Previous hunk',
p = 'Preview hunk',
r = 'Reset hunk',
R = 'Reset all hunks in buffer',
s = 'Stage hunk',

View File

@ -12,8 +12,8 @@ return require('gitsigns').setup {
noremap = true,
buffer = true,
['n <leader>gn'] = {expr = true, '&diff ? \'<leader>gn\' : \'<cmd>lua require"gitsigns.actions".next_hunk()<CR>\''},
['n <leader>gp'] = {expr = true, '&diff ? \'<leader>gp\' : \'<cmd>lua require"gitsigns.actions".prev_hunk()<CR>\''},
['n <leader>gj'] = {expr = true, '&diff ? \'<leader>gj\' : \'<cmd>lua require"gitsigns.actions".next_hunk()<CR>\''},
['n <leader>gk'] = {expr = true, '&diff ? \'<leader>gk\' : \'<cmd>lua require"gitsigns.actions".prev_hunk()<CR>\''},
['n <leader>gs'] = '<cmd>lua require"gitsigns".stage_hunk()<CR>',
['v <leader>gs'] = '<cmd>lua require"gitsigns".stage_hunk({vim.fn.line("."), vim.fn.line("v")})<CR>',
@ -21,7 +21,7 @@ return require('gitsigns').setup {
['n <leader>gr'] = '<cmd>lua require"gitsigns".reset_hunk()<CR>',
['v <leader>gr'] = '<cmd>lua require"gitsigns".reset_hunk({vim.fn.line("."), vim.fn.line("v")})<CR>',
['n <leader>gR'] = '<cmd>lua require"gitsigns".reset_buffer()<CR>',
['n <leader>gi'] = '<cmd>lua require"gitsigns".preview_hunk()<CR>',
['n <leader>gp'] = '<cmd>lua require"gitsigns".preview_hunk()<CR>',
['n <leader>gb'] = '<cmd>lua require"gitsigns".blame_line(true)<CR>'
},
watch_index = {

View File

@ -60,6 +60,7 @@ return packer.startup(
use {
'lewis6991/gitsigns.nvim',
requires = 'nvim-lua/plenary.nvim',
event = {'BufRead', 'BufNewFile'},
config = function()
require('modules.gitgutter')
end
@ -76,6 +77,7 @@ return packer.startup(
}
use {
'lukas-reineke/indent-blankline.nvim',
event = 'BufRead',
config = function()
require('modules.blankline')
end
@ -112,7 +114,7 @@ return packer.startup(
-- Editing
use {
'terrortylor/nvim-comment',
cmd = 'CommentToggle',
after = 'nvim-treesitter',
config = function()
require('nvim_comment').setup()
end