TimUntersberger / Neogit
Programming Languages
Neogit
A work-in-progress Magit clone for Neovim that is geared toward the Vim philosophy.
Installation
Plugin Manager | Command |
---|---|
Packer | use 'TimUntersberger/neogit' |
Vim-plug | Plug 'TimUntersberger/neogit' |
NeoBundle | NeoBundle 'TimUntersberger/neogit' |
Vundle | Bundle 'TimUntersberger/neogit' |
Pathogen | git clone https://github.com/TimUntersberger/neogit.git ~/.vim/bundle/neogit |
Dein | call dein#add('TimUntersberger/neogit') |
You also use in the built-in package manager:
$ git clone --depth 1 https://github.com/TimUntersberger/neogit $XDG_CONFIG_HOME/nvim/pack/plugins/start/neogit
Usage
You can either open neogit by using the Neogit
command or using the lua api:
local neogit = require('neogit')
neogit.status.create(<kind>)
The create function takes 1 optional argument that can be one of the following values:
- tab (default)
- floating
- split
Status Keybindings
Keybinding | Function |
---|---|
Tab | Toggle diff |
1, 2, 3, 4 | Set a foldlevel |
$ | Command history |
b | Branch popup |
s | Stage (also supports staging selection/hunk) |
S | Stage unstaged changes |
<C-s> | Stage Everything |
u | Unstage (also supports staging selection/hunk) |
U | Unstage staged changes |
c | Open commit popup |
L | Open log popup |
p | Open pull popup |
P | Open push popup |
Z | Open stash popup |
? | Open help popup |
x | Discard changes (also supports discarding hunks) |
<C-r> | Refresh Buffer |
<C-C><C-C> | Commit (when writing a commit message) |
Contextual Highlighting
The colors for contextual highlighting are defined with these highlight groups:
hi def NeogitDiffAddHighlight guibg=#404040
hi def NeogitDiffDeleteHighlight guibg=#404040
hi def NeogitDiffContextHighlight ctermbg=4 guibg=#333333
hi def NeogitHunkHeader guifg=#cccccc guibg=#404040
hi def NeogitHunkHeaderHighlight guifg=#cccccc guibg=#4d4d4d
You can override them to fit your colorscheme by creating a syntax/NeogitStatus.vim
in your vim configuration.
Todo
The todo file does not represent ALL of the missing features. This file just shows the features which I noticed were missing and I have to implement. This file will grow in the future.
Testing
Assure that you have plenary.nvim
installed as a plugin for your neovim instance. Afterwards, run make test
to run the unit test suite.
Plenary uses it's own port of busted and a bundled luassert, so consult their code and the respective busted and luassert docs for what methods are available.