diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 86598b8d..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - - - -## Before Reporting an Issue -- I have read the kickstart.nvim README.md. -- I have read the appropriate plugin's documentation. -- I have searched that this issue has not been reported before. - -- [ ] **By checking this, I confirm that the above steps are completed. I understand leaving this unchecked will result in this report being closed immediately.** - -## Describe the bug - - -## To Reproduce - -1. ... - -## Desktop - -- OS: -- Terminal: - -## Neovim Version - - -``` -``` diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 120000 index 00000000..5be11b23 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1 @@ +/nix/store/sxkaavdlrf0762h3k07j2jm9b7d3656n-home-manager-files/.config/git/templates/.github/ISSUE_TEMPLATE/bug_report.md \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 120000 index 00000000..65302d00 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +/nix/store/sxkaavdlrf0762h3k07j2jm9b7d3656n-home-manager-files/.config/git/templates/.github/ISSUE_TEMPLATE/config.yml \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 120000 index 00000000..4d77f8e9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1 @@ +/nix/store/sxkaavdlrf0762h3k07j2jm9b7d3656n-home-manager-files/.config/git/templates/.github/ISSUE_TEMPLATE/feature_request.md \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index f401c9ff..00000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,8 +0,0 @@ -*************************************************************************** -**NOTE** -Please verify that the `base repository` above has the intended destination! -Github by default opens Pull Requests against the parent of a forked repository. -If this is your personal fork and you didn't intend to open a PR for contribution -to the original project then adjust the `base repository` accordingly. -************************************************************************** - diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 120000 index 00000000..5585f140 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1 @@ +/nix/store/sxkaavdlrf0762h3k07j2jm9b7d3656n-home-manager-files/.config/git/templates/.github/pull_request_template.md \ No newline at end of file diff --git a/.github/workflows/stylua.yml b/.github/workflows/stylua.yml deleted file mode 100644 index 75db6c33..00000000 --- a/.github/workflows/stylua.yml +++ /dev/null @@ -1,21 +0,0 @@ -# Check Lua Formatting -name: Check Lua Formatting -on: pull_request_target - -jobs: - stylua-check: - if: github.repository == 'nvim-lua/kickstart.nvim' - name: Stylua Check - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Stylua Check - uses: JohnnyMorganz/stylua-action@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: latest - args: --check . - diff --git a/lua/custom/plugins/git.lua b/lua/custom/plugins/git.lua new file mode 100644 index 00000000..aefc725a --- /dev/null +++ b/lua/custom/plugins/git.lua @@ -0,0 +1,73 @@ +return { + -- Fugitive - Git integration + { + 'tpope/vim-fugitive', + cmd = { 'Git', 'G', 'Gdiff', 'Gread', 'Gwrite', 'Ggrep', 'GMove', 'GDelete', 'GBrowse', 'GRemove' }, + keys = { + { 'gs', 'Git', desc = 'Git status' }, + { 'gd', 'Gdiff', desc = 'Git diff' }, + { 'gc', 'Git commit', desc = 'Git commit' }, + { 'gb', 'Git blame', desc = 'Git blame' }, + { 'gl', 'Git log', desc = 'Git log' }, + { 'gp', 'Git push', desc = 'Git push' }, + { 'gf', 'Git fetch', desc = 'Git fetch' }, + }, + }, + -- Gitsigns - Git gutter and hunk operations + { + 'lewis6991/gitsigns.nvim', + opts = { + signs = { + add = { text = '+' }, + change = { text = '~' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + }, + on_attach = function(bufnr) + local gitsigns = require('gitsigns') + + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end + + -- Navigation + map('n', ']c', function() + if vim.wo.diff then + vim.cmd.normal({']c', bang = true}) + else + gitsigns.nav_hunk('next') + end + end, { desc = 'Next git hunk' }) + + map('n', '[c', function() + if vim.wo.diff then + vim.cmd.normal({'[c', bang = true}) + else + gitsigns.nav_hunk('prev') + end + end, { desc = 'Previous git hunk' }) + + -- Actions + map('n', 'hs', gitsigns.stage_hunk, { desc = 'Stage hunk' }) + map('n', 'hr', gitsigns.reset_hunk, { desc = 'Reset hunk' }) + map('v', 'hs', function() gitsigns.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end, { desc = 'Stage hunk' }) + map('v', 'hr', function() gitsigns.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end, { desc = 'Reset hunk' }) + map('n', 'hS', gitsigns.stage_buffer, { desc = 'Stage buffer' }) + map('n', 'hu', gitsigns.undo_stage_hunk, { desc = 'Undo stage hunk' }) + map('n', 'hR', gitsigns.reset_buffer, { desc = 'Reset buffer' }) + map('n', 'hp', gitsigns.preview_hunk, { desc = 'Preview hunk' }) + map('n', 'hb', function() gitsigns.blame_line{full=true} end, { desc = 'Blame line' }) + map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = 'Toggle line blame' }) + map('n', 'hd', gitsigns.diffthis, { desc = 'Diff this' }) + map('n', 'hD', function() gitsigns.diffthis('~') end, { desc = 'Diff this ~' }) + map('n', 'td', gitsigns.toggle_deleted, { desc = 'Toggle deleted' }) + + -- Text object + map({'o', 'x'}, 'ih', ':Gitsigns select_hunk', { desc = 'Select hunk' }) + end, + }, + }, +} \ No newline at end of file diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 2650465b..722ec301 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -7,6 +7,7 @@ return { -- { import = 'custom.plugins.completion' }, { import = 'custom.plugins.debug' }, { import = 'custom.plugins.formatting' }, + { import = 'custom.plugins.git' }, { import = 'custom.plugins.lsp' }, { import = 'custom.plugins.nvim-tmux-navigator' }, { import = 'custom.plugins.telescope' },