summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <david@luevano.xyz>2024-02-03 02:37:58 -0600
committerDavid Luevano Alvarado <david@luevano.xyz>2024-02-03 02:37:58 -0600
commit143e63831568a91a0a7e614dc1be8d9ac25c0750 (patch)
treeb4ac05f88cc588d991240f097d0dc2a31409fa64
parent2d8917bd24587b8c6aa8bdd8814fcc37a27773ee (diff)
refactor: move all git related plugins to git.lua
-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',