-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87eeef5
commit c3c8674
Showing
1 changed file
with
172 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
*git-conflict.txt* For Neovim >= 0.8.0 Last change: 2023 April 18 | ||
|
||
============================================================================== | ||
Table of Contents *git-conflict-table-of-contents* | ||
|
||
1. git-conflict.nvim |git-conflict-git-conflict.nvim| | ||
- Status |git-conflict-git-conflict.nvim-status| | ||
- Requirements |git-conflict-git-conflict.nvim-requirements| | ||
- Installation |git-conflict-git-conflict.nvim-installation| | ||
- Configuration |git-conflict-git-conflict.nvim-configuration| | ||
- Commands |git-conflict-git-conflict.nvim-commands| | ||
- Autocommands |git-conflict-git-conflict.nvim-autocommands| | ||
- Mappings |git-conflict-git-conflict.nvim-mappings| | ||
- Issues |git-conflict-git-conflict.nvim-issues| | ||
|
||
============================================================================== | ||
1. git-conflict.nvim *git-conflict-git-conflict.nvim* | ||
|
||
|
||
https://user-images.githubusercontent.com/22454918/159362564-a66d8c23-f7dc-4d1d-8e88-c5c73a49047e.mov | ||
|
||
A plugin to visualise and resolve conflicts in neovim. This plugin was inspired | ||
by conflict-marker.vim <https://github.com/rhysd/conflict-marker.vim> | ||
|
||
|
||
STATUS *git-conflict-git-conflict.nvim-status* | ||
|
||
This plugin is under active development, it should generally work, but you’re | ||
likely to encounter some bugs during usage. | ||
|
||
|
||
REQUIREMENTS *git-conflict-git-conflict.nvim-requirements* | ||
|
||
|
||
- `git` | ||
- `nvim 0.7+` | ||
|
||
|
||
INSTALLATION *git-conflict-git-conflict.nvim-installation* | ||
|
||
>lua | ||
use {'akinsho/git-conflict.nvim', tag = "", config = function() | ||
require('git-conflict').setup() | ||
end} | ||
< | ||
|
||
I recommend using the tag field of you package manager, so your version of this | ||
plugin is only updated when a new tag is pushed as `main` itself might be | ||
**unstable**. | ||
|
||
|
||
CONFIGURATION *git-conflict-git-conflict.nvim-configuration* | ||
|
||
>lua | ||
{ | ||
default_mappings = true, -- disable buffer local mapping created by this plugin | ||
default_commands = true, -- disable commands created by this plugin | ||
disable_diagnostics = false, -- This will disable the diagnostics in a buffer whilst it is conflicted | ||
highlights = { -- They must have background color, otherwise the default color will be used | ||
incoming = 'DiffText', | ||
current = 'DiffAdd', | ||
} | ||
} | ||
< | ||
|
||
|
||
COMMANDS *git-conflict-git-conflict.nvim-commands* | ||
|
||
|
||
- `GitConflictChooseOurs` — Select the current changes. | ||
- `GitConflictChooseTheirs` — Select the incoming changes. | ||
- `GitConflictChooseBoth` — Select both changes. | ||
- `GitConflictChooseNone` — Select none of the changes. | ||
- `GitConflictNextConflict` — Move to the next conflict. | ||
- `GitConflictPrevConflict` — Move to the previous conflict. | ||
- `GitConflictListQf` — Get all conflict to quickfix | ||
|
||
|
||
LISTING CONFLICTS ~ | ||
|
||
You can list conflicts in the quick fix list using the `GitConflictListQf` | ||
command | ||
|
||
|
||
|
||
quickfix displayed using nvim-pqf <https://gitlab.com/yorickpeterse/nvim-pqf> | ||
|
||
|
||
AUTOCOMMANDS *git-conflict-git-conflict.nvim-autocommands* | ||
|
||
When a conflict is detected by this plugin a `User` autocommand is fired called | ||
`GitConflictDetected`. When this is resolved another command is fired called | ||
`GitConflictResolved`. | ||
|
||
Either of these can be used to run logic whilst dealing with conflicts e.g. | ||
|
||
>lua | ||
vim.api.nvim_create_autocommand('User', { | ||
pattern = 'GitConflictDetected', | ||
callback = function() | ||
vim.notify('Conflict detected in '..vim.fn.expand('<afile>')) | ||
vim.keymap.set('n', 'cww', function() | ||
engage.conflict_buster() | ||
create_buffer_local_mappings() | ||
end) | ||
end | ||
}) | ||
< | ||
|
||
|
||
MAPPINGS *git-conflict-git-conflict.nvim-mappings* | ||
|
||
This plugin offers default buffer local mappings inside conflicted files. This | ||
is primarily because applying these mappings only to relevant buffers is | ||
impossible through global mappings. A user can however disable these by setting | ||
`default_mappings = false` anyway and create global mappings as shown below. | ||
The default mappings are: | ||
|
||
|
||
- co — choose ours | ||
- ct — choose theirs | ||
- cb — choose both | ||
- c0 — choose none | ||
- ]x — move to previous conflict | ||
- [x — move to next conflict | ||
|
||
If you would rather not use these then you can specify your own mappings. | ||
|
||
>lua | ||
require'git-conflict'.setup { | ||
default_mappings = { | ||
ours = 'o', | ||
theirs = 't', | ||
none = '0', | ||
both = 'b', | ||
next = 'n', | ||
prev = 'p', | ||
}, | ||
} | ||
< | ||
|
||
or alternatively, set `default_mappings = false` and apply the mappings | ||
yourself | ||
|
||
example manual mappings ~ | ||
|
||
>lua | ||
vim.keymap.set('n', 'co', '<Plug>(git-conflict-ours)') | ||
vim.keymap.set('n', 'ct', '<Plug>(git-conflict-theirs)') | ||
vim.keymap.set('n', 'cb', '<Plug>(git-conflict-both)') | ||
vim.keymap.set('n', 'c0', '<Plug>(git-conflict-none)') | ||
vim.keymap.set('n', ']x', '<Plug>(git-conflict-prev-conflict)') | ||
vim.keymap.set('n', '[x', '<Plug>(git-conflict-next-conflict)') | ||
< | ||
|
||
|
||
ISSUES *git-conflict-git-conflict.nvim-issues* | ||
|
||
**Please read this** — This plugin is not intended to do anything other than | ||
provide fancy visuals, and some mappings to handle conflict resolution It will | ||
not be expanded to become a full git management plugin, there are a zillion | ||
plugins that do that already, this won’t be one of those. | ||
|
||
|
||
FEATURE REQUESTS ~ | ||
|
||
Open source should be collaborative, if you have an idea for a feature you’d | ||
like to see added. Submit a PR rather than a feature request. | ||
|
||
Generated by panvimdoc <https://github.com/kdheepak/panvimdoc> | ||
|
||
vim:tw=78:ts=8:noet:ft=help:norl: |