git-conflict.nvim icon indicating copy to clipboard operation
git-conflict.nvim copied to clipboard

Feature: Choose Ours/Theirs/Both for entire File

Open ariel-frischer opened this issue 3 years ago • 10 comments

I really like this plugin, only thing I wish it has would be some util functions Choose ours/theirs/both for the entire file. The use case is, I had a yarn.lock file where many conflicts occurred. It had over 400 conflicts which is actually normal for a larger codebase. Going to next conflict and resolving in this case is not feasible, I just created a quick macro and called it +400 times which worked but seems janky and inefficient. A command mode function for this situation seems appropriate.

ariel-frischer avatar Oct 31 '22 18:10 ariel-frischer

Would be happy to take a PR to implement something like this, maybe allowing the commands to take a visual range 🤷🏿‍♂️. Probably not going to work on this myself though, as I definitely don't have the time.

akinsho avatar Nov 07 '22 08:11 akinsho

A vim macro should be a decent solution for this.

Chaitanyabsprip avatar Feb 25 '23 07:02 Chaitanyabsprip

This is super late, but why not just use git checkout {branch_name} -- {filepath} to checkout the file from the branch you want?

partounian avatar Aug 09 '23 00:08 partounian

This is super late, but why not just use git checkout {branch_name} -- {filepath} to checkout the file from the branch you want?

Yea good point.

ariel-frischer avatar Aug 09 '23 01:08 ariel-frischer

Hi, is this possible then? I don't know how to create that action, should we wait for a solution from the plugin author o could we implemente something on our own?

jgarciaokode avatar Sep 20 '23 10:09 jgarciaokode

I'm for using a visual selection; that makes it much more general than the whole file.

Tokarak avatar Oct 28 '23 09:10 Tokarak

I made a PR for this that adds visual mode remaps a few months ago, but it hasnt gotten any comments or anything from @akinsho so im not really sure if it's going to be merged

CWood-sdf avatar Mar 27 '24 00:03 CWood-sdf

@CWood-sdf thanks for the PR I noticed it but have not really had the time to look into open source projects given work and life, let alone this is one of my smaller plugins 😅. It's on my todo list

akinsho avatar Mar 28 '24 10:03 akinsho