Marks staged lines in the gutter and allows moving partial hunks back and forth.
Fixes some issues in other packages that rely on
(tree-view and git-diff for example).
It does not detect all status changes, but this package notifies it of every missing
apm install git-diff-staged
This plugin extends styles in core package git-diff.
Visual distinction is implemented only with no icons (
Show Icons In Editor Gutter disabled),
i.e. with the left borders and small triangles.
Staged changes are indicated with dotted left borders. Staged deletions are marked by changing the color of the triangle.
Inconsistencies between index and current file are marked with white color and dotted thinner border. You can see this when you stage a change and then undo it. You can correct these by toggling the staged state.
Adds all changed lines within selection to index, unless all changed lines already are in index, in which case they are removed from index. If selection contains no changes, staged or not, nothing is done.
toggle-selected, instead of selected lines this
variation uses the hunk surrounding cursor, if there are changes
at that position.
Operator to toggle staging status for a movement
TextObjects to operate with e.g.
Both work identically.
Motions to move forward/backward by hunk(s)
Note that you don't need to save the file to modify the index.
No default keymap provided.
'atom-workspace atom-text-editor': 'ctrl-alt-shift-cmd-s': 'git-diff-staged:toggle-selected' 'ctrl-alt-shift-cmd-h': 'git-diff-staged:toggle-hunk-at-cursor' # vim-mode-plus: 'atom-text-editor.vim-mode-plus.operator-pending-mode, atom-text-editor.vim-mode-plus.visual-mode': 'i h': 'git-diff-staged:inner-hunk' 'a h': 'git-diff-staged:a-hunk' 'atom-workspace atom-text-editor:not([mini]):not(.insert-mode).vim-mode-plus': 'g s s': 'git-diff-staged:toggle-staged' 'g s j': 'git-diff-staged:move-to-next-hunk' 'g s k': 'git-diff-staged:move-to-previous-hunk'
Indicator of modified lines makes no difference for lines that are not in index and lines that are in index but are different from the current buffer.
You may customize the git command path with
If you are using
git-plus package, it's configuration
git-plus.general.gitPath is used (unless you want to override it).
By default preceding deletions are included when the first line to staged is a modification.
You can prevent that with
I'd like to keep this package as simple as possible so new features are critically observed. Creating an issue before creating a pull request is good practice.
Particularly help with styles is greatly appreciated. I don't have the necessary skills to get good defaults that work with various themes.
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.