Posts
vim-flog - a interactive git history viewer
Haven’t seen much exposure to this awesome plugin, even on reddit it seems that it’s not so well known, so i wanted to share it. It’s basically a git-log replacement integrated with neovim(and fugitive) that updates automatically(or manually) whenever you do any changes to your git repository. Really useful to get a overall picture of what’s going on in a repo. Or for debugging git branch problems etc.
https://github.com/rbong/vim-flogOpen linkView original on lemmy.worldkeymap to inspect unsaved changes
Hello, I wanted to share a small keymap I made. It lets you inspect unsaved changes in the current file. It uses diff mode, in a vertical split.
To close the diff mode, just press q in the scratch buffer.
vim.keymap.set(
'n',
'<M-C-D>',
function()
local tmpft = vim.bo.filetype
vim.cmd.vnew()
vim.bo.filetype = tmpft
vim.bo.buftype = 'nofile'
vim.keymap.set(
'n',
'q',
'<cmd>bw<cr>',
{ noremap = true, silent = true, buffer = true }
)
vim.cmd('silent r#|0d_')
vim.bo.modifiable = false
vim.cmd('diffthis|wincmd p|diffthis')
end,
{ noremap = true }
)
edit: I discovered that this functionality is actually documented in the help pages (:h :DiffOrig). It’s basically the same action but bound to a command
