feat(nvim): git blame
This commit is contained in:
parent
42004fddfd
commit
1030fab4ea
2
home.nix
2
home.nix
@ -27,6 +27,7 @@ in
|
|||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
(nerdfonts.override { fonts = [ "Meslo" ]; })
|
(nerdfonts.override { fonts = [ "Meslo" ]; })
|
||||||
android-tools
|
android-tools
|
||||||
|
awscli2
|
||||||
bashInteractive
|
bashInteractive
|
||||||
gitAndTools.gh
|
gitAndTools.gh
|
||||||
google-cloud-sdk
|
google-cloud-sdk
|
||||||
@ -50,7 +51,6 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
# Misc Programs
|
# Misc Programs
|
||||||
programs.awscli.enable = true;
|
|
||||||
programs.htop.enable = true;
|
programs.htop.enable = true;
|
||||||
programs.jq.enable = true;
|
programs.jq.enable = true;
|
||||||
programs.k9s.enable = true;
|
programs.k9s.enable = true;
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
vim.keymap.set('n', '<leader>go', '<cmd>DiffviewOpen<CR>')
|
vim.keymap.set('n', '<leader>go', '<cmd>DiffviewOpen<CR>')
|
||||||
vim.keymap.set('n', '<leader>gc', '<cmd>DiffviewClose<CR>')
|
vim.keymap.set('n', '<leader>gO', '<cmd>DiffviewOpen origin/main...HEAD<CR>')
|
||||||
vim.keymap.set('n', '<leader>gh', '<cmd>DiffviewFileHistory<CR>')
|
vim.keymap.set('n', '<leader>gh', '<cmd>DiffviewFileHistory<CR>')
|
||||||
|
vim.keymap.set('n', '<leader>gH',
|
||||||
|
'<cmd>DiffviewFileHistory --range=origin..HEAD<CR>')
|
||||||
|
vim.keymap.set('n', '<leader>gc', '<cmd>DiffviewClose<CR>')
|
||||||
|
16
nvim/config/lua/git-signs.lua
Normal file
16
nvim/config/lua/git-signs.lua
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
require('gitsigns').setup {
|
||||||
|
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
|
||||||
|
|
||||||
|
map('n', '<leader>gb', gitsigns.toggle_current_line_blame)
|
||||||
|
map('n', '<leader>gB', function()
|
||||||
|
gitsigns.blame_line {full = true}
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
}
|
@ -5,6 +5,7 @@ require('cmp-config')
|
|||||||
require('comment-config')
|
require('comment-config')
|
||||||
require('dap-config')
|
require('dap-config')
|
||||||
require('diffview-config')
|
require('diffview-config')
|
||||||
|
require('git-signs')
|
||||||
require('leap-config')
|
require('leap-config')
|
||||||
require('lsp-config')
|
require('lsp-config')
|
||||||
require('lsp-lines-config')
|
require('lsp-lines-config')
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
------------------------------------------------------
|
||||||
|
------------------- Custom Settings ------------------
|
||||||
|
------------------------------------------------------
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = "go",
|
||||||
|
callback = function() vim.bo.textwidth = 120 end
|
||||||
|
})
|
||||||
|
|
||||||
------------------------------------------------------
|
------------------------------------------------------
|
||||||
-------------------- Built-in LSP --------------------
|
-------------------- Built-in LSP --------------------
|
||||||
------------------------------------------------------
|
------------------------------------------------------
|
||||||
|
@ -15,7 +15,7 @@ local function execute_command()
|
|||||||
local spawn_opts = {
|
local spawn_opts = {
|
||||||
detached = true,
|
detached = true,
|
||||||
stdio = {nil, stdout, nil},
|
stdio = {nil, stdout, nil},
|
||||||
args = {"-c", "gh pr checks | awk '{ print $2 }'"}
|
args = {"-c", "gh pr checks | awk -F'\t' '{ print $2 }'"}
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.loop.spawn("bash", spawn_opts,
|
vim.loop.spawn("bash", spawn_opts,
|
||||||
@ -29,14 +29,14 @@ vim.fn.timer_start(300000, execute_command)
|
|||||||
-- Return status from cache
|
-- Return status from cache
|
||||||
function pr_status()
|
function pr_status()
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
-- PENDING COLOR - #d29922
|
-- PENDING COLOR - #d29922
|
||||||
-- PASS COLOR - #3fb950
|
-- PASS COLOR - #3fb950
|
||||||
-- FAIL COLOR - #f85149
|
-- FAIL COLOR - #f85149
|
||||||
return cached_pr_status:gsub("\n", ""):gsub("fail", " "):gsub("pass",
|
return cached_pr_status:gsub("\n", ""):gsub("fail", " "):gsub("pass",
|
||||||
" ")
|
" ")
|
||||||
:gsub("pending", " "):sub(1, -2)
|
:gsub("pending", " "):gsub("skipping", " "):sub(1, -2)
|
||||||
end
|
end
|
||||||
|
|
||||||
require('lualine').setup({
|
require('lualine').setup({
|
||||||
|
@ -23,9 +23,16 @@ wk.register({
|
|||||||
},
|
},
|
||||||
g = {
|
g = {
|
||||||
name = "DiffView",
|
name = "DiffView",
|
||||||
o = {"<cmd>DiffviewOpen<cr>", "Open Diff"},
|
o = {"<cmd>DiffviewOpen<cr>", "Open Diff - Current"},
|
||||||
|
O = {"<cmd>DiffviewOpen origin/main...HEAD<cr>", "Open Diff - Main"},
|
||||||
|
h = {"<cmd>DiffviewFileHistory<cr>", "Diff History"},
|
||||||
|
H = {
|
||||||
|
"<cmd>DiffviewFileHistory --range=origin..HEAD<cr>",
|
||||||
|
"Diff History - Main"
|
||||||
|
},
|
||||||
c = {"<cmd>DiffviewClose<cr>", "Close Diff"},
|
c = {"<cmd>DiffviewClose<cr>", "Close Diff"},
|
||||||
h = {"<cmd>DiffviewFileHistory<cr>", "Diff History"}
|
b = {"Git Blame Line"},
|
||||||
|
B = {"Git Blame Full"}
|
||||||
},
|
},
|
||||||
f = {
|
f = {
|
||||||
name = "Find - Telescope",
|
name = "Find - Telescope",
|
||||||
|
@ -31,6 +31,7 @@ in
|
|||||||
aerial-nvim # Code Outline
|
aerial-nvim # Code Outline
|
||||||
comment-nvim # Code Comments
|
comment-nvim # Code Comments
|
||||||
diffview-nvim # Diff View
|
diffview-nvim # Diff View
|
||||||
|
gitsigns-nvim # Git Blame
|
||||||
leap-nvim # Quick Movement
|
leap-nvim # Quick Movement
|
||||||
markdown-preview-nvim # Markdown Preview
|
markdown-preview-nvim # Markdown Preview
|
||||||
neo-tree-nvim # File Explorer
|
neo-tree-nvim # File Explorer
|
||||||
|
Loading…
Reference in New Issue
Block a user