vim: vim-startify

This commit is contained in:
Michael Grote 2021-11-21 11:22:17 +01:00
parent 6f2ae23867
commit 5f96ec0ba7

28
.vimrc
View file

@ -18,6 +18,8 @@ Plugin 'tpope/vim-sleuth'
Plugin 'itchyny/lightline.vim'
" buffer in tabline
Plugin 'ap/vim-buftabline'
" start screen
Plugin 'mhinz/vim-startify'
" multi cursor; setze cursor mit \\\
Plugin 'mg979/vim-visual-multi'
" Markdown-Preview in Browser
@ -116,9 +118,33 @@ let g:lightline = {
function! GitBranch()
return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
endfunction
" ### markdown-preview
nmap <C-m> <Plug>MarkdownPreviewToggle
" vim-startify
" returns all modified files of the current git repo
" `2>/dev/null` makes the command fail quietly, so that when we are not
" in a git repo, the list will be empty
function! s:gitModified()
let files = systemlist('git ls-files -m 2>/dev/null')
return map(files, "{'line': v:val, 'path': v:val}")
endfunction
" same as above, but show untracked files, honouring .gitignore
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
let g:startify_lists = [
\ { 'type': 'files', 'header': [' MRU'] },
\ { 'type': 'dir', 'header': [' MRU '. getcwd()] },
\ { 'type': 'sessions', 'header': [' Sessions'] },
\ { 'type': 'bookmarks', 'header': [' Bookmarks'] },
\ { 'type': function('s:gitModified'), 'header': [' git modified']},
\ { 'type': function('s:gitUntracked'), 'header': [' git untracked']},
\ { 'type': 'commands', 'header': [' Commands'] },
\ ]
" ### Keybindings
" deaktiviere Ex-Mode keybinding