added signify component (#18)

This commit is contained in:
hoob3rt 2021-01-04 00:37:49 +01:00 committed by GitHub
parent b8ad8a13b2
commit 0194740d28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 9 deletions

View File

@ -116,14 +116,17 @@ lualine.inactiveSections = {
<details>
<summary><b>Available components</b></summary>
* branch
* encoding
* fileformat
* filename
* filetype
* location
* mode
* progress
* general
* branch
* encoding
* fileformat
* filename
* filetype
* location
* mode
* progress
* plugin
* signify
</details>
@ -249,7 +252,7 @@ Please create an issue/ pr if you want to see more functionality implemented
- [ ] [liuchengxu/vista.vim](https://github.com/liuchengxu/vista.vim)
- [ ] [preservim/tagbar](https://github.com/preservim/tagbar)
- Plugin Components
- [ ] [vim-signify](https://github.com/mhinz/vim-signify)
- [x] [vim-signify](https://github.com/mhinz/vim-signify)
- Diagnostics
- [ ] nvim-lsp status support
- [ ] [coc.nvim](https://github.com/neoclide/coc.nvim)

View File

@ -0,0 +1,10 @@
local function signify()
if vim.fn.exists('*sy#repo#get_stats') == 0 then return '' end
local added, modified, removed = unpack(vim.fn['sy#repo#get_stats']())
if added == -1 then added = 0 end
if modified == -1 then modified = 0 end
if removed == -1 then removed = 0 end
return '+' .. added .. ' ~'.. modified .. ' -' .. removed
end
return signify