Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mapping to open commit in preview window #93

Open
maujim opened this issue May 27, 2021 · 1 comment
Open

Add mapping to open commit in preview window #93

maujim opened this issue May 27, 2021 · 1 comment

Comments

@maujim
Copy link
Contributor

maujim commented May 27, 2021

Map p to open the commit in preview window. I'm happy to help work on this but I'm not sure where to start.

@idbrii
Copy link
Contributor

idbrii commented May 8, 2023

Fugitive uses p to open in preview, but doesn't expose a command or function for other plugins to use that functionality. That means, you need to open the commit outside the preview window and then force the preview window to display it. Something like this would work but is likely to mess up your window layout:

nnoremap <buffer> p <Cmd>pclose<Bar>split<Bar>exec "Gedit" gv#sha()<Bar>pedit<Bar>close<CR>

Add that to ~/.vim/after/ftplugin/GV.vim.

Or you could figure out the correct fugitive:// path for the commit and :pedit that. Or, even better, get fugitive to expose a function to make this trivial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants