diff --git a/README.md b/README.md index 5258846..7ac0cff 100644 --- a/README.md +++ b/README.md @@ -116,14 +116,17 @@ lualine.inactiveSections = {
Available components -* branch -* encoding -* fileformat -* filename -* filetype -* location -* mode -* progress +* general + * branch + * encoding + * fileformat + * filename + * filetype + * location + * mode + * progress +* plugin + * signify
@@ -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) diff --git a/lua/lualine/components/signify.lua b/lua/lualine/components/signify.lua new file mode 100644 index 0000000..4726a4a --- /dev/null +++ b/lua/lualine/components/signify.lua @@ -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