summaryrefslogtreecommitdiff
path: root/lua/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'lua/plugins')
-rw-r--r--lua/plugins/git.lua56
-rw-r--r--lua/plugins/init.lua3
2 files changed, 30 insertions, 29 deletions
diff --git a/lua/plugins/git.lua b/lua/plugins/git.lua
index a40a3dc..b579647 100644
--- a/lua/plugins/git.lua
+++ b/lua/plugins/git.lua
@@ -1,31 +1,35 @@
return {
- 'lewis6991/gitsigns.nvim',
- opts = {
- signs = {
- add = { text = '+' },
- change = { text = '~' },
- delete = { text = '_' },
- topdelete = { text = '‾' },
- changedelete = { text = '~' },
- },
- 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`
- on_attach = function(bufnr)
- local gs = require('gitsigns')
+ 'tpope/vim-fugitive',
+ 'tpope/vim-rhubarb',
+ {
+ 'lewis6991/gitsigns.nvim',
+ opts = {
+ signs = {
+ add = { text = '+' },
+ change = { text = '~' },
+ delete = { text = '_' },
+ topdelete = { text = '‾' },
+ changedelete = { text = '~' },
+ },
+ 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`
+ on_attach = function(bufnr)
+ local gs = require('gitsigns')
- -- TODO: use this function for most of the keymaps across plugins?
- local function map(mode, l, r, opts)
- opts = opts or {}
- opts.buffer = bufnr
- vim.keymap.set(mode, l, r, opts)
- end
+ -- TODO: use this function for most of the keymaps across plugins?
+ local function map(mode, l, r, opts)
+ opts = opts or {}
+ opts.buffer = bufnr
+ vim.keymap.set(mode, l, r, opts)
+ end
- map('n', '<leader>gp', gs.prev_hunk, { desc = '[g]it: [p]revious hunk' })
- map('n', '<leader>gn', gs.next_hunk, { desc = '[g]it: [n]ext hunk' })
- map('n', '<leader>gv', gs.preview_hunk, { desc = '[g]it: [v]iew hunk' })
- map('n', '<leader>gb', gs.toggle_current_line_blame, { desc = '[g]it: [b]lame toggle' })
- end,
+ map('n', '<leader>gp', gs.prev_hunk, { desc = '[g]it: [p]revious hunk' })
+ map('n', '<leader>gn', gs.next_hunk, { desc = '[g]it: [n]ext hunk' })
+ map('n', '<leader>gv', gs.preview_hunk, { desc = '[g]it: [v]iew hunk' })
+ map('n', '<leader>gb', gs.toggle_current_line_blame, { desc = '[g]it: [b]lame toggle' })
+ end,
+ },
},
}
diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua
index 59d822a..28ed11b 100644
--- a/lua/plugins/init.lua
+++ b/lua/plugins/init.lua
@@ -1,7 +1,4 @@
return {
- -- Git related plugins
- 'tpope/vim-fugitive',
- 'tpope/vim-rhubarb',
-- Detect tabstop and shiftwidth automatically,
-- uses .editorconfig https://editorconfig.org/
'tpope/vim-sleuth',