From e15a0557f0ad778aff395519770965c39c5b8ba2 Mon Sep 17 00:00:00 2001 From: Felix Tenley Date: Wed, 26 Aug 2020 10:35:04 +0200 Subject: [PATCH] feat: add more vim-startify lists --- home/editors/init.vim | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/home/editors/init.vim b/home/editors/init.vim index a7ded78..df202b2 100644 --- a/home/editors/init.vim +++ b/home/editors/init.vim @@ -5,6 +5,16 @@ set termguicolors colorscheme gruvbox let g:gruvbox_number_column = 'bg1' +function! s:gitModified() + let files = systemlist('git ls-files -m 2>/dev/null') + return map(files, "{'line': v:val, 'path': v:val}") +endfunction + +function! s:gitUntracked() + let files = systemlist('git ls-files -o --exclude-standard 2>/dev/null') + return map(files, "{'line': v:val, 'path': v:val}") +endfunction + function! s:list_projects() abort return map(['/etc/nixos/'] + finddir('.git', $HOME . '/dev/**4', -1), \ {_, dir -> { @@ -12,8 +22,18 @@ function! s:list_projects() abort \ 'path': fnamemodify(dir, ':h')}}) endfunction +let g:startify_commands = [ + \ {'h': ['Vim Help', 'help']}, + \ {'r': ['Vim Reference', 'help reference']}, + \ ] + let g:startify_lists = [ - \ {'header': [' Projects'], 'type': function('s:list_projects')} + \ { 'header': [' Sessions'], 'type': 'sessions' }, + \ { 'header': [' git modified'], 'type': function('s:gitModified') }, + \ { 'header': [' git untracked'], 'type': function('s:gitUntracked') }, + \ { 'header': [' Projects'], 'type': function('s:list_projects') }, + \ { 'header': [' Recent files'], 'type': 'files' }, + \ { 'header': [' Commands'], 'type': 'commands' }, \ ] let mapleader=" "