diff --git a/README.md b/README.md index 7ea1bdf..b066834 100644 --- a/README.md +++ b/README.md @@ -10,5 +10,7 @@ This project contains my dotfiles and scripts for daily usage. In addition to th - dunst - neovim - git + - git delta + - lazygit - scripts - `compiledoc` - compile a markdown or latex file into pdf using pandoc and tectonic diff --git a/roles/git/files/lazygit.yml b/roles/git/files/lazygit.yml new file mode 100644 index 0000000..9b83937 --- /dev/null +++ b/roles/git/files/lazygit.yml @@ -0,0 +1,17 @@ +git: + paging: + colorArg: always + pager: delta --paging=never + +customCommands: + - key: "" + command: "git remote prune {{.SelectedRemote.Name}}" + context: "remotes" + loadingText: "Pruning..." + description: "prune deleted remote branches" + + - key: "" + command: "git branch --merged develop | grep -v '^[ *]*develop$' | xargs git branch -d" + context: "localBranches" + loadingText: "Pruning..." + description: "prune local branches that have been merged to develop" diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml index 8138549..d99f83b 100644 --- a/roles/git/tasks/main.yml +++ b/roles/git/tasks/main.yml @@ -4,6 +4,7 @@ name: - git - git-delta + - lazygit state: present become: true tags: pc @@ -28,3 +29,10 @@ dest: ~/.config/git/config mode: '0644' tags: qwerty + +- name: Copy over config for lazygit + ansible.builtin.copy: + src: lazygit.yml + dest: ~/.config/lazygit/config.yml + mode: '0644' + tags: pc diff --git a/roles/nvim/files/init_pc.lua b/roles/nvim/files/init_pc.lua index 9fd6733..4f8c0bb 100644 --- a/roles/nvim/files/init_pc.lua +++ b/roles/nvim/files/init_pc.lua @@ -36,6 +36,7 @@ require('packer').startup(function() use 'tpope/vim-surround' -- Surrounding use 'tpope/vim-repeat' -- Repeat Surrounding use 'tpope/vim-sleuth' -- Detect Spacing + use 'kdheepak/lazygit.nvim' -- Git Client use "tversteeg/registers.nvim" -- Preview Registers use 'windwp/nvim-autopairs' -- Autopairs use 'windwp/nvim-ts-autotag' -- HTML Autopairs @@ -434,3 +435,6 @@ map('n', 'dd', 'lua require"dapui".toggle()', { noremap = true -- registers preview require("registers").setup() + +-- Lazygit +map('n', 'g', 'LazyGit', { noremap = true })