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

How to just diff split the current buffer? #471

Open
jcorbin opened this issue Mar 6, 2024 · 1 comment
Open

How to just diff split the current buffer? #471

jcorbin opened this issue Mar 6, 2024 · 1 comment

Comments

@jcorbin
Copy link

jcorbin commented Mar 6, 2024

I'm trying to recover an analog of fugitive's :Gsplit but using diffview instead:

  • it looks like one could just :split diffview://......
  • but what's the best way to compute that "diffview path for the current buffer" url?
  • basically I'm trying to make my own :DiffviewSplit command, rather than using the whole tabpage ui deal
@jcorbin
Copy link
Author

jcorbin commented Mar 6, 2024

Here's where I'm at currently:

vim.api.nvim_create_user_command('DiffviewSplit', function()
  local bufname = vim.api.nvim_buf_get_name(0)
  vim.cmd.split('diffview://' .. bufname)
  -- NOTE this doesn't work, since diffview want a url more like
  -- 'diffview://' .. gitdir .. ':0:' .. relpath
end, {})

is there some function inside require('diffview') that can get the correct url?

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

1 participant