[nvim] Add gitlens, scratchfile lua plugins

Added gitlens to show git blame for cursorline after short time. Added
makescratch plugin to create a new scratch window via simple command.
This commit is contained in:
Marty Oehme 2020-05-09 14:46:49 +02:00
parent e6e384270a
commit 00b15048df
No known key found for this signature in database
GPG key ID: 0CCB0526EFB9611A
4 changed files with 81 additions and 0 deletions

View file

@ -0,0 +1,23 @@
function s:setupGitLens()
" -- disable gitlens unconditionally, and remove virtual text
lua require('gitlens').clearBlameVirtText()
augroup GitLens
autocmd!
augroup END
" -- if it is wanted enable gitlens on holding the cursor
if g:gitlens_enable
augroup GitLens
autocmd! CursorHold * lua require('gitlens').blameVirtText()
autocmd! CursorMoved * lua require('gitlens').clearBlameVirtText()
autocmd! CursorMovedI * lua require('gitlens').clearBlameVirtText()
augroup END
endif
endfunction
function s:toggleGitLens()
let g:gitlens_enable = !get(g:, 'gitlens_enable', 1)
call s:setupGitLens()
endfunction
command! GitLensToggle call s:toggleGitLens()

View file

@ -0,0 +1,5 @@
function s:makeScratch()
lua require('scratchpad').makeScratch()
endfunction
command! ScratchPad call s:makeScratch()